View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Wed Jan 11, 2023 8:16 am |
|
|
curious...
would enabling the 'PUT', Power Up Timer help ?? |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Wed Jan 11, 2023 8:49 am |
|
|
I tried the code above. It didn't work.[url]
http://ww1.microchip.com/downloads/en/DeviceDoc/70138b.pdf[/url]
on page 141 at this link
FIGURE 20-6: EXTERNAL POWER-ON RESET CIRCUIT
(FOR SLOW VDD POWER-UP)
I think you are talking about setting up the circuit in this way.
I couldn't see the component values.
R1:330ohm
R:10K
A:10nf
Diode: Is it ok if I use BAT43? _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Wed Jan 11, 2023 9:05 am |
|
|
Your RC combination gives a time constant of 100us. Given Ttelmah's anecdote:
Quote: | I think it requires a
rise time to 5v that is less than 0.1sec. If you go over this the internal
reset circuit won't work properly. |
...That implies that your power supply is taking more than 100ms to rise. You, therefore, must select component values that ensure that 5 * tau (time constant) must be > 100ms which will allow your Vdd to stabilize before the external RC allows /MCLR to rise which in turn allows the processor to start running.
One word of caution: most programmers tend to "dislike" such circuits on /MCLR (in my experience anyway). |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Wed Jan 11, 2023 9:06 am |
|
|
No, as you have already found PUT won't help. That allows time for the
oscillator to stabilise _after_ the chip starts. The problem is the internal
reset circuit is dependant for it's operation on the rise time of the supply.
If that's the old standard PIC reset circuit, then you have to choose the
resistance and capacitance to suit your PIC and supply. However I'd use
something smarter like an MCP909, MAX810 etc.. These all give a
guaranteed pulse duration after the supply reaches the required voltage.
Why not just improve the supply rise time?. This is almost certainly a
sign that you have more capacitance on the output of the regulator than
is optimal. Having this can easily damage the regulator when the supply
goes off, so better to fix it. |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Wed Jan 11, 2023 9:27 am |
|
|
"Why not just improve the supply rise time?" What exactly do you want to say here? What does it mean to improve the supply increase time?
And another piece of information is that when I did PUT64, there was an improvement. Better now than before. But Ttelmah I agree. I need to improve the external reset circuit. But I should be able to do this with the MCLR circuit, not the MCP909 with this kind of integrated. Can you help with this?
Newguy, what formula did you use to calculate this time? _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1909
|
|
Posted: Wed Jan 11, 2023 10:16 am |
|
|
tau = RC
10nF and 10k gives 100us. Elementary electrical circuit theory. |
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Wed Jan 11, 2023 1:34 pm |
|
|
then if I install 10uf and 10K instead of 10nf;
tau = 10Kx 10us = 100ms. I can do it this way. Why does he suggest using diodes? Do I need to use diodes?
Would it be BAT43? _________________ Best Regards...
MCUprogrammer
_______________________________
Work Hard |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19540
|
|
Posted: Wed Jan 11, 2023 11:09 pm |
|
|
Two things apply.
First, the capacitor needs to be quickly discharged when the supply goes
off. Second, the MCLR line is taken high during programming.
Hence diode needed. |
|
|
|