SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By kamiel
#142323
Hi All,
I have trouble compiling and uploading (modified or original) c-code to Sparkfun Clockit module. I tried simply by recompiling the original code fromhttp://dlnmh9ip6v2uc.cloudfront.net/datasheets/Kits/clockit-v11.zip
by running ‘make all’.
I subsequently uploaded the code using the TinyUSB programmer.
avrdude -p m328p -c usbtiny -P usb -b19200 -U flash:w:clockit-v11.hex
The above works OK with the original (downloaded) hexfile. If I compile the code myself and try to upload the new hexfile nothing but a loud beeping noise is the result. What am I doing wrong ?
Even reprogramming fuses makes no difference.
avrdude -p m328p -c usbtiny -P usb -b19200 -U lfuse:w:0xE6:m

any help is appreciated.
K
By jremington
#142331
Check that the hex file produced by "make all" is identical to the downloaded one. If not, either the source codes or the compiler options are not the same.
By kamiel
#142385
Hi J,

the hex files differ, but i can't figure out how to get the published C code to work or to be identical to the published hex file) on 328p versions of clockit
any help is greatly appreciated

Regards K
By jremington
#142403
You didn't say by how much the hex files differ but the source files are probably not the same. You should contact Spark Fun technical help for the latest source and compilation instructions.
By kamiel
#142414
That might be a good idea; it might be a good suggestion to sparkfun to update the code/makefiel to reflect the changes in clock it hardware. recent clock it hardware uses instead of a m168 a m328p MCU. all published code is still based on m168

suggestions welcome.
By kamiel
#142674
For the latest compiler versions please change the old ISR (SIG_OVERFLOW1) names to their modern couterparts >> ISR (TIMER1_OVF_vect) / old:ISR (SIG_OVERFLOW2) to new: ISR (TIMER2_OVF_vect)
to compile:
avr-gcc -c -mmcu=atmega328p -I. -gdwarf-2 -DF_CPU=16000000UL -Os -funsigned-char \
-funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes \
-Wa,-adhlns=clockit-v11.lst -std=gnu99 -MD -MP -MF .dep/clockit-v11.o.d clockit-v11.c \
-o clockit-v11.o
to program with USBTiny ISP:
avrdude -p atmega328p -P usb -c usbtiny -v -v -U flash:w:clockit-v11.hex