Sponsored

Writing code for the CAN-BUS with the MCP2515

NavyVet1959

Banned
Banned
First Name
OldFart
Joined
Apr 11, 2018
Threads
7
Messages
1,250
Reaction score
1,192
Location
Texas, ya'll
Vehicle(s)
XJ (sold), WJ (sold), Ram 1500 QC 4x4 (sold 2018.06.07), Wrangler JL Sport 2-door (ordered 2018.06.08)
Occupation
Retired engineer (NASA, aerospace, DoD); ex-Navy
Vehicle Showcase
1
Has anyone tried using the MCP2515 and writing code for reading and sending CAN-BUS messages yet?

CAN%20Module%20MCP2515-1000x750.jpg


I would not be surprised if some of the aftermarket tuners / programmers used something similar for their features. There doesn't seem to be much in the way of public information available about the various CAN-BUS messages for different vehicles though.

I'm thinking it might be interesting to experiment with it using an Arduino microcontroller.

My understanding of the CAN-BUS so far is that it changes the way we go about controlling devices on our vehicles. Instead of having a switch that directly makes a connection to control a light, you might have one of these a pod of switches that have a microcontroller connected to them which upon sensing a change in the state of the switches, sends an appropriate CAN-BUS message on the vehicle's CAN-BUS network. This message might be read by another microcontroller somewhere else that determines what to do with that type of message. I suspect that this means a lot of small gauge signal wires running around the vehicle instead of larger gauge power wires.
Sponsored

 
Last edited:

SmartStopStart.com

Well-Known Member
Peak Sponsor (Level 2)
First Name
Steve
Joined
Feb 27, 2017
Threads
17
Messages
176
Reaction score
295
Location
Arlington, VA
Website
www.smartstopstart.com
Vehicle(s)
2019 Wrangler JL Rubicon Unlimited Sting Gray
Occupation
Electronics Engineer and Business Owner
The MCP2515 is a giant pain to use. I used them for a number of years. SmartStopStart uses a more modern version that is not as quirky that is embedded in the same chip die with the Microchip PIC18F25K80 microcontroller.
 
OP
OP

NavyVet1959

Banned
Banned
First Name
OldFart
Joined
Apr 11, 2018
Threads
7
Messages
1,250
Reaction score
1,192
Location
Texas, ya'll
Vehicle(s)
XJ (sold), WJ (sold), Ram 1500 QC 4x4 (sold 2018.06.07), Wrangler JL Sport 2-door (ordered 2018.06.08)
Occupation
Retired engineer (NASA, aerospace, DoD); ex-Navy
Vehicle Showcase
1
I've seen those articles... They don't give enough information on the actual process of reading and writing to the CAN-BUS. I'm not talking about doing anything malicious though or even have it where it is accessible remotely. Maybe just a auxiliary switch panel that had quite a few switches that were read by its microcontroller which in turn sent an appropriate CAN-BUS message when each switch was activated. Maybe LEDs that get lit when certain other messages are seen... Maybe you want to create a lighting module that is attached to the CAN-BUS and when it sees the message to turn the high beams on, it also turns on some other lights?
 
OP
OP

NavyVet1959

Banned
Banned
First Name
OldFart
Joined
Apr 11, 2018
Threads
7
Messages
1,250
Reaction score
1,192
Location
Texas, ya'll
Vehicle(s)
XJ (sold), WJ (sold), Ram 1500 QC 4x4 (sold 2018.06.07), Wrangler JL Sport 2-door (ordered 2018.06.08)
Occupation
Retired engineer (NASA, aerospace, DoD); ex-Navy
Vehicle Showcase
1
The MCP2515 is a giant pain to use. I used them for a number of years. SmartStopStart uses a more modern version that is not as quirky that is embedded in the same chip die with the Microchip PIC18F25K80 microcontroller.
Thanks for the info... I had stumbled across the MCP2515 and saw that it was supported by libraries for the Arduino environment, so it seemed like it might be a good choice for those who might be inclined to tinker around with their Jeeps.
 

Sponsored

SmartStopStart.com

Well-Known Member
Peak Sponsor (Level 2)
First Name
Steve
Joined
Feb 27, 2017
Threads
17
Messages
176
Reaction score
295
Location
Arlington, VA
Website
www.smartstopstart.com
Vehicle(s)
2019 Wrangler JL Rubicon Unlimited Sting Gray
Occupation
Electronics Engineer and Business Owner
Thanks for the info... I had stumbled across the MCP2515 and saw that it was supported by libraries for the Arduino environment, so it seemed like it might be a good choice for those who might be inclined to tinker around with their Jeeps.
It might be OK with the Arduino if the libraries have some well written code, but the buffer structure is bizarre and awkward which makes it difficult to manage at the chip level when dealing with a busy CAN bus.
 
OP
OP

NavyVet1959

Banned
Banned
First Name
OldFart
Joined
Apr 11, 2018
Threads
7
Messages
1,250
Reaction score
1,192
Location
Texas, ya'll
Vehicle(s)
XJ (sold), WJ (sold), Ram 1500 QC 4x4 (sold 2018.06.07), Wrangler JL Sport 2-door (ordered 2018.06.08)
Occupation
Retired engineer (NASA, aerospace, DoD); ex-Navy
Vehicle Showcase
1
It might be OK with the Arduino if the libraries have some well written code, but the buffer structure is bizarre and awkward which makes it difficult to manage at the chip level when dealing with a busy CAN bus.
So, is the JL using CAN 2.0A, 2.0B, of CAN FD?
 

SmartStopStart.com

Well-Known Member
Peak Sponsor (Level 2)
First Name
Steve
Joined
Feb 27, 2017
Threads
17
Messages
176
Reaction score
295
Location
Arlington, VA
Website
www.smartstopstart.com
Vehicle(s)
2019 Wrangler JL Rubicon Unlimited Sting Gray
Occupation
Electronics Engineer and Business Owner
 



Top