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

Microcontroller reset - Causes

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



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

Microcontroller reset - Causes
PostPosted: Mon Sep 29, 2014 12:44 am     Reply with quote

Hi all,

I have a project built with 18F2550. It is working well with a 12V 1A SMPS but when i turn on or off a exhaust fan near by the microcontroller resets itself.

I do have a 0.1uF across VDD GND on top of pic and have a DS1232 connected to pin.1 of microcontroller.

Also have a 5V regulator and 0.33uF and 0.1uF cap on in and out
with a 1000uF cap on the input.

I have tried with a little more expensive 12V - 2A smps and i have no problems with that.

Could this be a proper grounding issue.?

I appreciate and thanks for any help.

Regards,
Jai.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 2:22 am     Reply with quote

Realistically, this is a general electronic question, not a CCS question.

A search here will find a number of general answers, but a general electronics forum will give more help.

Are you saying that with the 2A SMPS, the unit does not reset?.
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 2:54 am     Reply with quote

The max current drawn by the circuit from the smps is 250mA regardless of whether 1A smps or 2A.

But they both have quality difference.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 3:02 am     Reply with quote

You still have not answered the question....

For the same load, the larger supply will have a higher 'hold up' time (how long it can maintain it's output when the incoming rail droops.
Also it may well have a higher range of acceptable input voltages over which it can maintain it's output. Look at the specifications for both. You may well find the 2A unit, has something like 90-250v input range (auto adjustment to support 110v operation), while the cheaper supply doesn't have such a wide range. If so, you have your answer.
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 4:08 am     Reply with quote

The thing is now the trouble is on both smps.
especially when i am communicating via usb. when i turn on and off the
fan which is connected to same mains as the computer and the project, the usb comm is interrupted.

I also tried to ground the USB connector and the 5V regulator gnd to mains GND
still the problem persists.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 4:31 am     Reply with quote

OK.
So you now have a classic noise problem.

As I already said, you need to go to a general forum.

'How' you ground things, is as important as the ground itself.
Single lines/planes back to a common ground point.
You may well need to use a USB cable with noise filtering in the cable.
If your PIC has a ground, and you are also grounded via the PC/USB, then you have generated a ground loop.

Look at:
<http://www.edn.com/electronics-blogs/isolate-me-/4405211/Breaking-ground-loops-to-protect-USB-data-transmission>

Look particularly at the third paragraph.

USB, is _not_ directly designed for use in high noise environments.
temtronic



Joined: 01 Jul 2010
Posts: 9205
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 5:16 am     Reply with quote

A quick and easy test to do, run the project off batteries and see what happens.If the PIC resets when the exhaust fan is turned off then the noise is airborne .Though could also be in the power lines.
The reason for the test is you have to know where the noise is coming from before you can stop it.
Typical noise suppression includes ferrite beads,MOVs,caps,metal enclosures,proper grounding,chokes,etc. What you use depends on the type of noise.
Perhaps you can 'trap' the cause of the reset? Most newer PICs have several bits that get set depending on the cause.That may help?

I do know that a PIC in a good steel box, on a 'soild' PCB, well 'filtered' can work 24/7 for decades in a shop FULL of industrial welding rigs!

jay
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 5:31 am     Reply with quote

Thanks Ttelmah and temtronic.

I finally was able to solve it like this.

I removed the ground connection of project to Mains ground.

Added capacitor of 0.047uF and 0.33uF across the mains connection
of SMPS.

I know this has removed the surge noise that was created.
But it would be helpful if someone can explain why this did help.

Thanks
Jai.
oxo



Joined: 13 Nov 2012
Posts: 219
Location: France

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 7:46 am     Reply with quote

jaikumar wrote:
Thanks Ttelmah and temtronic.

I finally was able to solve it like this.

I removed the ground connection of project to Mains ground.

Added capacitor of 0.047uF and 0.33uF across the mains connection
of SMPS.

I know this has removed the surge noise that was created.
But it would be helpful if someone can explain why this did help.

Thanks
Jai.


Google "Earth Loop"
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Mon Sep 29, 2014 7:50 am     Reply with quote

Exactly.

As I said:

"If your PIC has a ground, and you are also grounded via the PC/USB, then you have generated a ground loop."

ground==earth (electrically....).

Question now is whether this is safe?.
jaikumar



Joined: 15 Dec 2006
Posts: 109

View user's profile Send private message

PostPosted: Tue Sep 30, 2014 3:30 am     Reply with quote

For others who are in the same boat,

http://en.wikipedia.org/wiki/Ground_loop_%28electricity%29

Explains very well.

Once again thanks to Ttelmah, temtronic and oxo.

Also would like to know whether DC regulator ground should be grounded
to MAINS grounding.

Sometimes circuit does not work under noisy condition without grounding.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Sep 30, 2014 5:11 am     Reply with quote

Your problem is not related to the CCS compiler nor to the PIC processor. Here on this forum an occasional related question is allowed but your current questions are so specific electronics that you really have to move to a specialized electronics forum. For example have a look at edaboard.com
This has already been suggested a few times...

Good luck.
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