Hi, In the comments for the CAN component, it states that the Buffer parameter is currently ignored.
Is the PIC's CAN registers set to only use buffer 0? therefroe no data can get into any other buffer.
or does the component automatically check both buffers?
Thanks. Just trying to improve my CAN routines as I think I am missing some message IDs when they are put on the bus in very quick succession.
J.
CAN Component - Buffer
-
- Posts: 198
- http://meble-kuchenne.info.pl
- Joined: Sun Dec 20, 2020 6:06 pm
- Has thanked: 76 times
- Been thanked: 54 times
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: CAN Component - Buffer
Hello,
The buffer parameter is ignored for GetRxData and GetRxDataCount macros. Both of these use the buffer from the last positive CheckRx macro call.
Are you using internal or external CAN? If it's external you could maybe try running the SPI at a faster rate or calling CheckRx more often.
If it's internal then what device are you using? Maybe we can look at adding an interrupt to let you know when a message has been received so you can collect it as it comes in.
The buffer parameter is ignored for GetRxData and GetRxDataCount macros. Both of these use the buffer from the last positive CheckRx macro call.
Are you using internal or external CAN? If it's external you could maybe try running the SPI at a faster rate or calling CheckRx more often.
If it's internal then what device are you using? Maybe we can look at adding an interrupt to let you know when a message has been received so you can collect it as it comes in.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: CAN Component - Buffer
Hello,
I beleive it's in legacy mode though I may be wrong, what device are you using and are you using internal or external and I'll do a more comprehensive check.
I beleive it's in legacy mode though I may be wrong, what device are you using and are you using internal or external and I'll do a more comprehensive check.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: CAN Component - Buffer
Yes confirmed it looks like we use legacy mode on the 8-bit PIC devices.
It also looks like there are receive interrupts for buffers 0 and 1 on that device if you wanted to try and use an interrupt to catch the incoming data as it comes in. I can add the interrupt definitions to the Flowcode definition file if that would help.
It also looks like there are receive interrupts for buffers 0 and 1 on that device if you wanted to try and use an interrupt to catch the incoming data as it comes in. I can add the interrupt definitions to the Flowcode definition file if that would help.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: CAN Component - Buffer
Great info Ben.
The CAN int's, That would be very much appreciated, if you get time. I've read the Datasheet and have a rough handle on the GIE, PEIE, PIR3 and PIE3 registers but Im sure you will get it right far quicker than I !!
J.
The CAN int's, That would be very much appreciated, if you get time. I've read the Datasheet and have a rough handle on the GIE, PEIE, PIR3 and PIE3 registers but Im sure you will get it right far quicker than I !!

-
- Matrix Staff
- Posts: 1926
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 503 times
- Been thanked: 686 times
Re: CAN Component - Buffer
Hello,
Here's a new version of the definition file that should allow two new interrupts for CAN RX. If this works ok then I'll roll this out to the rest of the chip family.
You'll need to place the file here, the easiest way to get there is to copy and paste the address into the address bar of your file explorer.
C:\ProgramData\MatrixTSL\FlowcodeV9\FCD\PIC
Then restart Flowcode and the new interrupts should be available to be selected.
Here's a new version of the definition file that should allow two new interrupts for CAN RX. If this works ok then I'll roll this out to the rest of the chip family.
You'll need to place the file here, the easiest way to get there is to copy and paste the address into the address bar of your file explorer.
C:\ProgramData\MatrixTSL\FlowcodeV9\FCD\PIC
Then restart Flowcode and the new interrupts should be available to be selected.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Re: CAN Component - Buffer
Thanks Ben, I'll try to get some time on this ASAP..but real work with the Race team kicks in next week and I have to poke their ECUs for LeMans, but the aim is to work on this stuff in the background. Thanks. J.
Re: CAN Component - Buffer
Hi,
This is my test FC for the CAN RX Inturrupts.
In the main loop I have a (GREEN) secion to manually check for new data in Buffer 0. I used this to check that everything else is working in the FC and output.
An external CAN tool is transmitting a couple of data frames onto the bus. The CAN component settings are 'Accept all'.
Most of the other macros in the FC are just formatting a UART diagnosic output for a VT100 Emulator, for monitoring purposes. If I run the FC with the GREEN highlighted code it all works as expected. If this code is disabled and set 'CAN RX BUF0' interrupt enabled, I get no responce.
Any thoughts appreciated. J.
This is my test FC for the CAN RX Inturrupts.
In the main loop I have a (GREEN) secion to manually check for new data in Buffer 0. I used this to check that everything else is working in the FC and output.
An external CAN tool is transmitting a couple of data frames onto the bus. The CAN component settings are 'Accept all'.
Most of the other macros in the FC are just formatting a UART diagnosic output for a VT100 Emulator, for monitoring purposes. If I run the FC with the GREEN highlighted code it all works as expected. If this code is disabled and set 'CAN RX BUF0' interrupt enabled, I get no responce.
Any thoughts appreciated. J.