Electronics > Electronics

Need quick PIC help

(1/3) > >>

I'm trying to run a dsPIC but in testing.  The code seems to freeze after like a quarter of a second.  Playing with capacitors across the power supply seems to do something...I don't know what though, cause bigger capacitors don't mean flawless running.

I'm using a dsPIC30F3012
using a regulated power supply
internal FRC oscillator at full speed with 16x PLL (speed is needed)
no MRCL (since the chip can't be reprogrammed with MRCL and internal oscillator

Any advice?


so when you power cycle it, it will work again for a 'quarter of a second', right?

out of curiousity, where do you have the capacitor? it sounds like it is in series with your power. after the capacitor charges up over say a 'quater of a second', the current flow stops and your PIC would stop working . . . if this is the case, the capacitor should connect power and ground pins only.

yeah, when I power cycle, it only works a moment again, but the capacitor is in parallel, not in series.  ie one lead on the Vss pin and one one the Vdd.

hmmmm this is a tough one . . .

remove the capacitor and see if you still have the problem or not (this will rule out the capacitor being the problem)

what is the PIC being programmed to do? what components do you have attached to it?

there is a possibility that you just made an error in a program loop that doesnt do what you meant it to do. program the PIC to just emit a simple square wave to a pin (and nothing else) and measure the pin with an oscope. if you dont have an oscope, try and pulse a pin high low high every second and measure that with a multimeter (might not work if PIC stops working before then). this will give you a good idea of exactly how long it works till failure, and verifies that your code isnt the problem.

just for others to reference, this is the dsPIC30F3012 datasheet

Ugh, it just keeps getting worse.  I took out a lot of the code to make things cleaner.  Now the problem seems to have changed a bit.  It's now a fairly simple program...an SOIC dsPIC30F3012 with just a blinking light. 

Scenarios that work:
1)Right after programming, the light starts blinking automatically

2)if I attach 5V to the voltage regulator (which regulates to 5V) it works right away

Scenarios that don't work/don't work well:

1)If I put anything above 7V onto the regulator it doesn't work
2)if I put a 0.33uF capacitor with 7V it takes like 5 seconds to start
3)if I put a 220uF capacitor with 7V it takes like 4.5 seconds to start
4)if I put any capacitor with >8V it doens't seem to start at all >:( ???


[0] Message Index

[#] Next page

Go to full version