Hi,
I need some help with the following scenario using the BLE Bridge:
SETUP «
I am running a simple UART test, where a single byte is transmitted from a cc2541 Keyfob to a cc2540 USB using the following configuration:
(1) Windows 7 PC: USB-to-RS232 adapter Tx pin
RealTerm program,
BTool program,
IAR Embedded Workbench [8051 core]
(2) cc2541 Keyfob: TEST port pin-6 [P1_7] @9600 BAUD,8,n,1, and
RF @115200 BAUD,8,n,1
(3) cc2540 USB: RF @115200 BAUD,8,n,1
Where (1) physically connects to (2) by means of the USB-to-RS232 adapter, (2) connects to (3) over-the-air and (1) runs the RealTerm, BTool and IAR EW [8051 core] programs simultaneously.
»
TEST «
1) A single hex byte [0x01] is transmitted from (1) to (2) using the RealTerm program.
2) The hex byte received at (2) is [0x01] (as probed with an oscilloscope).
3) The hex byte received over-the-air at (3) is 0x7F.
=[Windows 7 PC]===================
Transmitter: RealTerm: Serial Capture Program 2.0.0.70
Port Settings: 9600 BAUD, 8, n, 1
Data Sent: [0x01]
=[Keyfob Development Board]========
Receiver: cc2541 Keyfob
Port Settings: 9600 BAUD, 8, n, 1
Registers: from function "HalUARTOpenDMA(halUARTCfg_t *config)"
...
UxBAUD = 59;
UxGCR = 8;
UxUCR = UCR_STOP; // 8 bits/char; no parity; 1 stop bit; stop bit hi.
...
Data Received: [0x01]
Transmitter: cc2541 Keyfob
Port Settings: 115200 BAUD, 8, n, 1
Data Sent: [ ? ]
=[USB Development Board]==========
Receiver: cc2540 USB and BTool - Bluetooth Low Energy PC Application - v1.41.05
Port Settings: 115200 BAUD, 8, n, 1
Data Received: [0x7F]
»
OBSERVATION «
1) The data appears to be inverted and shifted-in in reverse order.
0x01 --> 0000 0001 (original data)
0000 0001 --> 1111 1110 (1's complement inversion)
1111 1110 --> 0111 1111 (LSB to MSB conversion)
0111 1111 --> 0x7F (data received)
»
QUESTIONS «
1) Where and in which piece of the code is this conversion happening?
2) Is there an Application Note that addresses this conversion and what to do to convert the data back, to make the data received the same as the data sent?
3) Does this conversion happen with the SPI as well?
»
Please advise. Thanks.