Reply by Peter November 19, 20042004-11-19
"Lewin A.R.W. Edwards" <larwe@larwe.com> wrote in message 
news:608b6569.0411160429.54257c12@posting.google.com...
>> 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. > > Polling? Why not interrupt-on-change?
Probably because the original poster wanted to use the interrupt for something else. Sound like he needs to rethink the problem. Peter
Reply by terry November 16, 20042004-11-16
Tauno Voipio <tauno.voipio@iki.fi.NOSPAM.invalid> wrote in message news:<Hgimd.31$y75.0@read3.inet.fi>...
> Leon Heller wrote: > > "Leon Heller" <leon_heller@hotmail.com> wrote in message > > news:41988911$0$15428$cc9e4d1f@news-text.dial.pipex.com... > > > >>"terry" <leonlai2k@yahoo.com> wrote in message > >>news:9904d48.0411150142.1e635596@posting.google.com... > >> > >>>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. > >> > >> > >>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. > > > > > > Sorry, that should read SPI master instead of SPI receive. I actually > > modified it for slave operation, with a PIC SPI master. > > > > Leon > > > 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.
Thanks!
Reply by Lewin A.R.W. Edwards November 16, 20042004-11-16
> 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.
Polling? Why not interrupt-on-change?
Reply by Tauno Voipio November 16, 20042004-11-16
Leon Heller wrote:
> "Leon Heller" <leon_heller@hotmail.com> wrote in message > news:41988911$0$15428$cc9e4d1f@news-text.dial.pipex.com... > >>"terry" <leonlai2k@yahoo.com> wrote in message >>news:9904d48.0411150142.1e635596@posting.google.com... >> >>>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. >> >> >>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. > > > Sorry, that should read SPI master instead of SPI receive. I actually > modified it for slave operation, with a PIC SPI master. > > Leon
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
Reply by Leon Heller November 15, 20042004-11-15
"Leon Heller" <leon_heller@hotmail.com> wrote in message 
news:41988911$0$15428$cc9e4d1f@news-text.dial.pipex.com...
> "terry" <leonlai2k@yahoo.com> wrote in message > news:9904d48.0411150142.1e635596@posting.google.com... >> 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. > > > 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.
Sorry, that should read SPI master instead of SPI receive. I actually modified it for slave operation, with a PIC SPI master. Leon
Reply by Leon Heller November 15, 20042004-11-15
"terry" <leonlai2k@yahoo.com> wrote in message 
news:9904d48.0411150142.1e635596@posting.google.com...
> 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.
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
Reply by terry November 15, 20042004-11-15
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!