bikerbiker
Newbie level 4
I am writing a small program to drive LCD where I change the I/O line for Hi/Low digital signal however when I write for a second time to either Port A or Port B the voltage on the output rise and fall instead of being fixed 5V or 0V. This onlt happens after the second MOVWF is issued, if i reprogram with out the second MOVWF then all voltages are OK, Please Help as I am unable to pass a changing parallel data pattern to the LCD module.
ORG 0 ;
PIC16F84
GOTO RESET
; ************************** ;Delay routine.
; * delay routine: *
; **************************
DELAY MOVLW D'250'
MOVWF TIMER1
DELAY2 MOVLW D'250' ;
MOVWF TIMER2
DECFSZ TIMER2,F
GOTO $-1
DECFSZ TIMER1,F
GOTO DELAY2
RETLW 0
; **************************
; * main routine: *
; **************************
RESET
BSF STATUS,RP0
MOVLW B'00000000'
MOVWF TRISA
MOVLW B'00000000'
MOVWF TRISB
BCF STATUS,RP0
CLRF PORTA
CLRF PORTB
CLRWDT
MOVLW B'00001100'
MOVWF PORTA
MOVLW B'00001111'
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW B'00001000'
;this command below causes problem
MOVWF PORTA
CALL DELAY
END ;End of so
ORG 0 ;
PIC16F84
GOTO RESET
; ************************** ;Delay routine.
; * delay routine: *
; **************************
DELAY MOVLW D'250'
MOVWF TIMER1
DELAY2 MOVLW D'250' ;
MOVWF TIMER2
DECFSZ TIMER2,F
GOTO $-1
DECFSZ TIMER1,F
GOTO DELAY2
RETLW 0
; **************************
; * main routine: *
; **************************
RESET
BSF STATUS,RP0
MOVLW B'00000000'
MOVWF TRISA
MOVLW B'00000000'
MOVWF TRISB
BCF STATUS,RP0
CLRF PORTA
CLRF PORTB
CLRWDT
MOVLW B'00001100'
MOVWF PORTA
MOVLW B'00001111'
MOVWF PORTB
CALL DELAY
CALL DELAY
MOVLW B'00001000'
;this command below causes problem
MOVWF PORTA
CALL DELAY
END ;End of so