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.

Project Help and Ideas » New program not compiling

January 13, 2011
by hariharan
hariharan's Avatar

Hello i made this new, simple program and made a makefile for it, but it is not compiling. Don't know wheather it is the program's problem or some other problem. it said "avrbutterfly/109? Maybe it is 910." i tried rebooting but it did not work.

January 14, 2011
by Rick_S
Rick_S's Avatar

That's not a compiling error, that error is generated by avrdude and means that either your chip isn't in programming mode or for some reason, the PC/Micro connection isn't right. Re-check your wiring, double check that your USB/Serial adapter is configured properly in the makefile, make sure you are in program mode. If you can't get it to work, more info will be needed to help much more. A good overhead photo of the setup and the text of your makefile often will help us help you much more.

Rick

January 14, 2011
by hariharan
hariharan's Avatar

this is the makefile: GCCFLAGS=-g -Os -Wall -mmcu=atmega168 LINKFLAGS=-Wl,-u,vfprintf -lprintf_flt -Wl,-u,vfscanf -lscanf_flt -lm AVRDUDEFLAGS=-c avr109 -p m168 -b 115200 -P COM4 LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o

all: bink-upload

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

bink.ass: bink.hex avr-objdump -S -d bink.o > bink.ass

bink-upload: bink.hex avrdude ${AVRDUDEFLAGS} -U flash:w:bink.hex:a C program:

define F_CPU 14745600

include <stdio.h>

include <avr/io.h>

include <inttypes.h>

include "../libnerdkits/delay.h"

int main() { DDRB|=(1<<PINB6); DDRD|=(1<<PIND5);

while (1) { PORTB |=(1<<PINB6); delay_ms(1000); PORTB &=~(1<<PINB6); delay_ms(1000); PORTD |=(1<<PIND5); delay_ms(1000); PORTD &=~(1<<PIND5); delay_ms(1000); } return 0; }

January 22, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Hari,

Did you ever get this up and running. Your makefile looks ok to me. If you post some pictures of your setup we might be able to find soemthing strange.

Also remember that when you post makefiles or code you should indent it as a Code block by putting 4 spaces in front of it (you can just use the Indent as Code Block button to make it easier).

Humberto

Post a Reply

Please log in to post a reply.

Did you know that two resistors can be used to make a voltage divider? Learn more...