From: Bernhard Tittelbach Date: Tue, 2 Mar 2010 16:29:56 +0000 (+0000) Subject: Firmware für ATMEGA328p X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=d65af9917cd4e4f7ad0ebae54d7666f75fb5f1a5;p=svn42.git Firmware für ATMEGA328p --- diff --git a/firmware/Makefile b/firmware/Makefile index 5f9b299..bc69442 100755 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -1,12 +1,15 @@ ## see README file TARGET = tuer -INSTALL_DIR = /home/realraum/tuer_svn/firmware/arduino +INSTALL_DIR = $(PWD)/arduino PORT = /dev/ttyUSB0 -UPLOAD_RATE = 19200 +#UPLOAD_RATE = 19200 +UPLOAD_RATE = 57600 AVRDUDE_PROGRAMMER = stk500v1 -MCU = atmega168 -F_CPU = 16000000 +#MCU = atmega168 +MCU = atmega328p +#F_CPU = 16000000 +F_CPU = 16000000L ############################################################################ # Below here nothing should be changed... diff --git a/firmware/tuer.pde b/firmware/tuer.pde index 6c966a2..0f2246c 100644 --- a/firmware/tuer.pde +++ b/firmware/tuer.pde @@ -112,6 +112,7 @@ void start_debounce_timer() // this breaks millis() function, but who cares TCCR0A = 0; // no prescaler, WGM = 0 (normal) TCCR0B = 1< 16us @ 16 MHz + //OCR0A = 255; // 1+255 = 256 -> 12.8us @ 20 MHz TCNT0 = 0; // reseting timer TIMSK0 = 1< 2 ms @ 16 MHz + //OCR1A = 155; // (1+155)*256 = 40000 -> 2 ms @ 20 MHz TCNT1 = 0; // reseting timer TIMSK1 = 1< 250 ms @ 16 MHz + //OCR1A = 19530; // (1+19530)*256 = 5000000 -> 250 ms @ 20 MHz TCNT1 = 0; // reseting timer TIMSK1 = 1< 500 ms @ 16 MHz + //OCR1A = 39061; // (1+39061)*256 = 10000000 -> 500 ms @ 20 MHz TCNT1 = 0; // reseting timer TIMSK1 = 1< ~10 ms @ 16 MHz + //OCR2A = 194; // (1+194)*1024 = 199680 -> ~10 ms @ 20 MHz TCNT2 = 0; // reseting timer TIMSK2 = 1<