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.
Control Area Network (CAN) bus
Moderator: Benj
- 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
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
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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