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: Flashing the AVR-CAN board

Tue Jul 19, 2011 1:10 pm

You are correct, I will fix #2. ... Fixed.
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: Flashing the AVR-CAN board

Tue Jul 19, 2011 2:07 pm

BTW, I got a 8V Zener Diode and a 6V Zener Diode. Which one should I use - I'm thinking of 8V (since they expect 7 to 12V) - but your 5.1V seems to be working fine ...
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 ?

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: Flashing the AVR-CAN board

Tue Jul 19, 2011 10:37 pm

The 5.1v Zener is in SERIES with the input,
to drop the 12-14 volts ... so 14 - 5 = 9 and
12 - 5 = 7 volts.
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: Flashing the AVR-CAN board

Tue Jul 19, 2011 11:23 pm

The "Mini USB AVR JTAG Programmer for Atmel ..." is found on Ebay
by searching for "Mini USB AVR JTAG":
http://shop.ebay.com/i.html?_from=R40&_ ... Categories

for $26 from a domestic source:
http://cgi.ebay.com/380328122863 (where I got mine, for quick delivery)

down to about $17 from overseas
http://cgi.ebay.com/250597883758 (untried source)

It comes with a "long" JTAG cable and can plug directly into a PC's
USB port (or one can use a USB A-to-A extension cable).

It seems to work well, though there were no instructions.
It seems to power the target board through the JTAG cable.
It has one jumper that MIGHT pass 5v or 3.3v to the target board,
but I have not yet measured the passed voltage.

Using AVRdude, I called it a "jtag1" device, on the appropriate COM port.

Of all I have tried, this seems to be the easiest to use with the
AVR-CAN board, as it provides power to the board as well,
presumably safely enough for the AVR-CAN board's regulator.

With this programer, it seems that one should NOT supply power
to the AVR-CAN board, or at least it is not necessary.
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: Flashing the AVR-CAN board

Wed Jul 20, 2011 12:43 am

garygid wrote:The 5.1v Zener is in SERIES with the input,
to drop the 12-14 volts ... so 14 - 5 = 9 and
12 - 5 = 7 volts.
That's right - somehow I kept thinking about the usual parallel z.diode use ...
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: Flashing the AVR-CAN board

Wed Jul 20, 2011 9:27 am

garygid wrote:The "Mini USB AVR JTAG Programmer for Atmel ..." is found on Ebay
by searching for "Mini USB AVR JTAG":
http://shop.ebay.com/i.html?_from=R40&_ ... Categories

for $26 from a domestic source:
http://cgi.ebay.com/380328122863 (where I got mine, for quick delivery)

down to about $17 from overseas
http://cgi.ebay.com/250597883758 (untried source)

It comes with a "long" JTAG cable and can plug directly into a PC's
USB port (or one can use a USB A-to-A extension cable).

It seems to work well, though there were no instructions.
It seems to power the target board through the JTAG cable.
It has one jumper that MIGHT pass 5v or 3.3v to the target board,
but I have not yet measured the passed voltage.

Using AVRdude, I called it a "jtag1" device, on the appropriate COM port.

Of all I have tried, this seems to be the easiest to use with the
AVR-CAN board, as it provides power to the board as well,
presumably safely enough for the AVR-CAN board's regulator.

With this programer, it seems that one should NOT supply power
to the AVR-CAN board, or at least it is not necessary.
OK, great, I just ordered one of these yesterday. I'm interested in the debugging capabilities, which you don't get with ICSP programmers like my USBtinyISP. Have you gotten anywhere with debugging and this board? It's supposed to be JTAG-ICE compatible.

It supplies regulated +5V via pins 4 & 7 on the JTAG connector. Make sure that you power your board from only 1 source at a time. Don't apply power to the voltage regulator input of the AVR-CAN while using this programmer, unless it has a jumper to cut off the +5V to the JTAG conector. My USBtinyISP has a PWR jumper that can be removed when I use it to program a board that already has 5V going into it. Also, the AT90CAN128 board has an EPWR jumper to disconnect the onboard regulated power when using a powered programmer.

User avatar
TomT
Posts: 10650
Joined: Sun Aug 08, 2010 12:09 pm
Delivery Date: 01 Mar 2011
Leaf Number: 000360
Location: California, now Georgia
Contact: Website

Re: Flashing the AVR-CAN board

Wed Jul 20, 2011 9:34 am

I went ahead and bought one of these since I'm going to want to be able to update the firmware with every new release... $16.99 with free shipping.
garygid wrote:The "Mini USB AVR JTAG Programmer for Atmel ..." is found on Ebay
by searching for "Mini USB AVR JTAG":
http://shop.ebay.com/i.html?_from=R40&_ ... Categories
Leaf SL 2011 to 2016, Volt Premier 2016 to 2019, and now:
2019 Tesla Model 3; LR, RWD, FSD, 19" Sport Wheels, silver/black; built 3/17/19, delivered 3/29/19.

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: Flashing the AVR-CAN board

Wed Jul 20, 2011 8:16 pm

BTW, I successfully connected my avr-can to Leaf - it was showing 62.6% and as I charged, kept going up. So things are working fine. I still need to get the 5v ZD and connect the power VIN from CAN to the board. I'm still using the 9V battery to power the board. I've the blue LED - looks nice with the Blue Leaf :lol: Yet to find a decent project box, though.

Yes, we can connect just the ev-can L & H - and it works. Only thing is, I had to switch on the car (didn't press brake) in the beginning to make the board recognize the CAN. Until then LED just showed dashes. Once this happenned, I could switch off the car and the avr-can continued to work.

Next step is to get the source to compile in avr-studio 4. If not I'll just use avr-win command line. BTW, I flashed the hex file using avr-studio 4 and it worked fine. I'm using the Olimax made JTAG programmer - that doesn't power the baord when connected.
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 ?

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: Flashing the AVR-CAN board

Wed Jul 20, 2011 8:39 pm

The "----" stays until some CAN buss messages start being received.

The present code does nothing special if no messages occur for a while.

I tried AVR Studio 5, not 4!!
Maybe 4 is a lot easier to use?
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: Flashing the AVR-CAN board

Wed Jul 20, 2011 8:48 pm

garygid wrote:The "----" stays until some CAN buss messages start being received.
So, when the car is switched off - and not charging - are there any messages that Leaf sends ?
I tried AVR Studio 5, not 4!!
Maybe 4 is a lot easier to use?
4 is much more "primitive" and not based on Visual Studio. But it works with the Olimex programmer I got. That was the reason I was trying it.

BTW, does ths ource compile with AVRS 5 ? Is that what you used ? May be we should start a separate thread on software.
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”