I am using CPOL = 0 , CPHA = 0 and a clock of 330 kHz. The CS line is held logic low the whole time without any toggling.
I am using 0 as mode byte ( Byte nr = 6)
I get the Preamble ACK and Length ACK (0x2) at Byte nr. 3 and 6 as expected. But I get a value 0x7F at Byte nr. 8 .
Basically, when I send
spi_TX_buf[10] = {0x70, 0x50, 0, (BLE_CODE_SIZE >> 2) & 0xFF, (BLE_CODE_SIZE >> 10) & 0xFF, BLE_CODE_CRC, 0, 0, 0, 0 }; //Make the first two byte of code as 0 for debug
I get back
spi_RX_buf[] =
[0] (0x00)
[1] (0xDC)
[2] (0xD4)
[3] (0x02)
[4] (0xE5)
[5] (0xC4)
[6] (0x02)
[7] (0xC0)
[8] (0x7F) //This should have been 0x02 or 0x20
[9] (0xFF)
what could be wrong?
Regards,
Ashwin