Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4 Forum Discussions

MaMa_4085956
Level 1
Level 1

Can anyone plz share the example code for SPI with CRC for 4200series?

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi MaMa_4085956​,

We do not have a readily available code example to showcase SPI with CRC. You can develop the CRC generation code in the application layer. For example, you receive 4 bytes in the receive buffer (3 bytes + 1 byte CRC), then you can receive the 4 bytes in a buffer, calculate the CRC for the first three bytes and compare the results with the 4th byte.

Let us know if you find any difficulty in the implementation, we are happy to help!

You can also evaluate the CRC component (UDB based) that calculates the CRC for a serial in data.

https://www.cypress.com/file/398801/download

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
1 Reply
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi MaMa_4085956​,

We do not have a readily available code example to showcase SPI with CRC. You can develop the CRC generation code in the application layer. For example, you receive 4 bytes in the receive buffer (3 bytes + 1 byte CRC), then you can receive the 4 bytes in a buffer, calculate the CRC for the first three bytes and compare the results with the 4th byte.

Let us know if you find any difficulty in the implementation, we are happy to help!

You can also evaluate the CRC component (UDB based) that calculates the CRC for a serial in data.

https://www.cypress.com/file/398801/download

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes