Hi all,
I am a complete beginner with PIC programming and am trying to get the most basic possible program to work. I just want to make one LED light up.
I've figured out how to set the configuration bits, compile the C code into a hex file, and flash the hex file to my PIC16F84A. Everything seems to work fine until I try to light that LED!
I've connected Pin 14 to the +v rail and Pin 5 to the 0v rail as per the data sheet. I've tested the wires and the LED lights up just fine on its own. I've attached a (slightly blurry) photo of my breadboard.
Any ideas?
I am a complete beginner with PIC programming and am trying to get the most basic possible program to work. I just want to make one LED light up.
I've figured out how to set the configuration bits, compile the C code into a hex file, and flash the hex file to my PIC16F84A. Everything seems to work fine until I try to light that LED!
I've connected Pin 14 to the +v rail and Pin 5 to the 0v rail as per the data sheet. I've tested the wires and the LED lights up just fine on its own. I've attached a (slightly blurry) photo of my breadboard.
Rich (BB code):
#include "htc.h"
__CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & CP_OFF);
int main(void) {
PORTA=0; //set all as output
TRISA=0;
PORTB=0;
TRISB=0;
for(;;) {
RA1 = 1;
RB4 = 1;
}
}
Attachments
-
290.1 KB Views: 144