;-------- initialisieren von PortB ------------------------------ _initportBout_fpga clrf PORTB ; PortB = 0 bsf STATUS,RP0 ; select Bank 1 movlw b'00000000' ; b'00000000' in W movwf TRISB ; copy W to trisb ; RB0-RB7 are outputs bcf STATUS,RP0 ; select Bank 0 return _initportBin_fpga clrf PORTB ; PortB = 0 bsf STATUS,RP0 ; select Bank 1 movlw b'00111111' ; b'00000000' in W movwf TRISB ; copy W to trisb ; RB0-RB5 are inputs ; RB6-RB7 are outputs bcf STATUS,RP0 ; select Bank 0 return ;---------------------------------------------------------------- ;-------- schreibt Arbeitsregister W auf FPGA ------------------- _w2fpga_adr movwf PORTB ; copy W to portb bsf PORTB,6 ; 01 wechsle in ; Zustand adr bcf PORTB,7 nop nop ; in Zustand adr ; gewechselt nop bcf PORTB,7 ; in Zustand start ; wechseln bcf PORTB,6 nop nop nop ; in Zustand start ; gewechselt clrf PORTB ; portb = 0 return _w2fpga_data movwf PORTB ; copy W to portb bcf PORTB,6 ; 10 wechsle in einen ; der Zustände bsf PORTB,7 ; d0, d1 oder d2 nop nop ; in Zustand d0, d1 ; oder d2 gewechselt nop bcf PORTB,6 ; in Zustand start ; wechseln bcf PORTB,7 nop nop ; in Zustand start ; gewechselt nop clrf PORTB ; portb = 0 return ;---------------------------------------------------------------- ;-------- lese Daten vom FPGA ----------------------------------- _getfpga call _initportBin_fpga bsf PORTB,6 ; 11 wechsle in ; Zustand erg bsf PORTB,7 nop nop ; in Zustand erg ; gewechselt nop movf PORTB,W movwf fpga bcf PORTB,6 ; wechsle in ; Zustand start bcf PORTB,7 nop nop ; in Zustand s ; tart gewechselt nop call _initportBout_fpga clrf PORTB bcf fpga,7 ; beide Pins werden vom bcf fpga,6 ; FPGA nicht beschrieben return ;----------------------------------------------------------------