Error Reading CAN ID with getRxID

A forums to allow resolved bugs and problems with Flowcode v7 to be stored and marked as resolved.

Moderator: Benj

Post Reply
User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Error Reading CAN ID with getRxID

Post 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
Attachments
4.JPG
4.JPG (23.52 KiB) Viewed 12434 times
3.JPG
3.JPG (23.48 KiB) Viewed 12434 times
2.JPG
2.JPG (31.43 KiB) Viewed 12434 times
1.JPG
1.JPG (27.76 KiB) Viewed 12434 times

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Error Reading CAN ID with getRxID

Post 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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Error Reading CAN ID with getRxID

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Error Reading CAN ID with getRxID

Post by LeighM »

So the same program works in V6, but not V7?
Very odd.
I'll investigate further.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Error Reading CAN ID with getRxID

Post by QMESAR »

LeighM

That would be very kind of you
Thanks a million

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Error Reading CAN ID with getRxID

Post 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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Error Reading CAN ID with getRxID

Post 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

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times

Re: Error Reading CAN ID with getRxID

Post 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
Attachments
PIC_CAL_CAN.c
(26.03 KiB) Downloaded 383 times

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Error Reading CAN ID with getRxID

Post 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

Post Reply