Poweron problems using PIC and automotive application - Page 1
Forum section: electronics / general

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 02:41:07 pm
content: Chaps,The circuit is as shown in the attachment...The processor is a PIC18F8520. It takes Vcc for power (5v) and also the MCLR line from the circuit as atatched.What happens is on the test rig its fine, but sometimes on the car, the MCU doesent come to life, which I believe to be a MCLR issue. Turning the key off and on again (switching off the RAW 12v) will then bring the board back alive. 5v is present on the rail regardless so I know the PSU is coming to life OK, just think something is causing the processor not to boot corrrectlyDoes anyone have any suggestions as to a better MCLR circuit, or a better PSU that would helo solve this issue?Beer tokens via paypal to the winner as I am at my wits end with this one!!CheersMatt

author: PeterG
author_rank: Frequent Contributor
timestamp: July 10, 2012, 02:50:16 pm
content: One thing to keep in mind is that automotive power is one of the noisiest dc power sources out there. I have had issues where there were spikes coming in through the io lines or the voltage reg. If possible look at the 5v rail when the car starts. There may be noise coming in causing the mcu to crash.Regards

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 03:03:35 pm
content: Peter,Thanks I will put the scope on the car tomorrow and see what we get.Did you by any chance come to a decent supply design in the end?Thanks,Matt

author: Short Circuit
author_rank: Frequent Contributor
timestamp: July 10, 2012, 03:06:41 pm
content: Do you have bulk capacitance between VCC and GND? The inductor will filter current transients, but without sufficient capacitance, this means drop in VCC.Also for a transient sensitive environment, it might be better to use a real reset generator instead of a simple RC. The MCLR may not drop below Vil during a short voltage dip.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 03:28:14 pm
content: Short Circuit,I have 100ns scattered about plus one near each of the power pins of the MCU, to help with stabilisation.Its not an issue once the car is running, even with severe noise (we have held the PCB next to the coil pack and noticed induced noise on the trigger lines but its not causing MCU reset.)I think the real problem lies with the MCLR reset on power on not transienting correctly.Can you reccomend a circuit for the reset circuit please? Is there an IC or would a simple bistable with a trabnsisotr do it?RegardsMatt

author: deephaven
author_rank: Frequent Contributor
timestamp: July 10, 2012, 03:38:37 pm
content: PICs don't normally need a capacitor on their MCLR pin as they have a built-in reset timer. I would ditch the capacitor and both diodes, just have a 10K pull up resistor and the programming pin connected straight to MCLR.

author: SeanB
author_rank: Super Contributor
timestamp: July 10, 2012, 04:01:08 pm
content: Turn d4 the other way round. As well add a second inductor on the input to the regulator, before the transient protector. That should help a lot. If you do not want to add the inductor add a series resistor of around 2r2 instead.

author: Short Circuit
author_rank: Frequent Contributor
timestamp: July 10, 2012, 04:10:34 pm
content: Lack of bulk capacitance is an issue with current transients generated by the PIC or other 'internal' circuitry.In addition, it is also very ineffective for keeping shit out, again because of lack of C. SO the filtering effect is minimal.I would start by adding a reasonable low ESR 100uF cap on VCC and probably remove the MCLR stuff per deephavens recommendation.For a reset circuit, check the major IC manuacturers, many many parts available. For testing, just about anything with the right voltage threshold will do.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 04:11:02 pm
content: Quote from: deephaven on July 10, 2012, 03:38:37 pmCould this cause issues with the 13v being back fed into the circuit when programming?

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 04:14:33 pm
content: Thanks everyone for the advice, I will draw up a repropsed PSU and MCLR circuit now, to let you all see what I am thinking, and if it falls into form with all of your helpful suggestions.RegardsMatt

author: deephaven
author_rank: Frequent Contributor
timestamp: July 10, 2012, 04:31:22 pm
content: Quote from: mtechmatt on July 10, 2012, 04:11:02 pmIf you are using MCLR for I/O as well, then yes it could cause possible issues with what else you've attached to it. In that case you would need the diodes.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 04:55:07 pm
content: Hi,No there is no other usage of the MCLR line other than for programming.I have found loads of ICs to do this job on the reset pin for me which will probably simplify things greatly, is the PIC active low(I think it is as I tie to VCC) rather than active high?I am confused to which way round the active goes. The PIC needs 5v on the MCLR line to be 'running'... can someone please clarify?Would this be a suitable device, it appers to put out 5v once the trip of 4.65v has been reached...http://uk.farnell.com/microchip/mcp100t-475i-tt/supervisory-circuit-sot-23-3-100/dp/9758380Cheers,Matt

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 04:58:52 pm
content: after looking at the datasheet, it appears that microchip recommend this device (MCP100) using an active ow, to drive their standard MCLR (which has a line above, meaning inverted, or reset is NOT active when low.)If I am wrong can someone point it out please.... CheersAll very confusing!!

author: Short Circuit
author_rank: Frequent Contributor
timestamp: July 10, 2012, 05:06:58 pm
content: Reset is active when MCLR is low, the PIC is active when reset is not active, so when MCLR is not low.If the MCLR from the PIC is also an output (many CPU reset pins work bidirectional), then you'd want areset device with OpenCollector/OpenDrain output and use the external pullup resistor.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 05:13:34 pm
content: SC,So, I know the PIC is active when MCLR=5v (high)so if my MCP100 is an ACTIVE HIGH type, does this mean its output is HIGH when it is finished, or only HIGH, when its RESET feature is active. Obviously I want the one that outputs 0v when the power first comes on, and after it reaches its threshold, it needs to go HIGH. I think it is the MCP100T as I have chosen in that datasheet, though I really dont want to get it round the wrong way at this pointThanks,Matt

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 05:27:07 pm
content: Ok,So I have had a redesign, and utilised a proper IC for powerup RESET triggering on the MCLR line.Also, I have added some more stuff to the power supply.I have a question:When programming, MCLR is driven to 13v, will this effect the monitor IC? Should I have a diode in there, or a current limiting resistor? Its a microchip part (MCP100) and in their application doc it just links up as shown straight to the MCLR line... are they allowing for programming?

author: SeanB
author_rank: Super Contributor
timestamp: July 10, 2012, 06:26:52 pm
content: Just add a pin header and a shorting link across it, or a wire jumper that can be cut and resoldered if you have to reflash. Once the firmware is working the jumper can be the link in production.

author: mtechmatt
author_rank: Regular Contributor
timestamp: July 10, 2012, 06:52:44 pm
content: Quote from: SeanB on July 10, 2012, 06:26:52 pmGood idea, that removes all of my concerns, I thinkThanks