Doest AVR-USB uses timers?
Posted: Mon Oct 27, 2008 8:41 pm
Hi,
I want to use AVR-USB but i also want to make use of a 16-bit timer.
When using the 16-bit timer the avr usb stops working and vice versa.
Is there any problem using a 16 bit timer togheter with AVR USB?
This is my timer code:
ISR(TIMER1_OVF_vect)
{
PORTC=~PORTC; //Invert the Value of PORTC
timeCounter += 100;
}
void initTimer() {
// Output Compare Register A = 18750
OCR1A = 18750;
// Mode of operation: CTC, Prescaler = FCPU/64
TCCR1B |= (1<<WGM12) | (1<<WGM12) | (1<<CS11) | (1<<CS10);
TIMSK1 |= (1<<OCIE1A);
//Initialize Counter
TCNT1=0;
//Port C[3,2,1,0] as out put
DDRC=0xFF;
PORTC=~PORTC; //Invert the Value of PORTC
}
Thanks,
Nuno
I want to use AVR-USB but i also want to make use of a 16-bit timer.
When using the 16-bit timer the avr usb stops working and vice versa.
Is there any problem using a 16 bit timer togheter with AVR USB?
This is my timer code:
ISR(TIMER1_OVF_vect)
{
PORTC=~PORTC; //Invert the Value of PORTC
timeCounter += 100;
}
void initTimer() {
// Output Compare Register A = 18750
OCR1A = 18750;
// Mode of operation: CTC, Prescaler = FCPU/64
TCCR1B |= (1<<WGM12) | (1<<WGM12) | (1<<CS11) | (1<<CS10);
TIMSK1 |= (1<<OCIE1A);
//Initialize Counter
TCNT1=0;
//Port C[3,2,1,0] as out put
DDRC=0xFF;
PORTC=~PORTC; //Invert the Value of PORTC
}
Thanks,
Nuno