Is there a tutorial on using USI / SPI?
Maybe a good reference that will enable me to get SPI up and running on a tiny84.
There's an Atmel app note about this isn't there?
it seems somewhat vague. I want nuts and bolts details...
You do realise that AVR319 even comes with example C code? Surely that's enough to get you started?
I have looked at AVR139 and see the code references, but I don't see any actual code. Asm code would be preferred.
Isn't there something in the data sheet for the device?
EDIT: just checked; there is no SPI, just USI.
Example ASM code in the datasheet; ch. 14.3.2 (page 119 onwards).
If you think education is expensive, try ignorance.
The AVR319 files are in:
And in general, at the Atmel site (specifically the page with app notes) the notes per se have PDF icons, and to the right of some of these are disc icons which are links to the sample code.
"He used to carry his guitar in a gunny sack, or sit beneath the tree by the railroad track. Oh the engineers would see him sitting in the shade, Strumming with the rhythm that the drivers made. People passing by, they would stop and say, "Oh, my, what that little country boy could play!" [Chuck Berry]
"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]
I would like to utilize the SPI. App Note AVR151 says most AVRs have it onboard, but it appears to me it is only for flash programming. I say that because I cannot find the SPI registers on the attiny's I looked at. I am using the tiny24 but would switch if anybody knows of any attiny that has a general purpose SPI. I cannot simulate with USI because I need mode 3. Thank you.
Tinies (in small packages) as a rule don't have real SPI, some larger ones do. Some have USARTs that can be used as SPI masters.
Ampertronics Pty. Ltd.
* Electronic Design * Custom Products * Contract Assembly
You can do mode #3 with USI if you want to. (I think)
As a general rule, it is never wise to use USI as a Master. It works quite well as a Slave. (which is what a Tiny is intended for)
If you want a Master, the t2313A, t4313, t1634 can all do USART_MSPI which is miles better than a Mega SPI peripheral.
©2015 Atmel Corporation