Toggle bug with MEGA1280

Merlin
Administrator
Avatar
Geschlecht:
Alter: 25
Beiträge: 1474
Dabei seit: 03 / 2005
Betreff:

Toggle bug with MEGA1280

 · 
Gepostet: 04.06.2019 - 16:08 Uhr  ·  #1
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!
rh
Administrator
Avatar
Geschlecht:
Herkunft: Germany
Alter: 25
Homepage: e-lab.de
Beiträge: 5558
Dabei seit: 03 / 2002
Betreff:

Re: Toggle bug with MEGA1280

 · 
Gepostet: 10.06.2019 - 22:15 Uhr  ·  #2
Hello Merlin,

bug fixed in the new update.

rolf
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.
MySQL Queries: 15 · Cache Hits: 14   50   64 · Page-Gen-Time: 0.022474s · Speichernutzung: 2 MB · GZIP: ein · Viewport: SMXL-HiDPI