SPI & CAN interface

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
Rob
Flowcode V4 User
Posts: 10
Joined: Mon Mar 09, 2009 5:24 pm
Contact:

SPI & CAN interface

Post by Rob »

Hi,
Am having trouble with Flowcode V4, using CAN via SPI to MCP2515/MCP2551. I have confirmed the hardware is connected properly by using a known working PIC. This old chip was programmed with Flowcode v2 and I have not got the exact fcf file for it. I have written a new fcf program in V4 using very similar code structure.
I have looked at past postings and can confirm the PIC is sticking at the CAN INIT routine because the CS pin is not being driven. I tried to drive a different pin on another port low before and after each CAN routine however this has not worked either.
I understand in CAN properties you can change the CS & INT pin however this does not seem to have any effect.
I am using PIC16F88 IC’s, I am programming from HEX to MATLAB v8.50 to a PICSTART PLUS.

So my conclusion is that the CAN macros have changed between and early flowcodeV2 compared to FlowcodeV4.
Any and all help would be much appreciated

Regards
Rob

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: SPI & CAN interface

Post by Sean »

I can confirm that the CAN component has changed since Flowcode V2, but we are not aware of any problems driving the CS pin.

Which build of Flowcode V4 are you using?

Can you post a copy of the .fcf and .c files generated by a non-working program?

Rob
Flowcode V4 User
Posts: 10
Joined: Mon Mar 09, 2009 5:24 pm
Contact:

Re: SPI & CAN interface

Post by Rob »

Thank you for your prompt reply, I am using

Flowcode
Professional Version
Flowcode v4.5.18.74

I look forward to your reply,
Many thanks

Rob

Sean
Valued Contributor
Valued Contributor
Posts: 548
Joined: Tue Jun 26, 2007 11:23 am
Has thanked: 6 times
Been thanked: 44 times
Contact:

Re: SPI & CAN interface

Post by Sean »

Hello,

We have recreated a slightly modified version of your program in Flowcode V4 and run it successfully. The program is attached.

Removed

The modified FCD file you were using is not available in V4, so a standard 16F88 target was used and configured appropriately.

To match our test hardware:
The data rate and other CAN settings were returned to their default values.
The CS and INT pin selections were set to match the normal EB018 connections.

You should be able to change these settings to match your hardware without causing any problems.

Rob
Flowcode V4 User
Posts: 10
Joined: Mon Mar 09, 2009 5:24 pm
Contact:

Re: SPI & CAN interface

Post by Rob »

Hello,
And many thanks , :D The CAN is now working correctly, while I do not understand the Mod you made to the program, I don't care, It works and it will stay in.
I just want to say thanks again for such a quick reply,
regards

Rob

Post Reply