can any1 tell me wat does t44he following code doing? thx.
i'm a newbie to AtMega6 and microcontroller chip, and i need it urgently for my Final Year Project. thx 4 helping...
void initialize(void)
begin
/************** TIMER INITIALIZAIONS ********************/
//TIMER0
//set up timer 0 for 1 mSec timebase
TIMSK0= (1<<OCIE0A); //turn on timer 0 cmp match ISR
OCR0A = 249; //set the compare re to 250 time ticks
//set prescalar to divide by 64
TCCR0B= 3; //0b00001011;
// turn on clear-on-match
TCCR0A= (1<<WGM01) ;
//TIMER1
//sets motor speed to zero
OCR1A = 38000;
//turns on interrupt vectors for timer0
TIMSK1 = (1<<OCIE1A)|(1<<TOIE1) ; //turn on ISR
// timer 0 prescalar to 64
TCCR1B = 1;
i'm a newbie to AtMega6 and microcontroller chip, and i need it urgently for my Final Year Project. thx 4 helping...
void initialize(void)
begin
/************** TIMER INITIALIZAIONS ********************/
//TIMER0
//set up timer 0 for 1 mSec timebase
TIMSK0= (1<<OCIE0A); //turn on timer 0 cmp match ISR
OCR0A = 249; //set the compare re to 250 time ticks
//set prescalar to divide by 64
TCCR0B= 3; //0b00001011;
// turn on clear-on-match
TCCR0A= (1<<WGM01) ;
//TIMER1
//sets motor speed to zero
OCR1A = 38000;
//turns on interrupt vectors for timer0
TIMSK1 = (1<<OCIE1A)|(1<<TOIE1) ; //turn on ISR
// timer 0 prescalar to 64
TCCR1B = 1;