Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RC circuit added to MCLR pin of PIC18F26K20

Status
Not open for further replies.
T

treez

Guest
Page 52 of the PIC18F26K20 datasheet shows a circuit to add to the MCLR pin.

PIC18F26K20 datasheet
**broken link removed**

We are not using the MCLR pin to reset it, but just for ICSP programming.
The Vdd of the PIC in the circuit is 2V5.
The circuit is going wrong and the boss wants to add a 4k7 resistor and a 10n capacitor to the MCLR pin. (4k7 up to Vdd from MCLR pin and 10n from MCLR pin to ground).
Is adding such a simple RC circuit to the PIC’s MCLR pin a bogus practice?

The MCLR pin is connected to nothing else other than the ICSP connector
 

No need for the capacitor. Just pullup the MCLR pin to VDD or don't even pullup MCLR but disable MCLR in config bits.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
A 10nF capacitor perhaps would not act properly as a delay network, but rather as a filter, it sounds reasonable for me.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
I agree - if the problem is more related to device power up and a slow rising Vdd rail, I would use 100nF or larger for a reasonable time delay functionality.
But, if the problem is possibly EMI/noise getting into the circuit, 10nF may help. 100nF might be good too but depending upon your programming sequence timing may cause issues.
 

But, if the problem is possibly EMI/noise getting into the circuit,
Thanks, it is indeed noise being the suspected problem. We hear that our best option is to Enable the MCLR rest, and then the MCLR pin is tied internally to Vdd. –The problem is tht our ex-microchip apps guy programmer tells us that the internal pullup is very weak and thus there is the possibility of noise tripping the MCLR pin and resetting the microcontroller.
Do you agree with this?
The PIC18F26K20 datasheet doesn’t tell what is the internal pullup resistor (to Vdd) in the MCLR pin, so how would this be known?
 

Considering that you have already confirmed the presence of noise in the system, you could also check the current configuration of the Brown Out Reset fuses, and slightly increase the safety range.
 

Unclear why you insist on enabling MCLR and in return need to place pull-up and possibly filter C.

It's O.K. if you need to provide a hardware reset option. Do you?
 

Unclear why you insist on enabling MCLR and in return need to place pull-up and possibly filter C.
..Thanks, We don’t want the MCLR reset option, and we don’t want to use MCLR as an input. We only need the MCLR pin for the programmer since it’s also the ICSP Vpp pin.
What we also want, is to set up MCLR so that the microcontroller as is little susceptible to noise as possible.
I had set up MCLR as a reset pin even though we didn’t want it for reset…I did this because the PIC18F26K20 datasheet says that when you do this, the MCLR input pin is tied to Vdd internally…and this seems like a low noise susceptibility situation.
However, our software guy told me not to do this. He told me that the connection to Vdd is via a very weak pullup, which could mean noise problems on the MCLR pin.
So the software guy told me to assign MCLR as an input, and then to add a 4k7 to Vdd, and a 10n cap to ground from the MCLR….He told me that this is the least noise susceptible way to set up the MCLR pin of the PIC18F26K20 when you don’t want to use reset or input on the MCLR pin.
Is this true?
 

I don't think the capacitor is a good idea and I would use a higher value than 4.7K.
The reason: the resistor value is almost irrelevant, if you are using internal reset it is only there to prevent static build up. The capacitor will slow the rise of the VPP from the ICSP and could cause failure to program the device properly.
He told me that the connection to Vdd is via a very weak pullup
Nonsense, he is assuming it is a normal input with a weak pull-up current source. It isn't, when internal reset is used it is a logic function, the pin is actually ignored completely.

Brian.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Nonsense, he is assuming it is a normal input with a weak pull-up current source. It isn't, when internal reset is used it is a logic function, the pin is actually ignored completely.
Thanks, supposing we select MCLR as a "external reset". Then presumably there's no chance noise could accidentally reset the pin?
 

