Hi,
I've just started with PIC programming and I've written the first basic code.
It's to be run on a PIC16F628A (with 2 x 8-bit ports). All it's meant to do is just turn the bits of each pin on in groups of 2. Have I gotten this right or am I barking up the wrong tree?
I've just started with PIC programming and I've written the first basic code.
It's to be run on a PIC16F628A (with 2 x 8-bit ports). All it's meant to do is just turn the bits of each pin on in groups of 2. Have I gotten this right or am I barking up the wrong tree?
Code:
BSF 03h,5
MOVLW 00h
MOVWF 85h
MOVWF 86h
BCF 03h,5
START NOP
MOVLW b'00000011'
MOVWF 05h
CALL DELAY
MOVLW b'00001100'
MOVWF 05h
CALL DELAY
MOVLW b'00110000'
MOVWF 05h
CALL DELAY
MOVLW b'11000000'
MOVWF 05h
CALL DELAY
MOVLW b'00000000'
MOVWF 05h
CALL DELAY
MOVLW b'00000011'
MOVWF 06h
CALL DELAY
MOVLW b'00001100'
MOVWF 06h
CALL DELAY
MOVLW b'00110000'
MOVWF 06h
CALL DELAY
MOVLW b'11000000'
MOVWF 06h
CALL DELAY
MOVLW b'00000000'
MOVWF 06h
CALL DELAY
GOTO START
DELAY 20h EQU FFh
DL DECFSZ 20h,1
GOTO DL
RETURN