Hi,
Am a completely a newbie to microcontrollers and their programming.Read about the PIC 16f84a programming in the net and tried out my own code in MPLAB IDE.I just tried a code to turn two led's on and off alternatively with some delay.When i compile the code, the build is suceeded.But when i Program it using PIC Start Plus Programmer and connect it to my circuit,I can observe that only one of my delay is working(i.e I could see only one led blinking).Please do help me with this.Thanks in advance.
list p=16F84
#include <p16F84.inc>
__CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _RC_OSC
ERRORLEVEL -302 ;
ORG 0x000
goto main
main
bsf STATUS,5;
movlw 00h;
movwf TRISA;
bcf STATUS,5;
PORTA equ 05h;
TRISA equ 85h;
STATUS equ 03h;
START
COUNT1 equ 08h;
COUNT2 equ 09h;
movlw 04h;
movwf PORTA;
LABEL decfsz COUNT1,1;
goto LABEL;
movlw 02h;
movwf PORTA;
LABEL1 decfsz COUNT2,1;
goto LABEL1;
goto START;
Am a completely a newbie to microcontrollers and their programming.Read about the PIC 16f84a programming in the net and tried out my own code in MPLAB IDE.I just tried a code to turn two led's on and off alternatively with some delay.When i compile the code, the build is suceeded.But when i Program it using PIC Start Plus Programmer and connect it to my circuit,I can observe that only one of my delay is working(i.e I could see only one led blinking).Please do help me with this.Thanks in advance.
list p=16F84
#include <p16F84.inc>
__CONFIG _CP_OFF & _WDT_ON & _PWRTE_ON & _RC_OSC
ERRORLEVEL -302 ;
ORG 0x000
goto main
main
bsf STATUS,5;
movlw 00h;
movwf TRISA;
bcf STATUS,5;
PORTA equ 05h;
TRISA equ 85h;
STATUS equ 03h;
START
COUNT1 equ 08h;
COUNT2 equ 09h;
movlw 04h;
movwf PORTA;
LABEL decfsz COUNT1,1;
goto LABEL;
movlw 02h;
movwf PORTA;
LABEL1 decfsz COUNT2,1;
goto LABEL1;
goto START;