MembersPage/MattiasSandgren/NickesBMW/AvrBootCode (2006-06-02 02:32:54)

AVR boot code how to

Due to a failure with the electrical system in the car last year, we had to replace the AVR, the new chip was missing a boot loader so this page is about what I did to program the AVR.

( Guidelines copied from MembersPage/SteinOvePrestmo/MyNotes )


The tool used was avrdude which can be found here:

http://www.bsdhome.com/avrdude/

Contents of avrdude.conf file:\nÿ1ÿ

The boot loader hex file was swiped from an old firmware that was compilable (no WBO2 code removed, etc).\n

D:\VEMS>avrdude -c bsd -p m128 -U flash:w:main.hex

avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9702



avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (131072 bytes):

Writing | ################################################## | 100% 50.61s

avrdude: 131072 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 131072 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 48.36s

avrdude: verifying ...
avrdude: 131072 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.


This cable is to be used togheter with the "-C bsd" command in AVRDUDE

AVR pin commandISP header #Parallel port pinNotes
AVR /RESET57Yellow
AVR SCK (clock input)38Black
AVR PDI (RXD) (instruction in)49Red
AVR PDO (TXD) (data out)110Orange
Signal Ground618Brown
* MOSI and MISO are not used.

Correct pins from the schematics AVR pin 2 = RXD/PDI -> ISP header Pin4, AVR Pin3 = TXD/PDO -> ISP header pin 1

This is what it looked like:

avr_isp_cable_attached.jpg avr_isp_cable_ends.jpg