Sending multi-bytes sequence throgh SPI (AVR-Bascom)
2005-08-23 by behrooz_hariri
Hi. In spi between two AVR, the data sequence which is important to realize what byte is for temperature for example, and what was indicating humidity, becomes corrupted when I reset the slave. How can I distinguish in slave (receiver) which byte was sent first and wich was the next? in master: A(1) = "a" A(2) = "b" A(3) = "c" Do ... Spiout A(1) , 3 Loop -------- in slave: Do Spiin A(1) , 3 print A(1) ; A(2) ; A(3) Loop I deliberately resset the slave and want to receive the same sequence but I receive: a , c, b c, a, b or ther sequences. I need to receive 'a' as A(1), 'b' as A(2) and 'c' as A(3). What is the solution? Tnx in advance for your help. Behrooz Hariri