PDA

View Full Version : Basic PIC circuit acting weird



FIONEX
- 6th October 2008, 23:25
Hi

I'm following a basic PIC tutorial. I've assembled a circuit on my bread board to flash an LED. I'm using the PIC 16F886 with a 5V AC to DC converter (500 mA max).

The Setup:
5V going to the Vdd
5V to MCLR through 11.5 kOhm resistor
Vss to ground
5V to RC oscillator w/ a 11.5 kOhm resistor in series w/ a 27 pF capacitor to ground
OSCin is connected to the RC oscillator between the resistor and capacitor
220 Ohm resistor from port B to an LED to ground

The problem:
The circuit doesn't work unless i'm physically touching the LED wire or the resistor coming to it. I checked my connections with a multimeter but they seem ok. The port doens't seem to output voltage UNLESS i'm touching it.

LOL this is driving me insane. Any ideas on what's happening.

Thanks

Archangel
- 7th October 2008, 17:06
Post your code, PIC number. Do you have a regulator in your power supply? Capacitors ? Have you set the TRIS and PORT registers? Have you set the config fuses? Are you using Resistors to tie the unused ports to either ground or VCC ?

aratti
- 8th October 2008, 11:15
your oscillator does not work! It start oscillating when you introduce disturbances with your body antenna. Replace oscillator with something that surely oscillate as a ceramic resonator.

FIONEX
- 9th October 2008, 01:04
you're right, i hadn't set the right oscillator setting on the pic.