Hello.
I'm new with the UCC5870 and at the moment I try to implement the SPI communication. Now I stuck at the CRC check.
1. I could no read the TX CRC data from the CRCDATA register. The values change every time. What is wrong at my implementation.
I write to the TX CRC register and then read it, but the read value change every time.
2. I have implemented the example of the datasheet
tx_data.all = 0xFC00; crc_calc_data.all = SWAP_UI16(tx_data.all); crc = crc8_update( crc, &crc_calc_data.all, 2 ); msg.ptr_tx_data = tx_data.byte; msg.tx_data_size = 2; hal_spi_master_transfer_blocking( &mgl_spi_handle[select], &msg, 100 ); tx_data.all = 0xFA58; crc_calc_data.all = SWAP_UI16(tx_data.all); crc = crc8_update( crc, &crc_calc_data.all, 2 ); msg.ptr_tx_data = tx_data.byte; msg.tx_data_size = 2; hal_spi_master_transfer_blocking( &mgl_spi_handle[select], &msg, 100 ); tx_data.all = 0xFB2A; crc_calc_data.all = SWAP_UI16(tx_data.all); crc = crc8_update( crc, &crc_calc_data.all, 2 ); msg.ptr_tx_data = tx_data.byte; msg.tx_data_size = 2; hal_spi_master_transfer_blocking( &mgl_spi_handle[select], &msg, 100 ); tx_data.all = 0xFC13; crc_calc_data.all = SWAP_UI16(tx_data.all); crc = crc8_update( crc, &crc_calc_data.all, 2 ); msg.ptr_tx_data = tx_data.byte; msg.tx_data_size = 2; hal_spi_master_transfer_blocking( &mgl_spi_handle[select], &msg, 100 ); // check CRC tx_data.all = 0xFA00; crc_calc_data.all = SWAP_UI16(tx_data.all); crc = crc8_update( crc, &crc_calc_data.all, 1 ); tx_data.byte[0] = crc; msg.ptr_tx_data = tx_data.byte; msg.tx_data_size = 2; hal_spi_master_transfer_blocking( &mgl_spi_handle[select], &msg, 100 );
but if I write a wrong CRC value to CRCDATA I don't get the fault status
3. If I write to SPITEST I don't get the fault status.
Do you have any code example for the CRC usage?
Thanks for your help.
Tobias