I'm trying to use 16f628's porta as an output but for some reason it doesn't work. at least when i'm simulating with mplab's simulator. the problem is that i cannot change the state of porta's 0-3 pins. They are always 0. so only RA4 is working.
my code is:
LIST P=16F628
radix hex
#include "P16F628.INC" ; Include header file
__config _INTRC_OSC_NOCLKOUT & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON
ORG 0x000 ; Program starts at 0x000
BSF STATUS,RP0 ; bank 1
CLRF TRISA ;all output
BCF STATUS,RP0 ; back to bank 0
CLRF PORTA
LOOP:
BSF PORTA,4 ;RA4 goes up
BCF PORTA,4 ;RA4 goes down
BSF PORTA,3 ;nothing happens
BSF PORTA,2 ;nothing happens
BSF PORTA,1 ;nothing happens
BSF PORTA,0 ;nothing happens
GOTO LOOP
END
can you see any clear errors or have you had same kind of problem??
Or is the error in simulator??
a
my code is:
LIST P=16F628
radix hex
#include "P16F628.INC" ; Include header file
__config _INTRC_OSC_NOCLKOUT & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON
ORG 0x000 ; Program starts at 0x000
BSF STATUS,RP0 ; bank 1
CLRF TRISA ;all output
BCF STATUS,RP0 ; back to bank 0
CLRF PORTA
LOOP:
BSF PORTA,4 ;RA4 goes up
BCF PORTA,4 ;RA4 goes down
BSF PORTA,3 ;nothing happens
BSF PORTA,2 ;nothing happens
BSF PORTA,1 ;nothing happens
BSF PORTA,0 ;nothing happens
GOTO LOOP
END
can you see any clear errors or have you had same kind of problem??
Or is the error in simulator??
a