CAN problem in FC5

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

CAN problem in FC5

Post by Walbeek »

Hi there,

I have a EB006 programmer with a CAN bus (EB018) connected to port A and a LCD (EB005) connected to port B.
The programmer has a PIC16F877A controller inserted.
I have made a program to check the CAN bus on any messages.
Programming to the PIC does work (no errors) but the program doesn´t start.
The program is included, what have I done wrong?
When I program it with code 0002 (Hello world) the display reacts.
Please let me know what to check.

Rinie
Attachments
can receiver test 0002.fcf
Test file
(6.5 KiB) Downloaded 280 times
can receiver test 0001.fcf
Original file
(16.5 KiB) Downloaded 269 times
Greetings, Rinie
Flowcode V7 user

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

Re: CAN problem in FC5

Post by LeighM »

Hi Rinie
You need to attach the CAN bus e-block to Port C (It uses the SPI)
Set the connection property Chip Select to Port C Pin 6
Also check that the jumpers A and 1 are set on the EB018
Regards,
Leigh

Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

Re: CAN problem in FC5

Post by Walbeek »

Hello Leigh,
Thanks for your answer, this functions well.
The datasheet on the EB018 shows a connection to port A (text below)

@@
The microcontroller that is being used determines which
port and which jumper. For example, if a PIC16F877A is
being used, the CAN board must be connected to port A,
with the jumper settings to A & 1.
@@

Jumper settings were alright.

Rinie
Greetings, Rinie
Flowcode V7 user

Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

Re: CAN problem in FC5

Post by Walbeek »

Hello again,

The can system works with 16F877A processors now, the receiver site reacts on pressing the button on the transmitter.
This is the test from the getting started file in the help function.

I have a new question on the transmission speed.
There are some standard values 125, 250, 500 and 1000 kbps.
Is it possible to change this value to 100 kbps, the speed that another can system uses?
Please let me know how to do that.

Rinie
Greetings, Rinie
Flowcode V7 user

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

Re: CAN problem in FC5

Post by LeighM »

Hi Rinie,

In the Custom Code for the CAN component, select [Defines] then Edit Code.
Scroll down to the following code...

Code: Select all

	//CAN Baud Rate
	#define %a_CNF1_VAL  				%h
	#define %a_CNF2_VAL  				%i
	#define %a_CNF3_VAL  				%j
And change the CNF1 value to 9

Code: Select all

	//CAN Baud Rate
	#define %a_CNF1_VAL  				9
	#define %a_CNF2_VAL  				%i
	#define %a_CNF3_VAL  				%j
Regards
Leigh

Walbeek
Flowcode v5 User
Posts: 68
Joined: Thu Mar 01, 2007 10:48 am
Location: Netherlands
Been thanked: 3 times
Contact:

Re: CAN problem in FC5

Post by Walbeek »

Hello Leigh,

I have changed the value from %h to 9.
Seems to work fine, thanks for your help.

Rinie
Greetings, Rinie
Flowcode V7 user

Post Reply