| Author |
Message |
|
|
Posted: May 12, 2012 - 02:43 PM |
|

Joined: Mar 19, 2003
Posts: 736
|
|
The ATTINY2313 comes real close to meeting your needs for hardware I2C(TWI) and SPI - also very low cost. However, even though this processor supports both of these functions with separate sets of hardware using the USI and UART respectively, they share the same pins. This is unfortunate.
The next stop for hardware TWI and SPI is the ATMEGA48 which you believe to be too costly.
Looks like bit banging is in your future. However, don't fret. Bit banging an SPI in master mode is extremely simple and fast. |
|
|
| |
|
|
|
|
|
Posted: May 12, 2012 - 02:56 PM |
|


Joined: Sep 04, 2002
Posts: 21267
Location: Orlando Florida
|
|
| Finally. For once, someone else on this stoopid forum has the sense to just type in the message to fill the screen with automattically wrapped text. It looks so warm and familiar. It made my morning. |
_________________ Imagecraft compiler user
|
| |
|
|
|
|
|
Posted: May 12, 2012 - 04:57 PM |
|


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA
|
|
Oh, thank you. I thought you would like that.  |
_________________ Larry
Those afraid to embrace the future will quickly fade into the past. - larryvc
|
| |
|
|
|
|
|
Posted: May 13, 2012 - 04:32 AM |
|


Joined: Dec 06, 2007
Posts: 2512
Location: Redmond, WA USA
|
|
Jim,
Im sure there are many other demos for SPI and usi but I came across this one on the net. I tried the Master-Slave code and it works great. I plan on trying the ATtiny2313 USI as Master code next.
http://www.jaxcoder.com/Projects.aspx?id=280385176 |
_________________ Larry
Those afraid to embrace the future will quickly fade into the past. - larryvc
|
| |
|
|
|
|
|
Posted: May 14, 2012 - 12:34 PM |
|

Joined: Sep 29, 2009
Posts: 16
|
|
Jimlake,
Not only is there a core speed difference between the PIC & Atmel products but the words are different bit lengths.
PIC16F684 has 2k words flash, which is actually 3.5k bytes because of a 14-bit word length.
Atmel's Attiny processors have a 16-bit word length so the attiny24 & attiny2313 processors will have only 1k words flash (2kB), the attiny44 2k words flash (4kB) and the attiny84 4k words flash (8kB).
Flenser |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 03:02 AM |
|

Joined: Aug 05, 2005
Posts: 267
Location: Tacoma, WA
|
|
To address Steve's question, it appears that most of the small 8 bitters do not have a SPI, the AVR's, at least, have a USI. None of them have a i2c.
It looks to me like the difference between the SPI and the USI is the lack of MISO. This can be a bit of a pita if the other device is expecting a full HW SPI. I have decided to resolve this by using a Mega48. In the VQFN package, it is very small, but it does cost more than the Tiny. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 06:35 AM |
|


Joined: Jan 03, 2006
Posts: 4417
Location: Hemel Hemsptead, UK
|
|
As a master, SPI is easier to generate than I2C which is basically an abomination of a protocol. Having to change the direction of both the clock and data line in I2C to manage the three-state and clock stretching parts is a pain, and the PIC's inability properly to implement read/modify/write when a port is driving a capacitive load is extremely annoying.
There are PICS in the 18F series (next size up basically - twenty-eight pins or more) that have UART, SPI, and I2C but the implementation on the ones I examined meant that you could use only one of the three at a time, and the distribution of pins was such that even the inputs and outputs didn't match so it would be very tricky to change between them programatically. |
_________________ Neil Barnes
www.nailed-barnacle.co.uk
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 06:36 AM |
|

Joined: Dec 18, 2001
Posts: 4716
|
|
All relative I suppose. To me, the mega32 is "small", in that RAM size tends to limit what you can do.
indeed, there are many 2KB code apps. I just don't often do that kind. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 08:51 AM |
|


Joined: Jan 08, 2009
Posts: 1155
Location: Lund, Sweden
|
|
The tiny48/88 do have both SPI and I2C (but no usart ). |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 09:15 AM |
|

Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia
|
|
| The Tiny1634 has 2 UARTS, 2 I2C, SPI (via UART/USI), ADC etc. in a 20 pin package. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 12:43 PM |
|

