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

Wed Jul 20, 2011 8:52 pm

lincomatic wrote:Any baud rate is fine. How about 9600 just to be safe.
I don't understand the question about the clock.
Thanks.
Here is the hex for a sample code from Olimex.

http://www.olimex.com/dev/soft/avr/AVR- ... n_UART.hex

You can find it on their avr-can page.

http://www.olimex.com/dev/avr-can.html
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

Wed Jul 20, 2011 8:56 pm

evnow wrote:
lincomatic wrote:Any baud rate is fine. How about 9600 just to be safe.
I don't understand the question about the clock.
Thanks.
Here is the hex for a sample code from Olimex.

http://www.olimex.com/dev/soft/avr/AVR- ... n_UART.hex

You can find it on their avr-can page.

http://www.olimex.com/dev/avr-can.html
Perfect! Thanks!

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 11:05 pm

Woohoo! Got the serial working now. The AVR-CAN sample program was sending back the same corrupted data as my Arduino. It turns out that Olimex didn't program the fuse bits. The low fuse was set to 0x4F, and thus, had CKDIV8 turned on. I changed the low fuse to 0xFF using avrdude:

avrdude -c usbtinyisp -p at90can128 -Ulfuse:w:0xFF:m

And voila, no more garbled serial data! Here is a convenient fuse calculator:
http://www.engbedded.com/fusecalc/

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

Fri Jul 22, 2011 8:25 am

My AVR-CAN boards all appear to have lfuse = 0xCF, when delivered.

You are speaking of the AT90CAN128 on the Header Board,
NOT the uP on the Olimex 16 MHz AVR-CAN Development Board, right?

Is that Header Board made by Olimex, or somebody else?
Last edited by garygid on Fri Jul 22, 2011 6:54 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

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 22, 2011 4:37 pm

garygid wrote:My AVR-CAN boards all appear to have lfuse = 0xCF, when delivered.

You are speaking of the AT90CAN128 on the Header Board,
NOT the uP on the Olimax 16 MHz AVR-CAN Development Board, right?

Is that Header Board made by Olimax, or somebody else?
Right, I have the header board. It's also by Olimex.

Return to “LEAF CANBus”