NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » what do these errors mean?
July 27, 2010 by cinta51 |
make.exe: *** [clockWithInputAndBuzzer-upload] Error 1 |
---|---|
July 27, 2010 by cinta51 |
sorry I should add in the other stuff lol. here 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 /dev/ttyUSB0 LINKOBJECTS=../libnerdkits/delay.o ../libnerdkits/lcd.o ../libnerdkits/uart.o all: clockWithInputAndBuzzer-upload clockWithInputAndBuzzer.hex: clockWithInputAndBuzzer.c make -C ../libnerdkits avr-gcc ${GCCFLAGS} ${LINKFLAGS} -o clockWithInputAndBuzzer.o clockWithInputAndBuzzer.c ${LINKOBJECTS} avr-objcopy -j .text -O ihex clockWithInputAndBuzzer.o clockWithInputAndBuzzer.hex clockWithInputAndBuzzer.ass: clockWithInputAndBuzzer.hex avr-objdump -S -d clockWithInputAndBuzzer.o > clockWithInputAndBuzzer.ass clockWithInputAndBuzzer-upload: clockWithInputAndBuzzer.hex avrdude ${AVRDUDEFLAGS} -U flash:w:clockWithInputAndBuzzer.hex:a here is the program: // clockWithInputAndBuzzer.c // for NerdKits with ATmega168 // mrobbins@mit.edu define F_CPU 14745600define FEED_HOUR_A 15define FEED_MIN_A 0define FEED_HOUR_B 18define FEED_MIN_B 0define FEED_HOUR_C 21define FEED_MIN_C 0define ALERT_SECONDS 10 /how many seconds should the buzzer sound /include <stdio.h>include <stdlib.h>include <avr/io.h>include <avr/interrupt.h>include <avr/pgmspace.h>include <inttypes.h>include "../libnerdkits/delay.h"include "../libnerdkits/lcd.h"include "../libnerdkits/uart.h"// PIN DEFINITIONS: void realtimeclock_setup() { // setup Timer0: // CTC (Clear Timer on Compare Match mode) // TOP set by OCR0A register TCCR0A |= (1<<WGM01); // clocked from CLK/1024 // which is 14745600/1024, or 14400 increments per second TCCR0B |= (1<<CS02) | (1<<CS00); // set TOP to 143 // because it counts 0, 1, 2, ... 142, 143, 0, 1, 2 ... // so 0 through 143 equals 144 events OCR0A = 143; // enable interrupt on compare event // (14400 / 144 = 100 per second) TIMSK0 |= (1<<OCIE0A); } // the_time will store the elapsed time // in hundredths of a second. // (100 = 1 second) // // note that this will overflow in approximately 248 days! // // This variable is marked "volatile" because it is modified // by an interrupt handler. Without the "volatile" marking, // the compiler might just assume that it doesn't change in // the flow of any given function (if the compiler doesn't // see any code in that function modifying it -- sounds // reasonable, normally!). // // But with "volatile", it will always read it from memory // instead of making that assumption. volatile int32_t the_time; SIGNAL(SIG_OUTPUT_COMPARE0A) { // when Timer0 gets to its Output Compare value, // one one-hundredth of a second has elapsed (0.01 seconds). the_time++; } void speaker_off() { TCCR1A &= ~(1<<COM1A0); } void speaker_on() { TCCR1A |= (1<<COM1A0); } int main() { realtimeclock_setup(); uint8_t hours=0; uint8_t minutes=0; uint8_t seconds=0; // init lcd lcd_init(); FILE lcd_stream = FDEV_SETUP_STREAM(lcd_putchar, 0, _FDEV_SETUP_WRITE); lcd_home(); // init serial port uart_init(); FILE uart_stream = FDEV_SETUP_STREAM(uart_putchar, uart_getchar, _FDEV_SETUP_RW); stdin = stdout = &uart_stream; // Set the 6 pins to input mode - Two 3 bit numbers DDRC &= ~(1<<PC0); // set PC0 as input DDRC &= ~(1<<PC1); // set PC1 as input DDRC &= ~(1<<PC2); // set PC2 as input DDRC &= ~(1<<PC3); // set PC3 as input DDRC &= ~(1<<PC4); // set PC4 as input DDRC &= ~(1<<PC5); // set PC5 as input // turn on the internal resistors for the pins PORTC |= (1<<PC0); // turn on internal pull up resistor for PC0 PORTC |= (1<<PC1); // turn on internal pull up resistor for PC1 PORTC |= (1<<PC2); // turn on internal pull up resistor for PC2 PORTC |= (1<<PC3); // turn on internal pull up resistor for PC3 PORTC |= (1<<PC4); // turn on internal pull up resistor for PC4 PORTC |= (1<<PC5); // turn on internal pull up resistor for PC5 // declare the variables to represent each bit, of our two 3 bit numbers uint8_t h1n=0,h1p=0; uint8_t h2n=0,h2p=0; uint8_t m1n=0,m1p=0; uint8_t m2n=0,m2p=0; uint8_t s1n=0,s1p=0; uint8_t s2n=0,s2p=0; uint8_t buzzer=0; / we set buzzer =1 when buzzer is active and 0 when inactive / /we use it to check when to turn off the buzzer / // turn on interrupt handler sei(); while(1) {
} return 0; } |
July 27, 2010 by hevans (NerdKits Staff) |
Hi cinta51, The error you are getting:
means that you have not selected the correct port for your USB programming cable in your Makefile. From the looks if it appears that you are on windows, so your Makefile should have something like COM2 or 3 depending on what your computer assigned the cable instead of "/dev/ttyUSB0". Hope that fixes it. Humberto |
July 27, 2010 by Ralphxyz |
This will also cause a problem: "define ALERT_SECONDS 10 /how many seconds should the buzzer sound /" I think you meant: "define ALERT_SECONDS 10 /how many seconds should the buzzer sound / Ralph |
July 27, 2010 by bretm |
It's the forum software turning asterisks into italics, in both of your posts. It's clear he knows the syntax for comments. |
July 27, 2010 by cinta51 |
OMG now I feel dumb lol, yeah I did add the COM4 and it worked fine. thankyou very much |
July 28, 2010 by Ralphxyz |
I certainly did not mean to imply that cinta51 did not know the syntax for comments. I know for me a simple syntax error sometimes will slip by. As for the idiosyncrasies of the forum software thanks for pointing that behavior out, it would be so nice to have a [code] facility. Ralph |
July 28, 2010 by bretm |
It looks like they just added a button to do that.
|
July 28, 2010 by Rick_S |
This isAWESOMEThis will make posting of code MUCH easier... THANKS!! |
July 28, 2010 by hevans (NerdKits Staff) |
Hi Rick, Bret, Ralph, and cinta51, I am glad you guys are enjoying the new magical indent button. Please send us an email at support <at> nerdkits <dot> com if you encounter any strange side effects or bugs with the new button. Humberto |
July 28, 2010 by Rick_S |
So far so good with the button, Already used it in another thread. |
Please log in to post a reply.
Did you know that Pulse Width Modulation (PWM) can be used to control the speed of a motor digitally? Learn more...
|