PIC-Frage

Apr 05, 2015 5 Replies

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?


Am 05.04.2015 20:55, schrieb Roland Krause:

Die Funktion von PCLATH beachten! So wie geschrieben funktioniert das

Am 05.04.2015 20:55, schrieb Roland Krause:

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 ...

Am 06.04.2015 08:45, schrieb Roland Krause:

Woher kenn ich den Spruch doch gleich? ;-)

So mach das.

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

werden, sonst gehts schief.

Stelle ohnehin nochmal.

Frohe Ostern! Roland

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required