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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 976
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 307 times
Been thanked: 489 times
Contact:

Error Reading CAN ID with getRxID

Postby QMESAR » Sat Sep 03, 2016 2:05 pm

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 3703 times
3.JPG
3.JPG (23.49 KiB) Viewed 3703 times
2.JPG
2.JPG (31.44 KiB) Viewed 3703 times
1.JPG
1.JPG (27.77 KiB) Viewed 3703 times

User avatar
LeighM
Matrix Staff
Posts: 1539
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 384 times
Been thanked: 541 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby LeighM » Mon Sep 05, 2016 2:16 pm

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: 976
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 307 times
Been thanked: 489 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby QMESAR » Mon Sep 05, 2016 3:52 pm

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: 1539
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 384 times
Been thanked: 541 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby LeighM » Tue Sep 06, 2016 9:01 am

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

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 976
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 307 times
Been thanked: 489 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby QMESAR » Tue Sep 06, 2016 12:47 pm

LeighM

That would be very kind of you
Thanks a million

User avatar
LeighM
Matrix Staff
Posts: 1539
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 384 times
Been thanked: 541 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby LeighM » Fri Sep 09, 2016 9:29 am

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: 976
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 307 times
Been thanked: 489 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby QMESAR » Fri Sep 09, 2016 2:16 pm

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
These users thanked the author QMESAR for the post:
medelec35 (Tue Sep 13, 2016 11:55 am)
Rating: 5.88%
 

User avatar
LeighM
Matrix Staff
Posts: 1539
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 384 times
Been thanked: 541 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby LeighM » Tue Sep 13, 2016 10:51 am

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.95 KiB) Downloaded 89 times
These users thanked the author LeighM for the post (total 2):
medelec35 (Tue Sep 13, 2016 11:55 am) • QMESAR (Tue Sep 13, 2016 4:04 pm)
Rating: 11.76%
 

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 976
Joined: Sun Oct 05, 2014 3:20 pm
Has thanked: 307 times
Been thanked: 489 times
Contact:

Re: Error Reading CAN ID with getRxID

Postby QMESAR » Tue Sep 13, 2016 4:05 pm

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