Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F84A Hardware Problems

Status
Not open for further replies.

No Liver

New Member
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?
 

Attachments

  • Image.jpg
    Image.jpg
    47.1 KB · Views: 274
  • my_program Finished.txt
    7.4 KB · Views: 258
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.

See this for more info.

Hope this helps, maybe I'm wrong though..
 
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?

hi,
Are you saying the program runs OK in simulation using MPLAB.?
 
The program runs perfectly in MPLab but when i put it into the board the pic does not seem to function. Nothing Happens.
 
Have you tried stepping through using MPLAB as a debugger? You appear to have left enough circuitry for ICD.
 
Check out your MCLR pin. It should be connect to VDD via a resister.

Also your input pins are floating that is very bad.You need some sort of pull up resisters to make sure that they are "high" when no button press.
 
Last edited:
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.
 
Does the 16F84A have an internal oscillator? If not, you will need a crystal.
 
Add this line onto the top part of your program.84A doesn't have INT RC its an ancient PIC which microchip stopped manufacturing.

Code:
__CONFIG   _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC

I just looked on top lines in your program remove that "org 0008h" pointer as well.You are not clearing the INTF flag either in your ISR.

Very hard to read your code, Use microchips template to write your codes.
 
Last edited:
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top