Page 1 of 1

Can bus problem with 18F2580

Posted: Fri Jun 12, 2009 10:10 am
by GeorgesVDR
Dear flowcoders,

I have developed a circuit that works as a can bus node. Its a copy of a friend of mind and the program I have from works but not
like I want it to. So I bought flowcode and started designing. In the simulation everything works but when I download it to the PIC.
It gets stuck on Can Init. The problem is that flowcode still thinks i'm using the E-board via the MCP2515 and MCP2551. But that isnt
the case i'm only using the MCP2551 because the 18F2580 has a build in can-controller. If i go into the C-file i can also see the program
for the spi connection but as I said, I don't use the MCP2515 so I don't use SPI. Can this be fixed or I there a change that I can get it
right!!

Thanks!!

Georges

(Files in attachement)

Re: Can bus problem with 18F2580

Posted: Fri Jun 12, 2009 1:15 pm
by Benj
Hello

Unfortunatley Flowcode does not currently support devices with an internal CAN controller. This may be resolved in the near future.

Re: Can bus problem with 18F2580

Posted: Mon Jun 15, 2009 5:51 am
by GeorgesVDR
Thanks for the reply!!

But is it possible to make the programm in flowcode and copy paste the main source code to
an other code with the right configuration? So its compatible with my circuit??

Thanks

Re: Can bus problem with 18F2580

Posted: Mon Jun 15, 2009 8:57 am
by Benj
Hello

It should be possible to modify the functions in the CAN component C file using the Code customization in Flowcode v4 or by editing the component C code file by hand in Flowcode V3. Modifying these functions to use the internal rather then the external CAN controller should be possible. Most of the device registers should match up with the ones currently being accessed via the SPI bus.

Re: Can bus problem with 18F2580

Posted: Fri Aug 13, 2010 2:40 am
by MW
Hello,

I have a different problem along these lines.

I have written a small program for the 18F2580 using the Can2 component.

Whenever I try to compile it however I get the following errors:

Illegal redefinition of symbol: RXM0EID8_VAL
Illegal redefinition of symbol: RXM0EID0_VAL
Illegal redefinition of symbol: RXM1EID8_VAL
Illegal redefinition of symbol: RXM1EID0_VAL
Illegal redefinition of symbol: CANSTAT
Illegal redefinition of symbol: TXREQ
Illegal redefinition of symbol: ABAT
Illegal redefinition of symbol: ERRIE
Illegal redefinition of symbol: WAKIE
Illegal redefinition of symbol: ERRIF
Illegal redefinition of symbol: WAKIF
Illegal redefinition of symbol: SAM
Illegal redefinition of symbol: WAKFIL

When I change the config to another chip it compile fines, but I am quite keen to use the 18F2580 as this is what is fitted to my development board.

Any ideas?

Thanks
MW

Re: Can bus problem with 18F2580

Posted: Mon Aug 16, 2010 3:16 am
by MW
Apologies. I should of posted this in the Flowcode V4 forum. Also I should explain I am trying to use the 18F2580 with an MCP2510 not with the internal can module.

Thanks
MW

Re: Can bus problem with 18F2580

Posted: Mon Aug 16, 2010 12:17 pm
by Benj
Hello,

I know the cause of your problem and it is related to the Flowcode CAN defines colliding with the defines for the CAN registers on the 18F2580 device.

What version of Flowcode are you running. Updating to the latest version (4.3) may fix this problem.

Re: Can bus problem with 18F2580

Posted: Tue Aug 17, 2010 12:08 am
by MW
Hi,

I am running 4.3.7.63. No joy.

Thanks

Re: Can bus problem with 18F2580

Posted: Tue Aug 17, 2010 8:48 am
by Benj
Hello,

Right I have done a search and replace on the CAN2 component to rename the defines and this has removed all of the compile errors when using the 18F2580 device.

Simply replace the file in your "Flowcode v4\Components" directory and then start Flowcode and the program should then compile correctly.

Re: Can bus problem with 18F2580

Posted: Wed Aug 18, 2010 5:00 am
by MW
Ben this worked a treat. I am now up and running.

Thanks very much
MW