I am an absolute novice to assembly programming on PIC16F877A(or, any μC for that matter!). I am using microchip's ICD2 to debug this first 'hello-pic-world' program:
include <p16f877.inc>
BCF STATUS, RP0 ;
BCF STATUS, RP1 ; Bank0
CLRF PORTA ; Initialize PORTA by
; clearing output
; data latches
BSF STATUS, RP0 ; Select Bank 1
MOVLW 0x00 ; Configure all pins
MOVWF ADCON1 ; as digital outputs
MOVLW 0x00 ; Value used to
; initialize data
; direction
MOVWF TRISA ;
MOVLW 01h
MOVWF PORTA
START
INCF PORTA,1
GOTO START
END
I am trying to actually see how PORTA behaves by stepping over each line of the code(and that's why the attempt to increment PORTA values one-by-one). I have connected the PORTA lines(pins 2-5 of PIC16F877A-I/P) to 4 LEDs. On the debugger, everything looked fine yesterday but today, PORTA seems to be too stubborn to change!
Can anyone rescue me please?
include <p16f877.inc>
BCF STATUS, RP0 ;
BCF STATUS, RP1 ; Bank0
CLRF PORTA ; Initialize PORTA by
; clearing output
; data latches
BSF STATUS, RP0 ; Select Bank 1
MOVLW 0x00 ; Configure all pins
MOVWF ADCON1 ; as digital outputs
MOVLW 0x00 ; Value used to
; initialize data
; direction
MOVWF TRISA ;
MOVLW 01h
MOVWF PORTA
START
INCF PORTA,1
GOTO START
END
I am trying to actually see how PORTA behaves by stepping over each line of the code(and that's why the attempt to increment PORTA values one-by-one). I have connected the PORTA lines(pins 2-5 of PIC16F877A-I/P) to 4 LEDs. On the debugger, everything looked fine yesterday but today, PORTA seems to be too stubborn to change!
Can anyone rescue me please?