If configured for external reset, there is a possibility of noise being picked up just as with any other input Schmitt input pin but bear in mind the reset 'pulse' has to be longer than 2uS and if tied to VDD would be at a voltage low enough that the IC wouldn't run anyway. As long as you don't run long PCB traces from the pin and follow good PCB layout principles there shouldn't be a problem.

If you actually do need a delay on the release of the reset signal there is already a mechanism in the PIC for doing that. Simply enable internal VDD reset and the start-up delay timer. It will ensure the clock has stabilized and then wait ~65mS before letting the program execute.

Don't forget that on all PICs, the reason for a reset is stored in the RCON register so you can see what caused it and maybe recover from an unintentional reset by looking at the appropriate bits.

Brian.
 

I don't think the capacitor is a good idea and I would use a higher value than 4.7K.
The reason: the resistor value is almost irrelevant, if you are using internal reset it is only there to prevent static build up. The capacitor will slow the rise of the VPP from the ICSP and could cause failure to program the device properly.

The software guy insisted on 4k7/10n..but we will consider changing.....

Thanks for the above, to confirm, please state which of the following schematics for ICSP programming of PIC18F26K20 is best, A or B?

PIC18F26K20 datasheet:
**broken link removed**

- - - Updated - - -

BTW, the software guy also told us to have MCLR disabled, so the pin ends up being an input pin, though we are not using it to input anything....(it just ends up being an input due to the way things are with PICs)
 

Attachments

  • ICSP programming schematic for PIC18F26K20.jpg
    ICSP programming schematic for PIC18F26K20.jpg
    104.9 KB · Views: 124
Last edited by a moderator:

'B' would be better as it isolates the capacitor to some extent but if you leave the capacitor out altogether and make the 4.7K higher it will do the same thing. The capacitor serves no purpose unless you are running long tracks to the PIC but it will delay the rise of VPP from the Pickit when you are programming.

Brian.
 

Thanks, we tend to agree, we currently have the 'A' setup, though when we program the board with that capacitor there, we read the program back and we always find the checksum of the read code corresponds to the code we put in.
 

Thanks, we tend to agree, we currently have the 'A' setup, though when we program the board with that capacitor there, we read the program back and we always find the checksum of the read code corresponds to the code we put in.
That's good news but you might find another Pickit3 with a little less VPP 'push' couldn't manage. With internal reset used, your only consideration is to ensure the pin can't float for static protection reasons. Personally, I would configure it as a digital input and use 10K pull-up with no capacitor at all.

Brian.
 

Is adding such a simple RC circuit to the PIC’s MCLR pin a bogus practice?

Not at all.

The RC circuit must have a reasonable time constant; after the PIC is powered on, and after the circuit stabilizes the MCLR must be activated so that the PIC is reset to default state.

No self-initialization is possible in the first few cycles when the power supply voltage has not stabilized.
 

The RC circuit must have a reasonable time constant; after the PIC is powered on, and after the circuit stabilizes the MCLR must be activated so that the PIC is reset to default state.
Under normal circumstances I would agree but the pin is ONLY used for programming the PIC in which case it has to be lifted from VDD to VPP. The reset is internally generated and already has a sanity check and 65mS delay timer before letting the program run. The RC time constant has nothing at all to do with the reset timing but it can slow the rise of VPP during the programming sequence and cause it to fail.

Brian.
 

Under normal circumstances I would agree but the pin is ONLY used for programming the PIC in which case it has to be lifted from VDD to VPP. The reset is internally generated and already has a sanity check and 65mS delay timer before letting the program run. The RC time constant has nothing at all to do with the reset timing but it can slow the rise of VPP during the programming sequence...

Agreed.

If you have disabled MCLR pin in config, then connecting it to Vdd is useless. But Vpp should be connected with a 100E resistor.
 

Thanks, i presume you mean to prevent esd damage to the pin?

Yes, that has been already mentioned in the datasheet (it is actually a monster document) but with the capacitor it also helps a bit in pulse shaping.

But I also know it is very tempting to skip a resistor if it does not appear to do much anyway...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top