CAN Component - Buffer

For general Flowcode discussion that does not belong in the other sections.
jay_dee
Posts: 130
http://meble-kuchenne.info.pl
Joined: Sun Dec 20, 2020 6:06 pm
Has thanked: 46 times
Been thanked: 29 times

Re: CAN Component - Buffer

Post by jay_dee »

Hi,
I've played with lots of different combinations. The command from the RXcheck routine that make the difference is..

Code: Select all

RXB0CONbits.RXFUL = 0;  // Clear Buffer0 Full Flag
What is really odd to me. If I place this or similar at the end of the Interrupt handler it makes no difference.
If I place it as stand alone C code at the end of the actual Interrupt routine it works fine.

I also added something in the handler to disable the Interrupt before running the interrupt macro.
It may also by my crap syntax but I could not get 'Buffer0 Interrupt Flag TRUE' AND 'Buffer0 Full TRUE' to be checked by the IF statement.

This however does run.

Code: Select all

if  ((PIR3>>0) & 1)         //Check for Buffer0 Interrupt Flag
{
PIE3bits.RXB0IE = 0;    //Disable CAN Buffer 0 Interrupts
FCM_%n();                   // call selected macro
}
Put as last line in Interrupt macro

Code: Select all

PIR3bits.RXB0IF = 0; //PIR3 & ~(1);     // Clear Buffer0 Interrupt Flag
RXB0CONbits.RXFUL = 0;  // Clear Buffer0 Full Flag
PIE3bits.RXB0IE = 1;   //Enalbe CAN Buffer 0 Interrupts
CAN_Interrupt_Rx_Tests_V1-2.fcfx
(52.54 KiB) Downloaded 44 times
J.

Post Reply