CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

18f4550 voltage change on/off

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
doguhanpala



Joined: 05 Oct 2016
Posts: 94

View user's profile Send private message

18f4550 voltage change on/off
PostPosted: Thu Oct 26, 2017 1:39 am     Reply with quote

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: 6219
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 5:10 am     Reply with quote

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: 94

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 5:16 am     Reply with quote

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: 1505
Location: Edmonton, Alberta

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 6:13 am     Reply with quote

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: 6219
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 8:00 am     Reply with quote

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: 13389

View user's profile Send private message

PostPosted: Thu Oct 26, 2017 10:29 am     Reply with quote

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....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group