PIC problem!

Thread Starter

vane

Joined Feb 28, 2007
189
I have a PIC16f84A programmed to flash an LED on RB3 port.
When it is in my experimentation board (velleman k8048) it flashes but when on my breadboard the light goes on constantly.

I have a 4mhz ceramic resonator with centre pin on Vss (5) with the other pins on 15 and 16.
MCLR (4) is connected to Vdd (14).
I have a polarised 63v 100uF Cap across Vss (5) and Vdd (14)
I have a 4.5v supply, + on Vdd and - on Vss
LED is on Vdd an RB3

It is probably a silly mistake :)
 

mik3

Joined Feb 4, 2008
4,843
Which resonator is it? Does it say in the datasheet to connect the central pin to ground?

If there is a MCLR pin, whose function is only to clear the memory and does not have any input/output function, on the PIC then you have to pull it up with a 10K resistor.
 

Thread Starter

vane

Joined Feb 28, 2007
189
so put a 10k resistor between MCLR and ground? The resonator is light blue, says 400 on it and has an M in a circle, i have no idea if it has a data sheet
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, normally you don't connect MCLR directly to Vdd/Vcc; you use a 10k pull-up resistor. That enables you to use a switch to momentarily ground MCLR to re-set the uC.

You may be having problems due to the parasitic capacitance/inductance/resistance inherent in the breadboard. The clock/resonator section is very sensitive to additional capacitance/inductance being added.

It is best to use prototype circuit boards when dealing with circuits in the MHz range.
 

SgtWookie

Joined Jul 17, 2007
22,230
Zimbarak,
You are attempting to link to images that are on your computers' desktop.

You are the only person on the planet that can see them.

You must use the "Go Advanced" and "Manage Attachments" buttons to upload photos from your computer.
 

mik3

Joined Feb 4, 2008
4,843
When the 10k resistor goes to vss the LEDs go out, when on Vdd they come on but flicker
Connect the MCLR pin to Vdd via a 10K resistor. The LED is flashing because I think you have the watchdog timer enabled and it resets the PIC every few ms. If you disable it everything should be fine.
 

Thread Starter

vane

Joined Feb 28, 2007
189
Just loaded a different program onto it whereby you press a button (bridge RA3) to light up the LED, now when i ground RA3 the light comes on solid, when i remove the ground, it flickers. In the code, it shows the WDT is off, i am one step closer though!

EDIT: Bloody hell! this has gone completely wrong, there may be a loose connection somewhere
 
Last edited:

BMorse

Joined Sep 26, 2009
2,675
Just loaded a different program onto it whereby you press a button (bridge RA3) to light up the LED, now when i ground RA3 the light comes on solid, when i remove the ground, it flickers. In the code, it shows the WDT is off, i am one step closer though!

EDIT: Bloody hell! this has gone completely wrong, there may be a loose connection somewhere

Do you have RA3 pulled High with resistor to Vcc?? If not your input could be "floating", hence the flickering when you remove wire from ground.....

Anytime you use a switch input that pulls your I/O low, you should always have a pullup resistor on it to keep the input from Floating.... same with outputs, have them tied to either ground or Vcc depending on application....


My .02
 

Thread Starter

vane

Joined Feb 28, 2007
189
I think i need a more reliable power source :s, anyone know where i can get a cheap good quality power source?
 

Markd77

Joined Sep 7, 2009
2,806
Ebay - "bench power supply" The unilab one looks pretty useful at £27 inc postage.
I got a good one for £20 a while back - just a variable single supply but with adjustable current limit and meters for voltage and current.
 

BMorse

Joined Sep 26, 2009
2,675
I think i need a more reliable power source :s, anyone know where i can get a cheap good quality power source?

If you are looking for a regulated one, try a computer power supply, you can get some that are around 700 Watts for under $30.00, with that you get a regulated +3.3(multiple outputs),+5 (multiple), +12(multiple),and a negative voltage as well(-12) (used to have -5 also, but they removed that from the specs...) anyways, cheap and easy to hook up for multiple voltages..... you can get used or less wattage ones for even cheaper.

.... or ask that buddy of yours that has a stack of them in his basement or something :D, someone you know is bound to have a pc power supply laying around :rolleyes:...



My .02
 

BMorse

Joined Sep 26, 2009
2,675
This is the most basic way of connecting an F84A (See attached circuit)....


and this is the basic config for a F84A....
Rich (BB code):
 __FUSES _CP_OFF & _WDT_OFF & _RC_OSC & _PWRTE_OFF
 

Attachments

Top