Update: Guess I should have read the README better! I am ordering the ATMEGA328P.
Ps. Could you add DST support to your firmware?
I tried to program it using the usbmini programmer with your xmas firmware.
I follow the instructions, but when it tries to access the chip I get an error. If I put the original chip back in the clock and program it, it works fine.
I actually made some modifications to the original gps based source code so that my ultimate GPS works at 9600 baud instead of 4800 baud. That works great.
So is there anything special that i need to do in order to program the 328 chip?
Do I need the Arduino board to program the chip?
sh-3.2# make install-fuse
./optgen.pl time | xargs avr-gcc -c -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000 -o time.o time.c
./optgen.pl time | xargs avr-gcc -MM -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000 time.c > time.d
avr-gcc -I. -mmcu=atmega328p -std=gnu99 -Os -Wall -DF_CPU=8000000 -o icetube.elf icetube.o system.o time.o alarm.o piezo.o display.o buttons.o mode.o usart.o gps.o
avr-objcopy -j.fuse -O ihex icetube.elf icetube_fuse.hex
avrdude -p atmega328p -c usbtiny -P usb -B 4 -u -U lfuse:w:0x62:m -u -U hfuse:w:0xD1:m -u -U efuse:w:0x06:m
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
avrdude done. Thank you.
make: [install-fuse] Error 1 (ignored)
jarchie wrote:I have reproduced your error and am wrong about the Adafruit chip working out-of-the-box. I apologize for the inconvenience.
To reproduce the error, I removed the ATmega328p from my GPS-enabled clock, placed it in an Adafruit DC Boarduino, and burned the Arduino bootloader. When I inserted the chip back in my clock, programming failed exactly as you describe.
The problem was that the Arduino uses an external 16 MHz oscillator, so an ATmega328p with an Arduino bootloader has the external oscillator fuse configured. Since the clock does not provide a high-frequency external oscillator, the chip will not function in the clock--not even to be programmed.
To fix the situation, I installed the ATmega328p in my AVR development board (which provides power and an ISP header), wired in a 16 MHz external oscillator, and programmed the new fuse settings using the xmas-icetube's "make install-fuse". (A Boarduino or Arduino board also would have worked, but I wanted to make sure the problem really was the external oscillator.) With the ATmega328p fuses configured to use the internal 8 MHz oscillator, I put the chip back in my clock and was able to program it normally with a "make install."
Do you have access to an Arduino board or something with an ISP header and external crystal oscillator?
Users browsing this forum: No registered users and 1 guest