Hi Chris: Have you been able to program the chip using avrdude directly? That is, can you program the chip outside the makefile?
Cheers, Matthew van de Werken - Electronics Engineer CSIRO E&M - Rock Mass Characterisation - 1 Technology Court - Pullenvale - 4069 p: (07) 3327 4142 * f: (07) 3327 4455 * e: [EMAIL PROTECTED] "We do not inherit the earth from our ancestors, we borrow it from our children." -- Native American Proverb > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > On Behalf Of Chris Spencer > Sent: Tuesday, 30 May 2006 11:41 AM > To: [EMAIL PROTECTED] > Cc: [email protected] > Subject: Re: [avr-chat] AVR Test > > > Yeah, the led is currently off. Even if I change the program > to just set > all of portd high then exit, the led still stays off. > > Chris > > [EMAIL PROTECTED] wrote: > > Chris, > > I did not tested however, > > > > PORTD &= ~(1<<PD1); /* LED off */ > > > > Should turn off the led. > > > > Javier > > > > > > > > > > Chris Spencer <[EMAIL PROTECTED]>@nongnu.org con fecha 29/05/2006 > > 09:22:24 p.m. > > > > Enviado por: [EMAIL PROTECTED] > > > > > > Destinatarios: [email protected] > > CC: > > Asunto: [avr-chat] AVR Test > > > > > > I was able to get my dev environment setup (thanks Galen) and > > successfully write a hex file to my atmega48. However, my > test program > > doesn't make the led blink. Below is my c code and makefile. Does > > anyone see any glaring problems? Is my makefile setting (or not > > setting) the appropriate fuse bits? I'm testing on two Pololu Baby > > Orangutan boards > (http://www.pololu.com/products/pololu/0215/), so I'm > > pretty confident it's not a hardware issue. All lights are green on > > the programmer. > > > > #include <avr/io.h> > > > > /* at 8 MHz we get 1us per 8 instructions */ > > inline void delayus() { asm volatile("nop\nnop\nnop\nnop\n" > > "nop\nnop\nnop\nnop"); } > > > > void delayms(uint16_t millis) { > > uint16_t loop; > > while ( millis ) { > > loop = 100; > > while (loop) { > > /* 20us of delays */ > > delayus(); delayus(); delayus(); delayus(); delayus(); > > delayus(); delayus(); delayus(); delayus(); delayus(); > > loop--; > > } > > millis--; > > } > > } > > > > int main(void) { > > DDRD |= 1<<PD1; /* set PD1 to output */ > > while(1) { > > PORTD |= 1<<PD1; /* LED on */ > > delayms(1000); > > PORTD &= !(1<<PD1); /* LED off */ > > delayms(1000); > > } > > return 0; > > } > > > > CC=avr-gcc > > CFLAGS=-g -Os -Wall -mcall-prologues -mmcu=atmega48 > > OBJ2HEX=avr-objcopy TARGET=blink > > PART=m48 > > PROGRAMMER=avrisp2 > > > > program: $(TARGET).hex > > avrdude -p $(PART) -c $(PROGRAMMER) -P usb -e > > flash:w:$(TARGET).hex > > > > %.obj: %.o > > $(CC) $(CFLAGS) $< -o $@ > > > > %.hex: %.obj > > $(OBJ2HEX) -R .eeprom -O ihex $< $@ > > > > clean: > > rm -f *.hex *.obj *.o > > > > > > > > _______________________________________________ > > AVR-chat mailing list > > [email protected] > http://lists.nongnu.org/mailman/listinfo/avr-chat > > > > > > _______________________________________________ > AVR-chat mailing list > [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat > _______________________________________________ AVR-chat mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat
