Control Area Network (CAN) bus

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
kalim007
Posts: 67
Joined: Mon Jan 28, 2013 6:00 am
Has thanked: 20 times
Been thanked: 4 times
Contact:

Control Area Network (CAN) bus

Post by kalim007 »

Hello,
I am using PIC18F458 microcontroller. I am trying to design a small network using CAN bus. I read the microcontroller data sheet and I learned that RB3/CANRX and RB2/INT2/CANTX are two bus for data transmission. My understanding is that we need only two bus for data transmission and reception. When I add CAN module from Flowcode, I see that it is connected through RC6. I am confused here. I also read help file in Flowcode regarding CAN, but could not find answer.

I did some search regarding CAN in youtube and came up a simple microcontroller network. I am attaching a schematic here that I am trying to build. In the schematic there are three micrcontrollers. Microcontroller-1 is connected with a keyboard and two switches (SW); Microcontroller-2 is connected with a LCD display and Microcontroller-3 is connected with a LED. If anyone press a key from keypad, Microcontroller-2 will display that value in LCD. If anyone press SW-1(from microcontroller-1), Microcontroller-3 will turn on LED and by pressing SW-2(from microcontroller-1), LED will turn off.

Let me know if my idea is correct. Any kind of help will be highly appreciated.
Attachments
CAN-example.pdf
(107.5 KiB) Downloaded 255 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: Control Area Network (CAN) bus

Post by Benj »

Hello,

The CAN component operates in two modes, external where SPI is used to communicate with the CAN controller IC and internal where the CAN controller is on board. Your CAN type is on board.

You also need a CAN line driver for every microcontroller node to convert the TTL signals from your microcontroller into CAN compatible signals. A microchip MCP2551 or similar can be used for this.

Your schematic looks ok but is missing the line driver ICs.

CAN works on IDs so you could have

ID1 = Keypressed with data
ID2 = Switch1 Pressed
ID3 = Switch2 Pressed

kalim007
Posts: 67
Joined: Mon Jan 28, 2013 6:00 am
Has thanked: 20 times
Been thanked: 4 times
Contact:

Re: Control Area Network (CAN) bus

Post by kalim007 »

Thanks for your reply. It is difficult to learn by looking at only data sheet. But this forum is very helpful.

User avatar
Mantas
Posts: 221
Joined: Tue May 15, 2012 10:32 pm
Location: Klaipeda, Lithuania - North sea, UK
Has thanked: 57 times
Been thanked: 27 times
Contact:

Re: Control Area Network (CAN) bus

Post by Mantas »

Hi,

or you can use http://www.ti.com/product/sn65hvd230 as a CAN signal driver.

BR,
Mantas
Science is my true religion.

Post Reply