using CAN 2.0

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
ruben
Flowcode V4 User
Posts: 4
Joined: Fri Apr 01, 2011 2:10 pm
Has thanked: 3 times
Contact:

using CAN 2.0

Post by ruben »

Good day,


I'am using the flowcode V4 and CAN 2.0. I'm using it beceause if have to send extended CAN message's.
Now the probleme is my help file only gif information about CAN en some of the macro's i want to use aren't explaind in this help file.
Is there sombody wou knews where i can find more information about this component CAN 2.0 ? for exampale SetTxExtID macro isn't explained.

then i also want to change the settings on RXbuffer 0
to simple settings -extended
in combination with the macro GetRxDAta
when i did that i get the following error
Illegal redefinition of symbol: RXM1EID8_VAL
is this some kind of a bug in flowcode ?

Thank you in advance!
Last edited by ruben on Tue Apr 12, 2011 9:49 am, edited 1 time in total.

User avatar
DavidA
Matrix Staff
Posts: 1076
Joined: Fri Apr 23, 2010 2:18 pm
Location: Matrix Multimedia Ltd
Has thanked: 58 times
Been thanked: 258 times
Contact:

Re: using CAN 2.0

Post by DavidA »

If you need access to the Flowcode v4 forums, the walkthrough is here:

http://www.matrixmultimedia.com/support ... f=29&t=602

I can move this into the relevant section when your account is upgraded just post here or PM me.

Regards

David

ruben
Flowcode V4 User
Posts: 4
Joined: Fri Apr 01, 2011 2:10 pm
Has thanked: 3 times
Contact:

Re: using CAN 2.0

Post by ruben »

thx for the help!
i did the walktrough
i hope it's oké now i'm sry that i didn't set it in the right section
do i have to remove this post ?

greetings

Ruben

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: using CAN 2.0

Post by Benj »

Hello Ruben,

Please could you tell me which target device you are using and also attach the program to the forums that is causing the error and I will have a look for you.

David has moved your topic to the right place so no need to re-post.
SetTxExtID(buffer, hi, lo, ext2, ext1, ext0)
Sets the Message ID and Extended ID value.

SetTxExtIDAsFull(buffer, id3, id2, id1, id0)
Sets the Message ID and Extended ID value by combining the values into a 4 byte array.

SetRxFiltrExtIDAsFull(filter, id3, id2, id1, id0)
Configures a receive fiilter for use with Extended ID values by combining the ID and Extended ID values into a 4 byte array.

SetRxMaskExtIDAsFull(filter, id3, id2, id1, id0)
Configures a receive mask for use with Extended ID values by combining the ID and Extended ID values into a 4 byte array.
For the SetTxExtID macro the ID values can be as follows.

std1 = 00000xxx
std0 = xxxxxxxx

ext2 = 000000xx
ext1 = xxxxxxxx
ext0 = xxxxxxxx

ruben
Flowcode V4 User
Posts: 4
Joined: Fri Apr 01, 2011 2:10 pm
Has thanked: 3 times
Contact:

Re: using CAN 2.0

Post by ruben »

hey benj

The target device is a 16F877A pic micro.
I'm using the E-blocks CAN Solution pack EB744.
I also have the kvaser leaf to log the network traffic.

Maybe i caused the error because i'm sending standard id's and extended id's and want to recive standard id's ? or is this not a problem ?
i'm doing this because i have devices that have to recive extended id's

then i quistion about the conversion of the fullId (extende ID) tot hiID, LOid, ext2,ext1,Ext0.
i get it that extende id(29bits) is split in a standard id en extended id and
then the standard(11bits) Id is split in hiID(8bit) en loID(3bit) (i have the right the calculation with me).
but how is the extended Id converted to ext2,ext1,ext0?

thank you for your help !!
i'm sry for the bad writing
Attachments
simulatie_dashboard.fcf
the declaration is in dutch if it is a problem let know than i wil translate it.
(12.5 KiB) Downloaded 263 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: using CAN 2.0

Post by Benj »

Hello Ruben,

The data fits inside the ID as shown in my previous post where x is the ID data and 0 is unused data. Note that the standard ID is right justified now where as with the standard CAN component the ID is left justified.

Here are the bytes again and their data.

11-bit Standard ID
std1 = 00000xxx
std0 = xxxxxxxx

18-bit Extended ID
ext2 = 000000xx
ext1 = xxxxxxxx
ext0 = xxxxxxxx

I have found the parts in the component that were causing compilation issues and these have now been resolved.

You can load in the new version of the component by copying the attached C file into your Flowcode v4\Components directory before starting Flowcode.
PIC_CAN2.c
(43.2 KiB) Downloaded 299 times
Let me know how you get on.

ruben
Flowcode V4 User
Posts: 4
Joined: Fri Apr 01, 2011 2:10 pm
Has thanked: 3 times
Contact:

Re: using CAN 2.0

Post by ruben »

hey benj

everything works now i couldn't compile it to the chip yet because we have holiday now and school has closed and the E-blocks are at school.
when I'm back at school i let you know if everything works on the E-blocks.

thank you very much for everything

greetings Ruben

Post Reply