From 639c0e9bb9186ba3da218ea90ccdddfe187bd7d0 Mon Sep 17 00:00:00 2001 From: Olaf Rempel Date: Sat, 21 Jun 2008 14:34:57 +0200 Subject: [PATCH] mega88 version --- Makefile | 4 ++-- blmc.c | 64 ++++++++++++++++++++++++++++++++++------------------- blmc.h | 17 -------------- i2c-slave.c | 2 +- main.c | 38 ++++++++++++++++--------------- main.h | 19 ++++++++++++++++ 6 files changed, 83 insertions(+), 61 deletions(-) diff --git a/Makefile b/Makefile index 62854f7..b8102e2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PRG = bl_test OBJ = blmc.o eeprom.o i2c-slave.o main.o -MCU_TARGET = atmega8 +MCU_TARGET = atmega88 OPTIMIZE = -Os DEFS = @@ -61,4 +61,4 @@ ebin: $(PRG)_eeprom.bin install: text # uisp -dprog=avr910 -dserial=/dev/ttyS0 -dspeed=115200 -dpart=M8 --erase --upload if=$(PRG).hex - avrdude -p m8 -c butterfly -b 115200 -P /dev/ttyUSB1 -u -e -V -U flash:w:$(PRG).hex + avrdude -p m88 -c butterfly -b 115200 -u -e -V -U flash:w:$(PRG).hex diff --git a/blmc.c b/blmc.c index 14b3304..2b245c2 100644 --- a/blmc.c +++ b/blmc.c @@ -49,48 +49,66 @@ void next_phase(void) /* Disable Analog Comperator */ ACSR &= ~(1< params.pwm_max) pwm = params.pwm_max; - OCR1A = pwm; - OCR1B = pwm; - OCR2 = pwm; + OCR0B = pwm; + OCR2A = pwm; + OCR2B = pwm; } -ISR(ANA_COMP_vect) +ISR(ANALOG_COMP_vect) { next_phase(); } diff --git a/blmc.h b/blmc.h index 11fd765..c33703b 100644 --- a/blmc.h +++ b/blmc.h @@ -3,23 +3,6 @@ #include -#define PHASE_A_H (1<