I recently received the 3pi robot I ordered from Pololu. After playing around with the demo program, I tried to use the Pololu AVR programmer to program the ATmega328P onboard with a simple test program. It seems AVRDUDE was able to erase the flash memory but is not able to successfully program the microcontroller, because the demo program is no longer loaded. I’ve tried programming from both Linux and Windows, but it fails with the same error no matter what. I have also used other HEX files that I know run on other ATmega328P microcontrollers I own. It looks to me like the onboard microcontroller is malfunctioning, but I’d appreciate any advice people can give me. Hopefully I’m just doing something wrong, because it’s depressing that my first attempt at programming this fresh-out-of-the-box 3pi has failed.
Here is the output of AVRDUDE (using the same parameters found in the Pololu Makefile):
avrdude -p m328p -c avrisp2 -P /dev/ttyACM0 -U flash:w:test.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f
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 "test.hex"
avrdude: input file test.hex auto detected as Intel Hex
avrdude: writing flash (10048 bytes):
Writing | ################################################## | 100% 2.48s
avrdude: 10048 bytes of flash written
avrdude: verifying flash memory against test.hex:
avrdude: load data flash data from input file test.hex:
avrdude: input file test.hex auto detected as Intel Hex
avrdude: input file test.hex contains 10048 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 2.00s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0x9d != 0x00
avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK
avrdude done. Thank you.