I'm trying to use the CC2541 UART to do simple polling communication.
Transmit is doing fine. I can see (on a logic analyzer) the data exit as expected (9600 baud, 8 data bits, no parity, 1 stop bit).
I can also see (on a logic analyzer) the response coming back, but I never see the U1CSR.RXBYTE bit go active.
I have set the appropriate "peripheral use bits":
P0SEL= PORT_USE_PERIF_BIT5 | PORT_USE_PERIF_BIT4;
I have set the appropriate "direction bits":
P0DIR= PORT_DIR_OUT_BIT4;
I have set the receive enable:
U1CSR = U1CSR | U1_READ_ENABLE;
where U1_READ_ENABLE is 0x40
I periodically check the UART (about once per millisecond) by:
#define HAL_UART1_BYTE_AVAILABLE(st) \
{ \
if((U1CSR & U1_RXBYTE) == U1_RXBYTE) { \
st = 1; \
} else { \
st = 0; \
} \
}
The compiler is smart enough to just check U1CSR.RXBYTE...
But I never see a byte received...
What did I forget to do?
Thanks!!
