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 CCS Technical Support

MCLR_FROM_RUN

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



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

MCLR_FROM_RUN
PostPosted: Fri Mar 23, 2018 3:27 pm     Reply with quote

hello
I am working on a robot controller card which have main 18f2520 and 12f629.

Because of robot unfit chassis in some certain maneuvers robot make drifts and this cause 18f2520 have reset MCLR_FROM_RUN (12f629 never resets).

So what exactly MCLR_FROM_RUN is and how can i suppress it ?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Mar 23, 2018 6:52 pm     Reply with quote

This thread talks about the problem and has some solutions:
http://www.ccsinfo.com/forum/viewtopic.php?t=56109
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Wed Mar 28, 2018 8:52 am     Reply with quote



Is there any difference about placing the 100nf or is it best to solder directly to power pins?
temtronic



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

View user's profile Send private message

PostPosted: Wed Mar 28, 2018 9:51 am     Reply with quote

OK, I'm 'old school' but I'd never,ever put components UNDER a PIC or other device as shown in your "B" or right side version.

Murphy's Law of Black Smoke says that component , under the PIC WILL fail.

Jay
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Wed Mar 28, 2018 10:01 am     Reply with quote

OK
beside your point what i want to ask is electrically which one is correct

B regulator --> bypass cap --> power pins
A regulator --> power pins --> bypass cap

is there any difference?

edit note: A and B corrected according to the image


Last edited by luckyluke on Wed Mar 28, 2018 11:49 am; edited 1 time in total
Josep Robert



Joined: 27 Mar 2018
Posts: 25

View user's profile Send private message

PostPosted: Wed Mar 28, 2018 10:54 am     Reply with quote

Very well explained here:
https://electronics.stackexchange.com/questions/74509/how-to-place-decoupling-capacitor-in-four-layer-pcb

Josep Robert
temtronic



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

View user's profile Send private message

PostPosted: Wed Mar 28, 2018 11:14 am     Reply with quote

Yes, though how significant depends upon a lot of things.
A does allow 'bad' energy to enter the PIC.
B allows the capacitor to absorb the 'bad' energy BEFORE it enters the PIC.
So B would be the better choice.
Usually the manufacturer of the devices will show suggested PCB layouts for bypass caps as well as xtal/cap configurations.
What is also important is in using the correct TYPE and value for the capacitor(s). Again, the mfr will inform you of the type/value, sometimes even telling you a specific device to use.


Just noticed, when I mean B, I refer to the drawing NOT your 2nd post.

So in your text power pins-cap-PIC (a).
Jay
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Mar 29, 2018 5:07 am     Reply with quote

temtronic wrote:
A does allow 'bad' energy to enter the PIC.
B allows the capacitor to absorb the 'bad' energy BEFORE it enters the PIC.


That's the old way of thinking about it. These days its generally much more a matter of EMI than EMC, in other words of preventing the 'bad' energy FROM the PIC affecting other things. I'm still plumping for B, however.

