Hi Team.
Please help me understand the MCP2515 CAN Components from the help file in my understanding is that once you know that you have a message in a buffer you have to read the Received Data bytes one by one out with a GetRxData Call is this correct ,It seems I have to do 8 Read to get the 8 data CAN bytes. I do not see any component call that read the complete buffer at once.
Another Confusion is that there is 2 RX Buffers and on a High Bus load we should check both buffers if any valid Message has been received this I do in a loop checking for the buffers if it has a message then read out the ID and then select which message it was with a case structure however now the GetRxData component ignores the Buffer ,So how does this component now know that buffer 1 has data and I read the ID from Buffer 1 and I want to read the data bytes from buffer 1
Please can you help me understand this as my mcu runs on a Bus with a few CAN messages
Thank a million as always
CAN SPI Help/Confusion
Moderator: Benj
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: CAN SPI Help/Confusion
Yesonce you know that you have a message in a buffer you have to read the Received Data bytes one by one out with a GetRxData Call is this correct
The component copies the data bytes into device storage when CheckRx is called.So how does this component now know that buffer 1 has data and I read the ID from Buffer 1 and I want to read the data bytes from buffer 1
So it is best to call GetRxData, to read this data, immediately after CheckRx returns true
Even though GetRxData ignores the Buffer number, it is best to pass this to all macros,
such as GetRxIdent, as there are some differences between use with external or internal CAN
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: CAN SPI Help/Confusion
Leigh.
Thank you very much ,understood
Thank you very much ,understood
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR