Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

To have or Not to have a diode?

Status
Not open for further replies.

MrDEB

Well-Known Member
Have been tinkering with some older schematics and need to add a dis-ableing light detection section as IR doesn't work in daylight.
Contemplated using photo transistor to ground output of PIR but then battery life may be lessened and it doesn't seem to work.
Installing ADC code to detect state of photo transistor.
Sorry, got off subject. I have been installing a diode in series w/ 22k resistor/Vcc to MCLR
WHY?? have yet to see anyone else do this. Is it nessary.
Have added a diode for battery reversal protection. Thinking of inserting right after power switch.
 

Attachments

  • critter ridder r&#1.PNG
    critter ridder r&#1.PNG
    43.9 KB · Views: 172
Have been tinkering with some older schematics and need to add a dis-ableing light detection section as IR doesn't work in daylight.
Contemplated using photo transistor to ground output of PIR but then battery life may be lessened and it doesn't seem to work.
Installing ADC code to detect state of photo transistor.
Sorry, got off subject. I have been installing a diode in series w/ 22k resistor/Vcc to MCLR
WHY?? have yet to see anyone else do this. Is it nessary.
Have added a diode for battery reversal protection. Thinking of inserting right after power switch.

As already explained, the diode is reverse-biased when Vpp is applied during programming (about 13 V) and protects the Vdd line; I always include that diode when I provide an on-board ICSP connector. Use a Schottky diode, so that high logic level is not degraded too much during normal operation.

As far as reverse protection is concerned, the idea is that the entire circuit would benefit from it. Move the diode right after the switch. C3 should be connected right at the power pins of the microcontroller.
BTW there are better techniques to achive reverse battery protection using a p-MOSFET (high-side) or an n-MOSFET (low-side). Google will provide further information.
 
Last edited:
schematic as of today

triming down parts count
I figure WHY have the on board ICSP port?? but do I still insert the resistor/ddiode in series with MCLR?
 

Attachments

  • no ICSP..PNG
    no ICSP..PNG
    67.5 KB · Views: 129
If in your configuration settings you've chosen the pin as MCLR rather than input you need the pullup resistor. A PIC with a floating MCLR will randomly reset.
 
will leave the resistor and diode in.
Now working on changing the interupt routine from INT1 to INT2
need advice on code change.
Have a post under micro controllers form.
 
I use ICSP all the time, and never used a diode. It's not necessary in most situations. In some situations, it can actually cause problems. For example, if the power is cut off briefly, there's a increased chance it won't reset because MCLR was never discharged thus there's no low-to-high transition on MCLR. And MCLR high level is one Vf diode drop lower than Vdd, which usually works but again depends on your conditions.

The resistor IS still needed, because tying MCLR to Vdd carries a risk of startup problems. Most of the time it'll work, but it's not recommended; just not reliable.
 
triming down parts count
I figure WHY have the on board ICSP port?? but do I still insert the resistor/ddiode in series with MCLR?

If you don't need to (re)program the PIC while it's in the target board, you don't need an ICSP connector.
If your firmware has been well tested and you won't make firmware updates, you can program the uC into an external socket and then move it on the target board (assuming that you're working with through-hole parts).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top