At PIC speeds, which by the standards of much of today's digital circuitry is almost glacial, it doesn't make much difference. I have to use both in the layouts of my circuits (I don't layout PCBs myself, I have to give it to someone else who does it with my guidance only for tricky stuff) and have, touch wood, never yet had a problem. Bear in mind my PICs often go in RF amplifers operating at up to 8GHz, where spurious signals, e.g. PIC/digital/PSU switching noise would cause big problems.

The choice of capacitor is generally much more of a concern. I also ensure we use meatier tracks than normal for all power traces, and there is nearly always a buried ground plane and generally a power plane as well with significant inter-plane capacitance acting as distributed decoupling. Such a layout, with SMT parts cannot avoid vias however, and often the decoupling cap ends up on the other side of the PCB to the PIC, but that tends to give shorter traces to the PIC pins - it is a matter of practicality trumping theoretical perfection.
temtronic



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

View user's profile Send private message

PostPosted: Thu Mar 29, 2018 5:47 am     Reply with quote

re: That's the old way of thinking about it. Yeah, well I get to collect the guv pension 2 months from now when I turn 65, so , OK...I'm old.....
When I designed Optical Emission Spectrometer Data Acqusition PCBs the ground planes were a 'checkerboard' of traces not a 'flooded' or solid copper. Never had a problem with RF doing that.
I do like 'fat' traces whenever possible,then again I was a 'tape and donut' guy..that was 1/2 a lifetime ago, sigh....
Putting parts under PICs just ain't 'right' to me though.....

Jay
Smile
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Mar 29, 2018 6:39 am     Reply with quote

temtronic wrote:

Putting parts under PICs just ain't 'right' to me though.....


I'm "only" in my mid to late fifties... With DIP/DIL I totally agree. putting parts under them is often not great. WIth SMD however, well, that's half the point: parts only require one side of a PCB and therefore the other is also available for parts. Well, a few in most cases as its still advisable for production reasons to put most parts on one side, but things like decoupling caps can easily go on the "back" of the board.

Personally, I've not dealt with DIL devices at all in the last twenty years, everything I've done is SMT. I am not a hobbist anymore, going totally pro decades ago. I do other things, like photography (animals, especially big cats, are my main thing) for fun. I used to do historic reenactment but recently I've got into restoring pre-1960 GPO telephones such as this, my very rare type 82 fro 1920: https://www.flickr.com/photos/94731913@N03/40181975314/ For them, my main tool is often a box spanner.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Thu Mar 29, 2018 12:04 pm     Reply with quote

I've been forwards, then back, then forwards again.

Did projects more than 30 years ago, which were all surface mount, padless via's, but were still being drawn with tape and pads. There was a new PCB package at the time called 'Vutrax', but it had limited board size capabilities.
Then had to start designing for stuff that could be field serviced, so switched back to using a lot of through-hole parts.
Then because fewer and fewer parts are available in through-hole, the sheer packing density possible with SMD, and costs have become so low that the engineers can carry complete boards, so went back to SMD again...

Now on the examples being posted, the big thing is to make the power tracks thicker. If power planes can't be used, thicker tracks, and critically (not shown), where they go back to, and how they route relative to other tracks carrying power. The routes could also be straightened with smoother corners.
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 5:34 am     Reply with quote

Thanks for opinions.

In case of somebody have same problem i have solved it with a diode between Vpp and 5V.

I was making hobby circuits with lcd,l ed and some sensors. It was easy work with them.
Problem started after i used some motors. I made a lot of development on pcb design with the great help of Ttelmah.
I added power planes, tvs, zener, inductor then i add LC filter, two battery. I even tried with LF series pic in order to avoid brownout. I doubled drivers, solder 1000uf direct to power pins, 100 nf to power pins but resetting was always there.
No matter what i did, resetting problem always came back. When there was nothing to change, i changed my point of view.

My first idea was pic not resetting. It was going in programming mode and with no incoming data, program start from begin.
it sounds ridiculous to me but trying a diode to icsp pins was very easy compared to other changes.

i connect a diode Vpp--->|---5v and it was fantastic!! solved the problem immediately. In my case fast diodes shows better results.
Ttelmah



Joined: 11 Mar 2010
Posts: 19535

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 6:10 am     Reply with quote

That implies you are getting RF pickup on the Vpp pin. Question what circuit you have on the pin?. Obviously a diode won't work if you ave any form of reset circuit. If it wasn't connected, then 'asking for trouble'...
Glad you have found a solution. Smile
luckyluke



Joined: 18 Apr 2006
Posts: 45

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 6:26 am     Reply with quote

There was only a 10K pullup resistor on MCLR now there are diode and 10K.
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 7:09 am     Reply with quote

If the MCLR pin has an extended trace to a programming header then a small capacitance of 100pF or so can be placed to ground along with the 10k pullup to Vcc. This will aid in the rejection of noise that could cause an unintended reset and still allow proper programming.
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