Page 1 of 1
CAN problem in FC5
Posted: Thu Oct 10, 2013 4:21 pm
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
Re: CAN problem in FC5
Posted: Fri Oct 11, 2013 9:11 am
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
Re: CAN problem in FC5
Posted: Fri Oct 11, 2013 9:36 am
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
Re: CAN problem in FC5
Posted: Fri Oct 11, 2013 5:15 pm
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
Re: CAN problem in FC5
Posted: Mon Oct 14, 2013 8:34 am
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
Re: CAN problem in FC5
Posted: Mon Oct 14, 2013 9:08 am
by Walbeek
Hello Leigh,
I have changed the value from %h to 9.
Seems to work fine, thanks for your help.
Rinie