lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 10:10 am

How does one connect the MCP2551 bus transceiver to the CAN bus?
I see the pinouts of the OBD-II connector in this post:

http://www.mynissanleaf.com/viewtopic.php?f=44&t=4131

Does one just connect CANL -> CANL and CANH -> CANH? Do we need to connect anything else, e.g. ground?

For instance, say one is using the AVR-CAN dev board from olimex. I see from the schematic
http://www.olimex.com/dev/pdf/AVR-CAN.pdf of this board,

MCP2551 CANL -> DB9 pin 2
MCP2551 CANH -> DB9 pin 7

From the other post, say we want to listen to the EV bus. We have EV CAN-L (12), EV CAN-H (13) on the OBD-II connector.

So do we just connect

(MCP2551 CANL -> DB9 pin 2) -> EV CAN-L (OBD-II 12)
(MCP2551 CANH -> DB9 pin 7) -> EV CAN-H (OBD-II 13)

Is this correct? Any other signals need to be connected?

I noticed from the schematic of the AVR-CAN board that there is a 120 resistor between CANH and CANL, but it doesn't seem to be connected across jumper pad CAN_T. Am I correct, or is there really a 120 ohm resistor connected between CANL and CANH. Can someone who owns this board verify for me?

Thanks in advance.

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: DIY AT0CAN CAN-Capture Project

Tue Jul 19, 2011 1:35 pm

garygid wrote:
1. I think I also have a $13 JTAG programmer from ebay, if it actually works. If not, I believe there is another "tiny", low-cost, USB-to-JTAG programmer from SparkFun that will work. I have it on order.
Gary, did you ever get this JTAG programmer to work? Does it do debugging as well? Do you have a link to it?
Thanks.

User avatar
evnow
Moderator
Posts: 11480
Joined: Thu Apr 22, 2010 11:41 am
Delivery Date: 25 Feb 2011
Leaf Number: 303
Location: Seattle, WA

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 9:24 pm

lincomatic wrote:So do we just connect

(MCP2551 CANL -> DB9 pin 2) -> EV CAN-L (OBD-II 12)
(MCP2551 CANH -> DB9 pin 7) -> EV CAN-H (OBD-II 13)
Yes - though most also connect ground and VIN for power.
1st Leaf : 2/28/2011 to 5/6/2013
2nd Leaf : 5/4/2013 to 3/21/2017
Volt : 3/25/2017 to 5/25/2018
Model 3 : 5/10/2018 to ?

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 10:13 pm

evnow wrote:
lincomatic wrote:So do we just connect

(MCP2551 CANL -> DB9 pin 2) -> EV CAN-L (OBD-II 12)
(MCP2551 CANH -> DB9 pin 7) -> EV CAN-H (OBD-II 13)
Yes - though most also connect ground and VIN for power.
Thanks. And we don't need the 120 ohm termination resistor, between CANL & CANH, correct?

GroundLoop
Posts: 1725
Joined: Mon Sep 13, 2010 9:31 pm

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 10:17 pm

Not for a logger.
The CANbus in the car already has the termination at each end.
I don't know how far you can run an (unterminated) tap off the DLC, but I've run some long cords and been just fine.

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 11:00 pm

The AVR-CAN has a provision to "connect" the resistor (needed if
terminating the un-terminated end of a CAN buss.
Solder-bridge the 1 and 2 sides of the CAN_T option.
Here, we do not use the terminating resistor.

There is a 10k pullup on RS (pin 8) to inhibit the interface
from writing to the CAN buss.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: DIY AT90CANxx CAN-Capture Project

Tue Jul 19, 2011 11:01 pm

Look for Programmer info and links in the
"Flashing the AVR-CAN board" thread.
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: DIY AT90CANxx CAN-Capture Project

Wed Jul 20, 2011 8:29 pm

I'm having trouble getting the serial port to work properly on my AT90CAN128 header board. When I try to read back data on my PC, I'm just getting garbage. I think there might be a problem with my Arduino library. If someone could send me a HEX file that just repeatedly writes a string to either serial port, I'd greatly appreciate it. I want to figure out if my problem is software or hardware. Thanks in advance.

User avatar
garygid
Gold Member
Posts: 12469
Joined: Wed Apr 21, 2010 8:10 am
Delivery Date: 29 Mar 2011
Leaf Number: 000855
Location: Laguna Hills, Orange Co, CA

Re: DIY AT90CANxx CAN-Capture Project

Wed Jul 20, 2011 8:43 pm

Baud rates?
Clock to uP or UART?
See SOC/GID-Meter and CAN-Do Info
2010 Prius
2011 LEAF, 2014 Tesla S85
2018 & 2019 Tesla Model 3
PU: SDG&E
Solar PV: 33 x 225W -> 7 kW max AC
Craigslist: Xm5000Li Electric Motorcycle

lincomatic
Posts: 316
Joined: Fri Jun 10, 2011 10:01 am
Delivery Date: 06 Apr 2011
Leaf Number: 3819

Re: DIY AT90CANxx CAN-Capture Project

Wed Jul 20, 2011 8:47 pm

garygid wrote:Baud rates?
Clock to uP or UART?
Any baud rate is fine. How about 9600 just to be safe.
I don't understand the question about the clock.
Thanks.

Return to “LEAF CANBus”