Software SPI

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

Could anyone give me AVR source code to implement SPI by software? I
need it because I want to have SPI and also external interrupt on
ATTiny22. But the pins are overlapped if the two functions are used.

Thanks!

Re: Software SPI
Quoted text here. Click to load it


Atmel has an app. note with software SPI receive. I modified it for transmit
using a '2313, and it worked fine, communicating with a PIC with hardware
SPI.

Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller



Re: Software SPI
Quoted text here. Click to load it

Sorry, that should read SPI master instead of  SPI receive. I actually
modified it for slave operation, with a PIC SPI master.

Leon



Re: Software SPI
Quoted text here. Click to load it


Please note that a software SPI slave is in a very difficult
timing position: all transfers are timed solely by the master
and the slave must be fast enough to keep up, This will usually
mean thet the slave has to use most of the processing time
polling the SPI clock.

--

Tauno Voipio
tauno voipio (at) iki fi



Re: Software SPI
Quoted text here. Click to load it

Polling? Why not interrupt-on-change?

Re: Software SPI

Quoted text here. Click to load it

Probably because the original poster wanted to use the interrupt for
something else. Sound like he needs to rethink the problem.

Peter



Re: Software SPI
Quoted text here. Click to load it


Thanks!

Site Timeline