View previous topic :: View next topic |
Author |
Message |
doguhanpala
Joined: 05 Oct 2016 Posts: 120
|
18f4550 voltage change on/off |
Posted: Thu Oct 26, 2017 1:39 am |
|
|
Hello
I use 18f4550 on my pcb. The problem is when i turn it off and on really quick, sometimes it does not do the hex. I am assuming the ic cannot close itself in the short period of time.
I use lm2940 as voltage regulator with 22uF and 470 nF capacitor. I am adding the circuit.
https://hizliresim.com/WGGV0Y
I am not sure what is the case. If my guess is true what can you suggest to remove this situation ?
Note: My board uses usb and battery voltage. I have a switch that chooses usb or battery. My circuit is this:
https://hizliresim.com/V33l3Z
I tried soldering a 10k pulldown from 5V to gnd. It did not work. What should i use to fix this problem ? Can you suggest anything ?
Thank you so much! |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Oct 26, 2017 5:10 am |
|
|
hardware..
I'd have bigger caps on the power supply,so add a 100mfd to both sides of the regulator. Also be sure to add a .01 or .1 ceramic at the PIC power pins. Also be sure the correct cap is on the Vusb pin(or whatever it's called). I no longer use that PIC but recall a unique pin needed a cap on it!
software..
have you got the PUT fuse enable? Power Up Timer allows the PIC to 'slowly' power up and get organized before it executes the program. |
|
|
doguhanpala
Joined: 05 Oct 2016 Posts: 120
|
|
Posted: Thu Oct 26, 2017 5:16 am |
|
|
temtronic wrote: | hardware..
I'd have bigger caps on the power supply,so add a 100mfd to both sides of the regulator. Also be sure to add a .01 or .1 ceramic at the PIC power pins. Also be sure the correct cap is on the Vusb pin(or whatever it's called). I no longer use that PIC but recall a unique pin needed a cap on it!
software..
have you got the PUT fuse enable? Power Up Timer allows the PIC to 'slowly' power up and get organized before it executes the program. |
Thank you temtronic.
I have 470nF cap on Vusb.
For now i added a 470uF decoupling cap from 5v to gnd. it solved my problem.
I know its silly but, in order to prevent any misunderstanings i have to ask: About .1 or .01. you did mean uF right?
edit: i wrote 100nF. i meant 470 nF on Vusb |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Thu Oct 26, 2017 6:13 am |
|
|
doguhanpala wrote: | i know its silly but, in order to prevent any misunderstanings i have to ask. about .1 or .01. yu did mean uF right? |
Correct.
Last edited by newguy on Thu Oct 26, 2017 8:45 am; edited 1 time in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Thu Oct 26, 2017 8:00 am |
|
|
yes, .01 mfd.
When designing power supplies I always make them 5 to 10 times larger in current capacity.
Say you think you need 1/2 amp.... I'd build a 2.5 to 5 amp supply. While it may seem excessive, most forget about th 'huge' current draw of relays, LEDs, even a PIC coming out of sleep or idle mode. while the demand is short in time, the energy needed can be quite high.
Also 'off the shelf' power supplies may NOT supply the rated VDD at the rated current output, at least for long... always best to bench test 24-48 hours and measure them !
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19497
|
|
Posted: Thu Oct 26, 2017 10:29 am |
|
|
As a comment, he should have BROWNOUT and BORV45 if running USB.
The PIC core itself can run down to only a few volts, but the USB peripheral can't work below 4.2v. The 4.1v brownout option has an erratum on this chip, so the only one that guarantees to reset the chip if the voltage dips to the point where the USB can hang, is this one. If he gets a dip into this range, without the brownout, the code can actually still be running, but with the peripheral hung...
On the Vusb capacitor, this needs to be a type with quite good HF performance. They recommend polyester. It's 'fussier' on this chip than on many of the later chips.
On supplies, it is vital to understand the difference between resistive power ratings, and those into inductive/capacitive/variable loads. A supply rated to deliver 0.5A, may have great problems starting up an electronic circuit that on paper only draws 0.2A. Problem is that the circuit may well have momentary spikes in it's load as it starts, will have capacitive and possibly inductive components, and may well have minimum rise time specifications for several different parts.... |
|
|
|