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

DIY AT90CANxx CAN-Capture Project

Tue Jun 28, 2011 8:53 am

A thread for DIY CAN-Capture Projects that do not use the AVR-CAN Development Board, but do use one of the Atmel AT90CAN128, 63, or 32 uP chips.
Last edited by garygid on Tue Jun 28, 2011 4:34 pm, edited 1 time in total.
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 AT0CAN CAN-Capture Project

Tue Jun 28, 2011 2:26 pm

In reply to the FOLLOWING post:

--------------------
Good thinking, it should make a good DIY project, but beyond most people's skills.

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.

2. Do you need to add the CAN transeiver as on the AVR-CAN board?

3. Do you need an RS232 level-generator & transeiver chip, with some caps?

4. The display needs to be mounted and its 4 + 8 = 12 lines connected to the uP board.

5. DB9F connector for the RS232 connection?

6. DB9M (or on-board holes) for connecting the four OBD cable wires?

7. Additional power regulator to handle the 14v from the car?

8. Will you make a daughter board to hold/do this stuff?

9. The labor to program, build, test, and assemble is fine for a skilled person's DIY Project, but might end up saving very little (or actually cost more) when producing a number of units, but still in low quantity.

---
However, if you are serious about the project, we will watch and comment, if you wish.
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 AT0CAN CAN-Capture Project

Tue Jun 28, 2011 3:33 pm

garygid wrote:Good thinking, it should make a good DIY project, but beyond most people's skills.

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.

2. Do you need to add the CAN transeiver as on the AVR-CAN board?

3. Do you need an RS232 level-generator & transeiver chip, with some caps?

4. The display needs to be mounted and its 4 + 8 = 12 lines connected to the uP board.

5. DB9F connector for the RS232 connection?

6. DB9M (or on-board holes) for connecting the four OBD cable wires?

7. Additional power regulator to handle the 14v from the car?

8. Will you make a daughter board to hold/do this stuff?

9. The labor to program, build, test, and assemble is fine for a skilled person's DIY Project, but might end up saving very little (or actually cost more) when producing a number of units, but still in low quantity.

---
However, if you are serious about the project, we will watch and comment, if you wish.

------
Moderator, please take my post and the previous one and start a "DIY AT90CAN CAN-Capture Project" thread. Thanks.
Gary,

You have many valid questions.

I didn't know there were such cheap JTAG programmers on eBay. That's great if you can get one to work. One thing USBtinyISP is that it works easily with the Arduino IDE.

I didn't realize that a separate transceiver chip was needed, but adding a MCP2551 isn't all too hard.

Yes, I'm aware of the requirements for hooking up a display. At this moment, though, I'm more interested in USB connectivity to a Windows PC

I'm not going to do any RS-232 conversion. None of my PC's have an RS-232 port. It's easier to go straight from the uC to a USB->Serial converter.

Yes, 14V needs to be dealt with. Some additional components can handle that. To start, I was going to just hack a 9V cigarette lighter adapter that I have laying around.

One of the things I didn't like about the other board is the DB9 connectors. I'm buying an OBD cable with stripped ends, so it's easier for me to just attach them directly to the headers.

I'm just going to breadboard the thing while debugging it. Then I'll decide how I'll assemble something more compact to put in the car. Initially, I'll probably just
put all the parts on a proto board.

For volume production, a custom PCB would save a lot on cost. Right now, I'm just interested in hacking something together so I can play.

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 AT0CAN CAN-Capture Project

Tue Jun 28, 2011 4:31 pm

If you connect to the PC via USB, you will need some USB chip, and supporting firmware?

I decided to take advantage of the two on-chip UARTs in the AT90CAN128.
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
davewill
Posts: 5083
Joined: Thu Mar 17, 2011 6:04 pm
Location: San Diego, CA, US

Re: DIY AT0CAN CAN-Capture Project

Tue Jun 28, 2011 4:37 pm

garygid wrote:If you connect to the PC via USB, you will need some USB chip, and supporting firmware?

I decided to take advantage of the two on-chip UARTs in the AT90CAN128.
No, he's talking about integrating an Async to USB chip connected directly to the uC UART(s), then just having the USB connection available. It's handy because a mini or micro USB connector is nice and small, and PCs don't really have RS-232 ports anymore anyway. Plus he can skip the RS232 level shifter.
2014 Rav4 EV, Blizzard Pearl White
2011 LEAF SL w/QC, Blue Ocean, returned at end of lease

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 Jun 28, 2011 7:07 pm

Good idea, TTL internal UART directly to "USB" chip.

It would be nice to just lay out one board, no need to
use the AT90CAN128 "header" board.

Doing that, it would be easy to put 3 CAN channels on the same board
and just not populate two if only one-channel data-capture was needed.

-------------
We use $3 USB to RS232 adapter cables when we connect
to a single AVR-CAN. For supporting 3 boards nicely,
I use the 4-port RS232 device, but it is more expensive, but
handy and high speed.

Use at least 115200 baud for transfering binary data,
and maybe twice that if you send compact ASCII data.
We send fixed length 11-byte binary for each message:

Sync Byte, MsgIDLo, MsgIDHi, D1, .... D8
Data count (0 to 8) is in the high nibble of MsgIDHi
Missing data bytes are 0xFF.

Let me know what display you find.

Chris showed us one that includes a micro SD card.
Then, "hidden" logging could be done without a PC needed!

As we log, we add a 2-byte second and millisecond time
stamp to each message, and (intend to) insert a date-time
Pseudo-Message (Msg ID = 0xFFFF) once every minute.

Cheers, Gary
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 AT0CAN CAN-Capture Project

Fri Jul 01, 2011 9:54 am

davewill wrote:No, he's talking about integrating an Async to USB chip connected directly to the uC UART(s), then just having the USB connection available. It's handy because a mini or micro USB connector is nice and small, and PCs don't really have RS-232 ports anymore anyway. Plus he can skip the RS232 level shifter.
Right, I like to use offboard USB->Serial adapters. Sparkfun sells them as "FTDI cables." http://www.sparkfun.com/products/9718
But It just plugs into a 4-pin header. On the PC side, it's standard USB. Using 4 of these, you could connect 4 serial ports to your PC. If your PC doesn't have that many free ports, a cheap 4-port hub would let you connect all 4 into just 1 USB port

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

Fri Jul 01, 2011 5:58 pm

Don't know if this belongs in this thread, but here is an interesting PIC-based dev board. $55 for a pair.

http://www.newark.com/microchip/mcp2515 ... dp/07P9512

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

Sat Jul 02, 2011 2:36 pm

Good price, but what does in include, and
what does it take to program and load firmware into it?

I we were making a lot of these, making our own circuit board would be good, including a display, etc. However the OC-Meter is more of a special tool o help us understand the LEAF's Bars, and LEAF's real range limitations.
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
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

Sat Jul 02, 2011 8:00 pm

garygid wrote:Good price, but what does in include, and
what does it take to program and load firmware into it?
Here is the user manual and other stuff ....

http://www.microchip.com/stellent/idcpl ... P2515DM-BM
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 ?

Return to “LEAF CANBus”