I am doing an electronics project using the PIC16F84A microcontroller, I am using the program MPLab to program the chip ant that works (it programs the chip successfully). The problem arises when i put it into a circuit, it does not run my program. Im not sure if i have not set something properly in the program or if my board is wrong. Is there any ideas on hoe i can get it to work?
Here is the layout of my pic. CN1 is a 4Mhz 3 pin christal. Also there is my program that i am using.
Can anything be done to make my project work on the board?
I don't know if it would affect anything but you appear to have left pin 4 (MCLR) unconnected. It would usually be connected via a pull-up resistor to VDD.
You could possibly combine this into a reset switch for free by switching between pin 4 and GND.
I am doing an electronics project using the PIC16F84A microcontroller, I am using the program MPLab to program the chip ant that works (it programs the chip successfully). The problem arises when i put it into a circuit, it does not run my program. Im not sure if i have not set something properly in the program or if my board is wrong. Is there any ideas on hoe i can get it to work?
when i debug it in MPLab, it starts fine but when an input is needed it keeps cycling around as i dont know how to create an input on one of the PORTA pins.
You need to adjust your circuit to include an oscillator (e.g. crystal and capacitors). Your code will not run unless you do this, as the PIC cannot execute instructions without a clock.
Once you have fixed this it would be worth writing a very simple program to flash the LEDs, to verify the hardware is OK.
When all of this works, you can start fixing the little bugs (like Gayan pointed out with the interrupts) and you should find it doesn't take too long to get it working.