Im really stuck and out of tricks to try and can not spend another full week trying to fix it.
I understand all 8051 MCUs are somewhat different when it comes to extended capabilities (e.g. SPI) . Whether youre a pro at AVR, PIC, SiLABS, etc take a look at the following flow and based on your experience tell me what I may be missing to get an output for a SPI port. While it may not apply to my device at least Ill know to look to see if it does or doesnt.
1.) Set clock to crystal, divider to crystal/1 and tick speed to drive timers at crystal/8
2.) Set Port to drive /SlaveSelect to GPIO, Pull-up, and output
3.) Set Port for MOSI & SCLK to output and peripheral
4.) Set Port for MISO to input and peripheral
5.) Set baud rate to 19,200 (there is a M and E register)
6.) Set USART to SPI mode, CPOL=0, CPHA=1, MSB first
7.)
8.) Flush buffer, clear TX and RX flags
9.) /SlaveSelect set low to enable slave
10.) Write to SPI buffer
11.) Wait for TX empty flag
12.) Set SlaveSelect to disable slave
What Im not doing: setting what I think are pure UART settings (STOP, START, Parity, number of bits (8 | 9). I do not use timers or interrupts except the TX and RX flags.
I have a good C debugger and can watch the assembly code and registers change as I single step. I m watching the ports on a logic analyzer and have a Tek Oscope. I can confirm the reg values I set in code are in fact correctly stored in registers.
I simply can not get a serial data flow. SCLK goes low when the port is set to peripheral and stays there. More details are in earlier post titled Ti Chipcon CC1110/CC2510 SPI problem
I understand all 8051 MCUs are somewhat different when it comes to extended capabilities (e.g. SPI) . Whether youre a pro at AVR, PIC, SiLABS, etc take a look at the following flow and based on your experience tell me what I may be missing to get an output for a SPI port. While it may not apply to my device at least Ill know to look to see if it does or doesnt.
1.) Set clock to crystal, divider to crystal/1 and tick speed to drive timers at crystal/8
2.) Set Port to drive /SlaveSelect to GPIO, Pull-up, and output
3.) Set Port for MOSI & SCLK to output and peripheral
4.) Set Port for MISO to input and peripheral
5.) Set baud rate to 19,200 (there is a M and E register)
6.) Set USART to SPI mode, CPOL=0, CPHA=1, MSB first
7.)
8.) Flush buffer, clear TX and RX flags
9.) /SlaveSelect set low to enable slave
10.) Write to SPI buffer
11.) Wait for TX empty flag
12.) Set SlaveSelect to disable slave
What Im not doing: setting what I think are pure UART settings (STOP, START, Parity, number of bits (8 | 9). I do not use timers or interrupts except the TX and RX flags.
I have a good C debugger and can watch the assembly code and registers change as I single step. I m watching the ports on a logic analyzer and have a Tek Oscope. I can confirm the reg values I set in code are in fact correctly stored in registers.
I simply can not get a serial data flow. SCLK goes low when the port is set to peripheral and stays there. More details are in earlier post titled Ti Chipcon CC1110/CC2510 SPI problem