USI / SPI info

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

larry wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's an Atmel app note about this isn't there?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

it seems somewhat vague. I want nuts and bolts details...

larry wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You do realise that AVR319 even comes with example C code? Surely that's enough to get you started?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have looked at AVR139 and see the code references, but I don't see any actual code. Asm code would be preferred.

larry wilson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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).

http://www.atmel.com/dyn/resourc...

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The AVR319 files are in:

http://www.atmel.com/dyn/resourc...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

Happy 75th anniversary to one of the best movies ever made! Rick Blane [Bogart]: "Of all the gin joints, in all the towns, in all the world, she walks into mine."

 

"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]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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.

 

David.