Verify error while programming ATMega16
2009-09-01 by Chuck Hackett
I am attempting to program an ATMega16 with a serial booloader using: 1) AVRStudio 4.16(build: 628), connect speed lowered to 9600 2) AVR Ice-Cube JTAG device 3) GCC produced HEX file with SW from http://www.siwawi.arubi.uni-kl.de/avr_projects/ I verified that AVRStudio is connected to the processor (I can read the signature, lock bits, etc.) Fuses: Bootsize 512, BOOTRST checked, No lockbits set (yet) I am not vaery familiar with the encoding of the ".hex" files but "main.hex" looks like this: :103C000011241FBECFE5D4E0DEBFCDBF10E0A0E69B :103C1000B0E0EAE7FFE302C005900D92A036B107DD :103C2000D9F710E0A0E6B0E001C01D92A03EB107B8 :103C3000E1F70E94201E0C94BC1F0C941F1E0895D7 .... :103F400080E38CB95D9BFECF88E314C0933761F4A6 :103F50005D9BFECF83E08CB95D9BFECF84E98CB97D :103F60005D9BFECF8EE106C09B3109F485CE5D9B43 :0A3F7000FECF8FE38CB980CEFFCFA7 :0400000300003C00BD :00000001FF Researching the Intel HEX format on the internet (http://en.wikipedia.org/wiki/Intel_HEX) this appears to be loading 0x3C00 through 0x3F7A with 0x3C00 having a value of 0x11. When I use AVRStudio to program "main.hex" I get: OK Reading FLASH input file.. OK Setting device parameters for jtag programming ..OK Entering programming mode.. OK Erasing device.. OK Programming FLASH .. OK Reading FLASH .. OK WARNING: FLASH byte address 0x3C00 is 0x11 (should be 0x11).. FAILED! Leaving programming mode.. OK So, why am I getting a warning that address 0x3C00 does not match when it is also reporting on the same line that it does match (0x11 does equal 0x11 does it not?) ???? ... and I know I'm going to regret asking this one ... If I have specified a bootloader size of 512, why is the loader starting at 0x3c00? ... 16kb - 0x3c00 = 1024 bytes ... oops, just figured it out -> bootsize is in WORDS not bytes ... whew, that was close ... :-) Cheers, Chuck Hackett "Good judgment comes from experience, experience comes from bad judgment" 7.5" gauge Union Pacific Northern (4-8-4) 844 http://www.whitetrout.net/Chuck