Page 1 of 1

Error Reading CAN ID with getRxID

Posted: Sat Sep 03, 2016 2:05 pm
by QMESAR
Hello Team,

I have difficulties with the CAN component on PIC18F2585,
as you will see from the prints I put a led loop with 10mSec delays in the IF loop were I check when a message is received ,when I send a message from my PCAN dongle
the buffer return that it has a message and the led blink for 10 mSec as intended ( the message arrives 50 msec ) when I place the same loop in a case selection with the ID as selector after I use the getRxIDsimple or RxID( both standard and Extended has the same effect) the Led will not blink as it seems the getRxID macro/component does not return or return incorrect ID, :D ( I apologize for this crude debugging method however as FC at the moment has the Debug disabled I can not use my Flowkit V2 to see what happens) ,The RX buffer properties are set at Accept all .
Would it be possible to have a look at this I know the hardware is working as I did a test SW in MPLABX which function correctly
In FC I tested the Tx function and that is working it seems only the RX has a problem

Thank you very much

:D

Re: Error Reading CAN ID with getRxID

Posted: Mon Sep 05, 2016 2:16 pm
by LeighM
Hi QMESAR,

I tend to use GetRxIdent, as that returns the message ID without all the bit shifting associated with the CAN controller registers.
So for a standard ID, that would be a number < 2048
Or is that what you have tried?

Leigh

Re: Error Reading CAN ID with getRxID

Posted: Mon Sep 05, 2016 3:52 pm
by QMESAR
Hi LeighM

I have tried both and not sure they are working correctly in V6 they work as I has used them in V6 however in V7 I cant get them to return me the ID :)
Thanks for the reply

Re: Error Reading CAN ID with getRxID

Posted: Tue Sep 06, 2016 9:01 am
by LeighM
So the same program works in V6, but not V7?
Very odd.
I'll investigate further.

Re: Error Reading CAN ID with getRxID

Posted: Tue Sep 06, 2016 12:47 pm
by QMESAR
LeighM

That would be very kind of you
Thanks a million

Re: Error Reading CAN ID with getRxID

Posted: Fri Sep 09, 2016 9:29 am
by LeighM
just to let you know that I've reviewed the code and cannot see any problem,
but I'm just waiting for some devices to arrive, then I'll investigate further on hardware

Re: Error Reading CAN ID with getRxID

Posted: Fri Sep 09, 2016 2:16 pm
by QMESAR
Hi LeighM

Thank you that is no problem do it as you have time I tried again and not sure what is happening :oops:
It looks to me it is something with the Extended ID format :D

Re: Error Reading CAN ID with getRxID

Posted: Tue Sep 13, 2016 10:51 am
by LeighM
Hi QMESAR
Yes, you are correct about it being connected with Extended ID format.
I've just run some tests between two sets of hardware running Flowcode CAN component, EB006 with PIC18F4585 and a MIAC.
Turns out that there is a bug in the bit shifting in GetRxIdent, so affects some CAN message IDs.
Fixed PIC_CAL_CAN.c file attached.
Thanks!
Leigh

Re: Error Reading CAN ID with getRxID

Posted: Tue Sep 13, 2016 4:05 pm
by QMESAR
LeighM

Thank you very much for your support really appreciate this :D
I am on a business trip will test and try the new file on the weekend when I am back at my Lab