AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Bug in atmega162 timer2 simulation (Read 3249 times)
VasylYE
YaBB Newbies
*
Offline

VMLAB!

Posts: 6
UA
Gender: male
Bug in atmega162 timer2 simulation
11/03/11 at 17:13:50
 
Hello!
I'm use Atmega162, in my program TIMER2 running in asynchronous mode and there are Timer2 overflow interrupt.

In register TIMSK bit2, TOIE2 enable this interrupt, but in simulator, this bit have name "OCIE2" (see attached screenshot)

timer2 init. code:
[code]void timer2_init(void){
   TIMSK &=~((1<<TOIE2)|(1<<OCIE2));
   ASSR |= (1<<AS2);
   while (ASSR & (1 << TCON2UB)){};
   TCNT2 = 0x00;
   while (ASSR & (1 << TCR2UB)){};
   TCCR2 = (1 << CS22) | (1 << CS20);  // clk/128
   TIFR = (1 << OCF2) | (1 << TOV2);
   TIMSK |= (1 << TOIE2);  // <---- in this moment set bit2 in TIMSK reg
}[/code]
Back to top
 
WWW VasylYE 40082775   IP Logged
Pages: 1
Send Topic Print