Bug atmega8 iv_t0

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
Greg.Bochenek
Posts: 1
Joined: 27 Jul 2011 15:22

Bug atmega8 iv_t0

#1 Post by Greg.Bochenek » 08 Mar 2012 14:45

v5.4 has a bug.
Wrong works jump to the interrupt handler Timer0 Overflow.
v5.0 has no this bug.
Please check it out.

Code: Select all


program MyProject;
{ Declarations section }
//atmega8
var
 w1               : sbit at portb1_bit;
 w1_Direction     : sbit at ddb1_bit;
 
 pwm_tmp,pwm_w1: byte;
 
 Procedure Timer0Overflow_ISR(); org IVT_ADDR_TIMER0_OVF ;

  begin
   pwm_tmp:=pwm_tmp+1;
   if pwm_tmp>99 then
   pwm_tmp:=0;
   if pwm_w1 > pwm_tmp then
    w1:=0
   else
    w1:=1;
  end;

Procedure cfg_();
  begin
   tccr0:= %00000001; //clk/1  mega8
   tcnt0:=0;
   toie0_bit:=1; //
   sreg_i_bit:=1; //
   w1_Direction:=1;
   w1:=1;
  end;
 

begin
  { Main program }
  cfg_ ;
  pwm_w1:=50;
   while true do
   
   begin
     nop;
   end;
  
end.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Bug atmega8 iv_t0

#2 Post by filip » 09 Mar 2012 09:45

Hi,

Yes, this is a confirmed bug which will be corrected in the incoming version which will be available very soon.

I apologize for the inconvenience caused by this.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for AVR General”