Hej,
Mam problem z obsługą SPI w Bascom AVR.
Próbowałem wykorzystać kod z tego tematu: https://www.elektroda.pl/rtvforum/topic278055.html
ale się nie kompiluje.
błąd:
Wiecie może o co biega?
Mam problem z obsługą SPI w Bascom AVR.
Próbowałem wykorzystać kod z tego tematu: https://www.elektroda.pl/rtvforum/topic278055.html
ale się nie kompiluje.
Declare Sub Write_spi(_bajt As Byte)
Config Spi = Hard , Master = Yes , Noss = 0 , Clockrate = 16 , Interrupt = Off , Data Order = Msb , Phase = 1
Cs Alias Portb.2
Spiinit
Sub Write_spi(_bajt As Byte)
Cs = 0
Spdr = _bajt
Gosub _spi_wait
Cs = 1
End Sub
_spi_wait:
sbis SPSR,SPIF
rjmp _spi_Wait
Return
błąd:
Error : 46 Line : 9 Assignment error [SPDR: 0 _BAJT: 2] Wiecie może o co biega?