Forum: Mikrocontroller und Digitale Elektronik Problem Table Read Pic16F628A


von Nikolai B. (nbresh)


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

von Holger W. (holgerw)


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

von Nikolai B. (nbresh)


Lesenswert?

danke
alles endlich geklapt
nicht addwf pcl sondern movwf pcl
mfg

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.