Hello Friends,
I am using PIC16F877A for a project.
I am using "MPLAB - HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.82" for coding.
I managed to write simple led blinking program, building was success, tried simulator as well.
But none of the leds are blinking.
Can someone please take a look at what's wrong.
I am also doubtful about setting the configuration bits.
Program:
#include<htc.h>
#include<pic.h>
//__CONFIG(FOSC_HS|WDTE_OFF|PWRTE_ON|LVP_OFF|DEBUG_OFF);
__CONFIG(FOSC_HS|WDTE_OFF|PWRTE_ON|BOREN_OFF|LVP_OFF|CPD_OFF|WRT_OFF|DEBUG_OFF|CP_OFF);
void main(void)
{
TRISA=0;
TRISB=0;
TRISC=0;
TRISD=0;
PORTA=0xFF;
PORTB=0xFF;
PORTC=0xFF;
PORTD=0xFF;
while(1)
{
PORTA=0xFF;
PORTB=0xFF;
PORTC=0xFF;
PORTD=0xFF;
}
}
Thanks.
I am using PIC16F877A for a project.
I am using "MPLAB - HI-TECH C Compiler for PIC10/12/16 MCUs (Lite Mode) V9.82" for coding.
I managed to write simple led blinking program, building was success, tried simulator as well.
But none of the leds are blinking.
Can someone please take a look at what's wrong.
I am also doubtful about setting the configuration bits.
Program:
#include<htc.h>
#include<pic.h>
//__CONFIG(FOSC_HS|WDTE_OFF|PWRTE_ON|LVP_OFF|DEBUG_OFF);
__CONFIG(FOSC_HS|WDTE_OFF|PWRTE_ON|BOREN_OFF|LVP_OFF|CPD_OFF|WRT_OFF|DEBUG_OFF|CP_OFF);
void main(void)
{
TRISA=0;
TRISB=0;
TRISC=0;
TRISD=0;
PORTA=0xFF;
PORTB=0xFF;
PORTC=0xFF;
PORTD=0xFF;
while(1)
{
PORTA=0xFF;
PORTB=0xFF;
PORTC=0xFF;
PORTD=0xFF;
}
}
Thanks.