closed

Loginbox

Please enter your username and password into the following fields to log in.


  • Username:
  • Password:
  •  
  • Auto log in on every visit.


  •  

Toggle bug with MEGA1280



Merlin offline
Schreiberling
Avatar
Gender: male
Location: UNITED KINGDOM 
Age:
Posts: 877
Registered: 03 / 2005
Private message
Subject: Toggle bug with MEGA1280  -  Posted: 04.06.2019 - 16:08   -  
There is a bug with toggle as shown in the following code. Amazingly, this occurs with a MEGA1280 but not with a MEGA128!

Code
program Bug;

Device = mega1280, VCC=5;


Import SysTick, LCDPort;

From System Import;

Define
  ProcClock      = 7372800;       {Hertz}
  SysTick        = 10;             {msec}
  StackSize      = 50, iData;
  FrameSize      = 50, iData;
  LCDtype = 44780; {66712}
  LCDport = PortA; {Port Address}
  LCDRows = 2; {2-lined display}
  LCDcolumns = 16; {16-character display}

uses
  ;
  
Implementation

{$IDATA}
const

type

{--------------------------------------------------------------}
{ Var Declarations }

var
  DebugLED [@PORTB, 2] : bit;


{--------------------------------------------------------------}
{ functions }
procedure ExecDebug;
begin
    Toggle( DebugLED );
end;

{ Main Program }
{$IDATA}

begin

  EnableInts;

  loop
    ExecDebug;
  
  endloop;
end Bug.


the assembler for ExecDebug is

Code
                        .FUNC     ExecDebug, 00027h, 00020h
Bug.ExecDebug:
                        .RETURNS   0
                        .BLOCK    40
                        .LINE     41
                        LDI      _ACCB, 004h
                        OUT       023h, _ACCB
                        .ENDBLOCK 42
Bug.ExecDebug_X:
                        .LINE     42
                        .BRANCH   19
                        RET
                        .ENDFUNC  42


As you can see the IN and EOR lines are missing. As I say, if I change the processor to a MEGA128 the lines are there!
Merlin.

:magic:

Software is a black art.
This post has been edited 1-times. Last edit: 04.06.2019 - 16:08 by Merlin.
go down go up
rh online
Administrator
Avatar
Gender: male
Location: GERMANY  Germany
Age:
Posts: 5464
Registered: 03 / 2002
Homepage Private message
Subject: Re: Toggle bug with MEGA1280  -  Posted: 10.06.2019 - 22:15   -  
Hello Merlin,

bug fixed in the new update.

rolf
Cars don't buy cars -- Autos kaufen keine Autos.
Henry Ford
go down go up
 


Registered users in this topic
Currently no registered users in this section

Delete cookies of this forum  •  FAQ / Help  •  Team page  •  Imprint   |  Local time: 17.08.2019 - 15:54