tomovill
Junior Member level 3
PIC problem
I programming a PIC16LF877 device. I have wrote an easy subrutin:
PROG
BSF XSET
BSF YSET
BSF ZSET
BSF AUTOLED
L6
BSF ACK ;PROGRAM INDULHAT
CALL WAITMS
BCF ACK
MOVF PORTB,0
MOVWF PORTC ;MÁSOLÁS PORTC -RE, AHOL A MOTOROK VANNAK
CALL WAITMS
BTFSS ALAPH ;HA NEM ALPHELYZETRE
GOTO L6 ;EL?R?L
CALL ALAPHE ;ALAPHELYZETRE ÁLLÍTÁS
RETURN
END ;PROGRAM VÉGE
This subrutin must be copying portb to portc.
Portb comes on a PC LPT. Portc goes to stepper motors driver (MC3479).
Problem:
When PB3 is on high => no problem, everything is good.
When RB3 is on low => everything is good, bot only on RB4 is 1,2V and not copying on RC4
What is the problem?
I programming a PIC16LF877 device. I have wrote an easy subrutin:
PROG
BSF XSET
BSF YSET
BSF ZSET
BSF AUTOLED
L6
BSF ACK ;PROGRAM INDULHAT
CALL WAITMS
BCF ACK
MOVF PORTB,0
MOVWF PORTC ;MÁSOLÁS PORTC -RE, AHOL A MOTOROK VANNAK
CALL WAITMS
BTFSS ALAPH ;HA NEM ALPHELYZETRE
GOTO L6 ;EL?R?L
CALL ALAPHE ;ALAPHELYZETRE ÁLLÍTÁS
RETURN
END ;PROGRAM VÉGE
This subrutin must be copying portb to portc.
Portb comes on a PC LPT. Portc goes to stepper motors driver (MC3479).
Problem:
When PB3 is on high => no problem, everything is good.
When RB3 is on low => everything is good, bot only on RB4 is 1,2V and not copying on RC4
What is the problem?