Thursday, 16 June 2011

Sanguinololu Fuses!

I was getting no where with uploading the new firmware to my Sanguinololu.

So I read up on the boot loader, and it says that the PB0 line is pulsed 3 times, so I attached a led and resistor to it as documented in http://sanguino.cc/hardware


As you can see it nicely connects to the last pin on each row of the connectors


I got no flashes...

This basically means things are not running 


Then i found out about fuses

These set various boot options, and there are some nice Fuse calculators out there.. eg http://www.engbedded.com/fusecalc/

From the Sanguino boards.txt file i found the correct settings for the 3 fuse bytes


sanguino.bootloader.low_fuses=0xFF
sanguino.bootloader.high_fuses=0xDC
sanguino.bootloader.extended_fuses=0xFD

I have now set these with the command

avrdude -B 8 -patmega644P -cavrispmkII -Pusb -U lfuse:w:0xFF:m -U hfuse:w:0xDC:m -U efuse:w:0xFD:m

Which resulted in

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e960a
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xDC"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDC:
avrdude: load data hfuse data from input file 0xDC:
avrdude: input file 0xDC contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.
 



The LED now flashes as it should.

I still cant upload my firmware, but it is now trying... getting closer

1 comment:

  1. I have now uploaded via the bootloader... to be documented soon

    ReplyDelete