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.

Unstable 12f675

Status
Not open for further replies.

hjl4

Member
Hi, I am using a 12f675, GP0, and GP1, set in analogue mode, and all other pins are set as digital.
Now when my circuit is switched on, and the micro turns the LED on and then off repeatedly , if I pass my hand over the chip, about 4-6 inches above it, it stalls or causes LED to flash randomly, until I move my hand away and returns to set blink rate.
GP0 and GP1 are connected to an accelerometer, and micro turns GP4 on and blinking, when a certain amount of G force is present. The circuit is built on a solder less prototyping board. My power supply to the micro is a stable 5V, and only a resistor in series, to the accelerometer, to lower the voltage down to 3.3V.

My Config bits are as follows, _CP_OFF & _CPD_OFF & _BODEN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT. Comparators are off, GP0 GP1 analogue, GP2 GP4 GP5 are digital out, and GP3 digital input.


Has anyone a solution to this problem?
 
Do you have decoupling capacitor across Vdd and Vss?

My power supply to the micro is a stable 5V, and only a resistor in series, to the accelerometer, to lower the voltage down to 3.3V.
A single resistor cannot lower the voltage, you need at least two in series for voltage devider.
 
bananasiong said:
Do you have decoupling capacitor across Vdd and Vss?


A single resistor cannot lower the voltage, you need at least two in series for voltage devider.

"A single resistor cannot lower the voltage, you need at least two in series for voltage devider."

If the accelerometer draws a near constant amount of current then indeed a single resistor CAN be used to drop the 5v to 3.3v needed by that device. Just calculate the resistance needed to drop 1.7 volts at the current draw of the accelerometer.

Lefty
 
Leftyretro said:
"A single resistor cannot lower the voltage, you need at least two in series for voltage devider."

If the accelerometer draws a near constant amount of current then indeed a single resistor CAN be used to drop the 5v to 3.3v needed by that device. Just calculate the resistance needed to drop 1.7 volts at the current draw of the accelerometer.

Lefty
Oh ya, right. :D I'm used to using voltage devider. :)
 
How close to the micro do these decoupling capacitors have to be?
Yes a single resistor in series with accelerometer can drop the voltage down to 3.3V, as that is the measured voltage input my multimeter shows.
What I was getting at, was that light, heat and just about any body mass , even the cat passing by, seems to affect the circuit.
Is this common or is INT_OSC not reliable?

Thanks.
 
  1. 0.1 uf decoupling cap should be as close as possible to the IC
  2. one resistor will only limit current, the diode clamps are limiting voltage.
  3. the internal osc works very well
The PICs are quite robust and very stable when built properly. If you didn't add 0.1uf caps (or any caps across the power terminals) it won't be very reliable.
 
The internal oscillator is reliable. Decoupling capacitor needs to be as close as possible to the Vdd and Vss, I read from the reference book by Myke Predko.
PIC has definately no problem, unless it is broken.
I don't know about accelerometer, maybe there is a problem there?
 
The type of digital input on GP3 wasn't specified. If it's a switch, was a pullup/pulldown resistor used? The symptoms sound like a floating input.
 
I assume you are using an accelerometer like the MMA3202 from Freescale...
You will need to use filtering caps in the analog input lines, as it sounds like a mains supply hum issue.. Even if your circuit is battery powered, you can still induce enough mains hum into the circuit for it to be interpreted as valid data from the accelerometer.

Can you post some details of the accelerometer you are using?
 
Sorry for taking so long to reply.
GP3, has a switch on it, and when GP3 is high, the micro goes into taking readings from a triple axis STMicro accelerometer. A pull up resistor on GP3 input???
Yes it behaves like if a pin is floating, and I will double check this again.
Maybe I will then try, the caps on GP0 and GP1 input, which are analogue.
I hope everything works out.

BTW, when a pin is unused, should I tie it to a land then on ground???
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top