Joined: Dec 08, 2004
Posts: 4719
Location: Nova Scotia, Canada
|
|
|
MBedder wrote:
The Tiny1634 has 2 UARTS, 2 I2C, SPI (via UART/USI), ADC etc. in a 20 pin package.
And no inventory from any of Atmel's preferred distributors. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 12:53 PM |
|

Joined: Dec 08, 2004
Posts: 4719
Location: Nova Scotia, Canada
|
|
|
jimlake wrote:
To address Steve's question, it appears that most of the small 8 bitters do not have a SPI, the AVR's, at least, have a USI. None of them have a i2c.
It looks to me like the difference between the SPI and the USI is the lack of MISO. This can be a bit of a pita if the other device is expecting a full HW SPI. I have decided to resolve this by using a Mega48. In the VQFN package, it is very small, but it does cost more than the Tiny.
What exactly do you mean by "no MISO"?
The USI uses DI (MISO for Master systems, MOSI for Slave systems), DO (MOSI for Master systems, MISO for Slave systems), and USCK (SCLK output for Master systems, SCLK input for Slave systems).
It does not have hardware slave select - but for a SPI master, that's a fairly easy limitation to work around.
It is designed to do SPI modes 0 and 1; apparently it's not suited to modes 2 or 3.
Section 14.3.2 of the ATtiny24 datasheet shows an assembly function for USI operating in 3-wire Master mode, that accepts the desired output byte to be sent to the slave via DO as an argument, and returns the read-back value from DI.
Section 14.3.3 demonstrates using the USI in 3-wire Slave mode. |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 02:43 PM |
|


Joined: Feb 19, 2001
Posts: 25921
Location: Wisconsin USA
|
|
|
Quote:
The Tiny1634 has 2 UARTS, 2 I2C, SPI (via UART/USI), ADC etc. in a 20 pin package.
Wow--where did THAT model come from? |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 02:45 PM |
|


Joined: Jul 18, 2005
Posts: 62324
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
|
Quote:
Wow--where did THAT model come from?
+1
Is there anything else "lurking"? I imagine the device support list in the recently released final AS6 might be a good place to look for "new meat"? |
_________________
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 02:48 PM |
|


Joined: Feb 19, 2001
Posts: 25921
Location: Wisconsin USA
|
|
|
Quote:
And no inventory from any of Atmel's preferred distributors.
How can you say that, when Atmel's press release from March says
Quote:
All AVR ATtiny1634 devices are available now...
 |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 06:49 PM |
|

Joined: Jan 09, 2007
Posts: 1875
Location: Arlington, Texas, U.S.A.
|
|
|
theusch wrote:
Wow--where did THAT model come from?
What's Changed.
Thank you Atmel! |
|
|
| |
|
|
|
|
|
Posted: May 15, 2012 - 06:54 PM |
|

Joined: Nov 02, 2009
Posts: 3239
Location: Zelenograd, Russia
|
|
|
gchapman wrote:
Thank you Atmel!
...for yet another vaporware chip  |
|
|
| |
|
|
|
|
|
Posted: May 16, 2012 - 12:00 AM |
|

Joined: Mar 19, 2003
Posts: 736
|
|
| Mouser is showing a delivery date of 7/6/2012 for the ATTINY1634. This looks like a really nice part for less than $1.00. |
|
|
| |
|
|
|
|
|
Posted: May 16, 2012 - 12:30 AM |
|


Joined: Sep 04, 2002
Posts: 21267
Location: Orlando Florida
|
|
| So someone wanted an avr with those specs, and placed an advance order for a couple million or whatever the R&D deal was, and the distributers get what overflows into the supply chain after the initial run to the initial customer is fulfilled? How does the distribution model work? If they can deliver in 2 months after the product announcement, they must be building up stock. Any old semiconductor retiress out there that want to give some insight how it really works? |
_________________ Imagecraft compiler user
|
| |
|
|
|
|
|
Posted: May 16, 2012 - 12:35 AM |
|


Joined: Sep 04, 2002
Posts: 21267
Location: Orlando Florida
|
|
| On a similar theoretical semiconductor question... would an AVR with dual CPUs get anyone excited? Seems like if you consider yourself an Expert AVR programmer, the idea of being able to write two programs/tasks and get double thruput is a win. Digital filters, etc. If anyone from Atmel reads this and forwards it to the VP of Good Ideas Submitted from the AVRfreaks, just add a PS that this one is a stockholder. |
_________________ Imagecraft compiler user
|
| |
|
|
|
|
|