NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Tempsensor Upload Error

October 06, 2011
by nerdgirl
nerdgirl's Avatar

Hello,

I am having trouble uploading tempsensor.c onto my chip. I have worked through the line errors within my code and now I'm at a loss as to what to do next. Here is a snapshot of my error.

Dos Snapshot of tempsensor error upload

October 06, 2011
by nerdgirl
nerdgirl's Avatar

After reading my post, I figured out why I was receiving an error on uploading the tempsensor file. What I did was adjust the "Makefile" serial port to COM2 which this lesson was learned from my previous project. Now that's done and the upload went as planned. Thanks to any and all who would have helped me.

October 07, 2011
by Ralphxyz
Ralphxyz's Avatar

nerdgirl, here is a helpful trick that helps to avoid that problem with the com port curtesy of bretm!

GCCFLAGS=-g -Os -Wall -mmcu=atmega168 
LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm
AVRDUDEFLAGS=-c avr109 -p m168 -F -b 115200 -P /dev/cu.PL2303-0000101D
LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

ProgramName = initialload

all:    $(ProgramName)-upload

$(ProgramName).hex: $(ProgramName).c
    make -C ../libnerdkits
    avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o $(ProgramName).o $(ProgramName).c ${LINKOBJECTS}
    avr-objcopy -j .text -O ihex $(ProgramName).o $(ProgramName).hex

$(ProgramName).ass: $(ProgramName).hex
    avr-objdump -S -d $(ProgramName).o > $(ProgramName).ass

$(ProgramName)-upload:  $(ProgramName).hex
    avrdude ${AVRDUDEFLAGS} -U flash:w:$(ProgramName).hex:a

Now you have to use your com2 instead of my Mac /dev/cu.PL2303-0000101D com port, but you reuse the Makefile for any project just by changing the ProgramName on line 6.

I use the same Makefile for all of my projects or at least initially just changing the ProgramName.

You can use any word for ProgramName often Target is used.

Ralph

October 07, 2011
by nerdgirl
nerdgirl's Avatar

Hi Ralph,

Thank you for the tip. I will try that. :-)

Post a Reply

Please log in to post a reply.

Did you know that reading a double floating point variable with scanf requires "%lf" for "long float"? Learn more...