Author Topic: Poweron problems using PIC and automotive application  (Read 5250 times)

0 Members and 1 Guest are viewing this topic.

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Poweron problems using PIC and automotive application
« on: July 10, 2012, 02:41:07 pm »
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 corrrectly

Does 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!!

Cheers
Matt
 

Offline PeterG

  • Frequent Contributor
  • **
  • Posts: 819
  • Country: au
Re: Poweron problems using PIC and automotive application
« Reply #1 on: July 10, 2012, 02:50:16 pm »
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
Testing one two three...
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #2 on: July 10, 2012, 03:03:35 pm »
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
 

Offline Short Circuit

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: nl
Re: Poweron problems using PIC and automotive application
« Reply #3 on: July 10, 2012, 03:06:41 pm »
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.
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #4 on: July 10, 2012, 03:28:14 pm »
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?

Regards
Matt
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 792
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: Poweron problems using PIC and automotive application
« Reply #5 on: July 10, 2012, 03:38:37 pm »
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.
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15841
  • Country: za
Re: Poweron problems using PIC and automotive application
« Reply #6 on: July 10, 2012, 04:01:08 pm »
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.
 

Offline Short Circuit

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: nl
Re: Poweron problems using PIC and automotive application
« Reply #7 on: July 10, 2012, 04:10:34 pm »
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.
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #8 on: July 10, 2012, 04:11:02 pm »
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.

Could this cause issues with the 13v being back fed into the circuit when programming?
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #9 on: July 10, 2012, 04:14:33 pm »
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.

Regards
Matt
 

Offline deephaven

  • Frequent Contributor
  • **
  • Posts: 792
  • Country: gb
  • Civilization is just one big bootstrap
    • Deephaven Ltd
Re: Poweron problems using PIC and automotive application
« Reply #10 on: July 10, 2012, 04:31:22 pm »
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.

Could this cause issues with the 13v being back fed into the circuit when programming?

If 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.
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #11 on: July 10, 2012, 04:55:07 pm »
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/9758380

Cheers,
Matt

 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #12 on: July 10, 2012, 04:58:52 pm »
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.... Cheers

All very confusing!! :)
 

Offline Short Circuit

  • Frequent Contributor
  • **
  • Posts: 439
  • Country: nl
Re: Poweron problems using PIC and automotive application
« Reply #13 on: July 10, 2012, 05:06:58 pm »
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 a
reset device with OpenCollector/OpenDrain output and use the external pullup resistor.
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #14 on: July 10, 2012, 05:13:34 pm »
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 point :)

Thanks,
Matt
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #15 on: July 10, 2012, 05:27:07 pm »
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?
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 15841
  • Country: za
Re: Poweron problems using PIC and automotive application
« Reply #16 on: July 10, 2012, 06:26:52 pm »
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.
 

Offline mtechmatt

  • Regular Contributor
  • *
  • Posts: 61
Re: Poweron problems using PIC and automotive application
« Reply #17 on: July 10, 2012, 06:52:44 pm »
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.

Good idea, that removes all of my concerns, I think :)
Thanks
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf