Hi all,
I am trying to program a simple SPI application using Atmel's ATTiny2313. I lifted the code straight out of their guide:
SPITransfer_Fast: out USIDR,r16 ldi r16,(1
Hi all,
I am trying to program a simple SPI application using Atmel's ATTiny2313. I lifted the code straight out of their guide:
SPITransfer_Fast: out USIDR,r16 ldi r16,(1
I'm using a atmega8 but I think it works the same. This is my code,
SPI_Send:
out SPDR,r16 Wait: sbis SPSR,SPIF ; Wait for transmission to complete rjmp Wait
ret
I'm using avr studio for simulation.
SFC
"Bugmaster" schreef in bericht news: snipped-for-privacy@l41g2000cwc.googlegroups.com...
No, the USI and the SPI are two different peripherals. The USI can be used to emulate an SPI.
So you have to bit bang it then?
SFC
"Ulf Samuelss>> I'm using a atmega8 but I think it works the same. This is my code,
The USI is an 8 bit shift register where the clock can be be software controlled You write an 8 bit value to the shift register and then you write 8 times to an I/O location to clock it out. You can also use timers to clock the USI.
Bit banging involves several I/O writes per bit.
The AVR studio 4.11 build 401 help file clearly tells in the known issues USI is not yet supported.
Jeroen
Have something to add? Share your thoughts — no account required.
Ask the community — no account required