Environment
- MPLAB X IDE v6.20
- PIC16F84A-201/P
- PICKIT3
- The adaptor board for PICKIT3 looks like this:
Symptoms
After inserting the PIC into the adapter board and writing the blink program, I place the LED on the electrodes of the adapter board, but it does not blink. The LED is turned on when connected to VDD and VSS. So the LED is working fine. Some pins of RB on the PIC are connected to VDD or VSS inside the adaptor, but I am using RB1, which is not connected, to test the LED. I have confirmed that "Programming/Verify complete" is displayed after programming.
Program
// PIC16F84 Configuration Bit Settings
// 'C' source line config statements
// 16F88
// CONFIG1
#pragma config WDTE = OFF
#pragma config PWRTE = ON
#pragma config CP = OFF
// #pragma config statements should precede project file includes.
// Use project enums instead of #define for ON and OFF.
#include <xc.h>
#include <stdio.h>
#include <stdlib.h>
// If using the __delay_ms() function, it must be written as follows, and it must be specified that the clock is 8MHz. This should be written at the beginning of the program, before the main function.
#define _XTAL_FREQ 8000000
void main(void)
{
PORTA = 0x00; // Initialize PORTA
PORTB = 0x00; // Initialize PORTB
TRISA = 0x00; // Set input/output for PORTA
TRISB = 0x00; // Set input/output for PORTB
while(1){ // Infinite loop
PORTB ^= 0b00000010; // Toggle RB1
__delay_ms(500); // Wait for 500 milliseconds
}
}
I google "PIC16F84A-201/P led blink" but it didn't help me much.
What could be the issue? I would appreciate any guidance from those with detailed knowledge.