PIC-Frage

Hallo Leute,

wie ON nn GOTO in C switch { }). Die Berechnung erfolgt ja mit 8 Bit,

Funktion im oben genannten Adressbereich problemlos auswerten kann:

StartText2: andlw 0x0f ; Wertebereich auf 0-15 begrenzen addwf PCL,f dt "Initialisierung" ; Der Text wird zeichenweise geliefert retlw 0 ; Textende

(dt erzeugt retlw-Kommandos wie beim Textende)

Jetzt habe ich einen Sprungverteiler, der auf Tastendruck nacheinander

StartTest: .....

SelFkt: ; movlw HIGH(SelFkt) ; Oberes Byte der Sprungadresse ; movwf PCLATH ; setzen

rlf TestNr,w ; Relative Adresse addwf PCL,f ; Test aufrufen

goto StartTest call TestPPause ; 1: Pulspause messen goto StartTest call TestPAbstand ; 2: Pulsabstand messen goto StartTest

Das funktioniert im Adressbereich 00-FF hervorragend, so wie es oben dargestellt ist. Wenn ich aber die beiden ersten Zeilen auskommentiere,

Irgendwelche Tipps?

Reply to
Roland Krause
Loading thread data ...

Am 05.04.2015 20:55, schrieb Roland Krause:

Die Funktion von PCLATH beachten! So wie geschrieben funktioniert das

Reply to
Dieter Wiedmann

Am 05.04.2015 20:55, schrieb Roland Krause:

Reply to
Dieter Wiedmann

Habe ein Beispiel in der Doku gefunden:

BinaryToGrayCode: ANDLW 0x0F ;mask off invalid entries MOVWF temp MOVLW high TableStart ;get high order part of the beginning of ;the table MOVWF PCLATH MOVLW low TableStart ;load starting address of table ADDWF temp,w ;add offset BTFSC STATUS,C ;did it overflow? INCF PCLATH,f ;yes: increment PCLATH MOVWF PCL ;modify PCL

TableStart: RETLW b'0000' ;0 ....

allerdings auch nicht vorkommen. Ich werde das Beispiel oben mal probieren ...

Reply to
Roland Krause

Am 06.04.2015 08:45, schrieb Roland Krause:

Woher kenn ich den Spruch doch gleich? ;-)

So mach das.

Reply to
Dieter Wiedmann

Gesagt, getan: Das Problem war der CALL-Aufruf im Sprungverteiler, der

werden, sonst gehts schief.

Stelle ohnehin nochmal.

Frohe Ostern! Roland

Reply to
Roland Krause

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.