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.

PIC dropouts

Status
Not open for further replies.

pike

Member
heya guys, i've just started writing the code for my digital clock.

I'm constructing my circuit on this board:
**broken link removed**

So far i've been experiencing dropouts where the output pins just dropout. the oscillator is rock solid at 4 mhz so it has to be something internally going whacko.I know it wont be my coding as i have simulated it multiple times in PIC simulator (oshonsoft).

All of the unused input/output pins are connected to anything, should they be pulled to ground if they are being used???
just what could be causing these problems??? :?
 
A few ideas:

-poorly regulated power coming into the board?
solution: add capacitors.

-maybe the outputs are pulling to much current for batteries to handle? maybe the batteries are low and weak..
solution: try a different power supply.

-maybe the pic is bad? some static shock might be making things go a bit haywire...
solution: try a different pic.

It might also be something with your overall circuit design, such as you may need to pullup/pulldown resistors depending on the outputs, or something similar to that. You could also be sourcing/sinking to much current for the PIC to handle.


Also, unused pins can generally be left floating, and should be left as inputs. If the pins are left as inputs, then there is no chance they randomly output a weird signal that could mess up the entire circuit.
 
plot said:
Also, unused pins can generally be left floating, and should be left as inputs. If the pins are left as inputs, then there is no chance they randomly output a weird signal that could mess up the entire circuit.

There are always plenty of arguments about what you should do with unused I/O - if you leave them as inputs they have the possibility of floating to the transistion region (between high and low) and causing huge current increases to the PIC.

But generally PIC's are VERY forgiving, personally I don't pay any extra attention to any spare pins - simply ignoring them.

As for the code been correct because it simulates OK?, it's a simulator - not the real world! - there's no guarantee that simulated code will work correctly in the real world. It's a well established fact that code that runs perfectly on UV eraseable devices doesn't always work when transferred to an identical OTP chip! - although the reasons for that are well documented.
 
1. Make sure you have a ceramic cap between Vdd/Vss, right at the pins.
2. Make sure you have the right pullup resistor on MCLR.
3. Declare unused pins as output. This is also a helpful ESD protection.

Make sure you either have the WDT turned off or you are clearing the timer regularly. Make sure your simulator has it set the same way, and look to see if the way your hardware responds to external inputs won't lead it to go too long without clearing WDT.
 
OMG it worked now after reading that MCLR thing posted by Oznog. Thanks a bunch mate. If you lived in Sydney i'd send you my dads Jonnie Walker :lol: .

Damn, i feel stupid now :x . But atleast it works :D

Thanks ALOT, Oznog.
 
pike said:
OMG it worked now after reading that MCLR thing posted by Oznog. Thanks a bunch mate. If you lived in Sydney i'd send you my dads Jonnie Walker :lol: .

Damn, i feel stupid now :x . But atleast it works :D

Thanks ALOT, Oznog.

Had you left MCLR floating?, I usually just connect it to Vdd, there's no need for a resistor with PIC's - unless you want to add a reset switch, or external brownout circuit. However, most of my tutorials use the F628, with this you can select internal MCLR connection to Vdd and use the MCLR pin as an extra I/O pin (as my tutorials do).

It's the silly things that trip you up 8)
 
I waste so much time sorting out stupid things I do with pics, that I,m looking for a custom made knee spanner, so's I can rotate a knee through 180 degrees and kick my own arse across the workshop :oops:
 
the thing about uC's... is they only begin to work smoothly with practice and experience. otherwise you always miss the small things that you either didn't know about or glanced over...


i guess that can be said for most things, but uC's are particularly unforgiving.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top