??? 06/14/05 20:29 Read: times |
#94959 - 8052-to-8052 SPI Communication Responding to: ???'s previous message |
Sorry...I'm using two AT89S8252 microcontrollers from Atmel.
http://www.atmel.com/dyn/resou...oc0401.pdf (pages 9-10, 18-19 are pertinent to SPI) As far as the code goes, I'll be happy to include as much as anyone thinks would be helpful; however, I think this is almost certainly some sort of hardware problem with the 8051 since the problem occurs *during* the byte-transmission. Is there a way that I can post a screen-shot of my logic analyzer on this message board? Here's my initialization for the slave: mov spcr,#01001001b Here's my initialization for the master: mov spcr,#01011001b Here's how I output from the slave: mov dptr,#start_wireless_audio ; point to message call spi_msg_out --- spi_msg_out: clr a ; reset counter to 0 movc a,@a+dptr ; read byte from code jz spi_msg_out_done ; check for eom call spi_io ; send byte out inc dptr ; point to next byte jmp spi_msg_out ; loop back spi_msg_out_done: ret --- --- spi_io: macro_debug_out spi_io_out_msg call debug_hex_out mov spdr,a ; send the byte spi_io_loop: mov a,spsr ; read the spi status register anl a,#SPIF_MASK ; check the spif bit jz spi_io_loop ; wait for tx/rx to complete mov a,spdr ; read in the received byte call debug_hex_out macro_debug_out spi_io_in_msg spi_io_done: ret --- |
Topic | Author | Date |
8052-to-8052 SPI Communication | 01/01/70 00:00 | |
glad that you do | 01/01/70 00:00 | |
8052-to-8052 SPI Communication | 01/01/70 00:00 | |
an obvious guess | 01/01/70 00:00 | |
an obvious guess | 01/01/70 00:00 | |
a question | 01/01/70 00:00 | |
a question | 01/01/70 00:00 | |
as the first byte from the slave | 01/01/70 00:00 | |
more questions | 01/01/70 00:00 | |
re:SPI![]() | 01/01/70 00:00 |