Page 1 of 1

ATmega8, ATmega168 and ATmega32 with Timer-Interrupt

Posted: Thu Jul 01, 2010 9:43 am
by alex
Hi @ all
I've tried a lot of things with some controllers.
At the beginn it was ATmega8 (from USB2LPT Project):
D- : PB0
D+: PB1
F_CPU = 12000000

/////////////////////////// MCU_OPTIONS
#define USB_INTR_CFG TCCR1B
#define USB_INTR_CFG_SET 0
#define USB_INTR_CFG_CLR 0
#define USB_INTR_ENABLE TIMSK
#define USB_INTR_ENABLE_BIT TICIE1
#define USB_INTR_PENDING TIFR
#define USB_INTR_PENDING_BIT ICF1
#define USB_INTR_VECTOR TIMER1_CAPT_vect

- it works

... so I tried the same with ATmega168
D- : PB0
D+: PB1
F_CPU = 12000000

/////////////////////////// MCU_OPTIONS
#define USB_INTR_CFG TCCR1B
#define USB_INTR_CFG_SET 0
#define USB_INTR_CFG_CLR 0
#define USB_INTR_ENABLE TIMSK1
#define USB_INTR_ENABLE_BIT ICIE1
#define USB_INTR_PENDING TIFR1
#define USB_INTR_PENDING_BIT ICF1
#define USB_INTR_VECTOR TIMER1_CAPT_vect


- it works too...

last 2 weeks I try it with ATmega32... but ATmega32 don't want to play my game and does not enumerate.
As Debug-Information I get: 00: ... ff ... ff ... ff ...ff ... ff ...
The register-names in MCU - Options are equal at ATmega8.
The Hardware works (I tried Atmega168)... But I can't find differences or points where the problem could be.
If someone know a solution, this would make me very, very happy...

Re: ATmega8, ATmega168 and ATmega32 with Timer-Interrupt

Posted: Fri Jul 02, 2010 11:19 am
by alex
RESOLVED
I idiot ;) found out that the trigger started from ICP1(PB0) pin and
ICP1 sets ICF1 ... nice