I want to blink led with pic16f628a using pickit2 I generated the hex file and successfully write it, according to code, RB are input, but when I put led between RB0,1,2,3.. and ground it turn on. all the pin turn on the led, I'm using 5 volt output
code :
#include<htc.h>
// Config word
__CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & CP_OFF);
// Define LED pin
#define LED RA1
#define _XTAL_FREQ 8000000
void main()
{
TRISA1 = 0; // Make RA1 pin output
TRISB = 1;
LED = 0; // Make RA1 low
while(1)
{
__delay_ms(500); // Half sec delay
LED = 0; // LED off
__delay_ms(500); // Half sec delay
LED = 1; // LED on
}
}
scheme :