Problem Table Read Pic16F628A

OP #2176769
Lesenswert?

hallo!
hab problemm mit table read

movlw   HIGH table ; High Table Adresse laden
movwf   pclath
movlw   LOW table  ; Low Table Adresse laden
addwf   offset,w
btfsc   status,0
incf    pclath
movfw   offset
call    table
.
.
table
addwf   pcl,f
retlw...

im MPLAB und im Proteus wird alles korrekt simuliert
ich meine alle Register ( pclath auch )
Im device sieht so aus , dass pclath nicht incrementiert wird
und bei einigen offsets fliege ich raus vom programm
wo kann fehler sein?
mfg
#2176786
Lesenswert?

Ich mach es so im 16F:
1
getkey:
2
    movlw  HIGH(keyboardtable)  ;Highteil von tabelle holen
3
    movwf  PCLATH               ;und nach PCLATH damit
4
    movlw  LOW(keyboardtable)   ;Lowteil von Tabelle holen
5
    addwf  offset,w
6
    btfsc  STATUS,C             ; Überlauf ?
7
    incf  PCLATH,f              ; ja um eins erhöhen
8
    
9
    movwf  PCL  
10

11
...
12

13
keyboardtable:
14
  retlw  0x05  ; F1
15
  retlw  0x06  ; F2
16
  retlw  0x04  ; F3
17
  retlw  0x0c  ; F4
18
...
Holger

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren