CAN Rx buffer initalize in PSOC5lp

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

cross mob
Anonymous
Not applicable

How can i initialize CAN Rx Buffer in psoc5lp. I want to initialize so that i can avoid reading garbage value. I am not using CAN interrupt to copy the buffer content  rather i am polling each acceptance filter .

   

Thanks

0 Likes
1 Reply
harshadap_76
Employee
Employee
First like received

Hi,

   

You can update the Rx buffer using the macro : CAN_RX_DATA_BYTEx(i), where x is byte number and 'i' is mailbox number.

   

For eg. If you want to initialize 1st byte of mailbox '0' you can write following:

   

CAN_RX_DATA_BYTE1(0) = 0x AA; // initiatized with 0xAA.

   

The same macro is used to access the received data.

   

Make sure that your code doesn't assign value to the macro after the reception of the data.

   

Hope this helps.

   

Please feel free to update for any clarification.

   

Thanks and Regards

   

Harshada

0 Likes