Bug 07000005: table read/write PIC18 in main & interrupt

List of known bugs
Locked
Author
Message
User avatar
srdjan
mikroElektronika team
Posts: 1552
Joined: 28 Dec 2005 12:47
Location: Serbia

Bug 07000005: table read/write PIC18 in main & interrupt

#1 Post by srdjan » 14 Nov 2007 09:18

Bug ID: #07000005
Submitted by: bruno

Severity: Mayor (affects mikroPascal v7.0.0.0, pic18 family )
Status: Pending.

Description:
Using table read/write PIC18 operations may cause malfunction when used from main loop and from interrupt at the same time
The reason is the registers TBLPTR[U:H:L] and TABLAT are not saved during ISR.

Workaround:
Save these registers yourself in interrupt. See the example code below.

Code: Select all

procedure    interrupt();
  var a, b, c, d : byte;
  begin        
               
        a := TBLPTRL ;
        b := TBLPTRH ;
        c := TBLPTRU ;
        d := TABLAT ;

        // your code here...

        TBLPTRL := a ;
        TBLPTRH := b ;
        TBLPTRU := c ;
        TABLAT := d ;
  end;

Locked

Return to “mikroPascal Bug List”