• AVR Freaks

Hot!What happens if you put MCLR above VDD but below minimum VPP?

Author
HungryBadger
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2018/11/10 06:23:47
  • Location: United Kingdom
  • Status: offline
2021/03/01 12:01:49 (permalink)
0

What happens if you put MCLR above VDD but below minimum VPP?

Hopefully this is the right place for this?
 
I have a project being powered from a LIR2032 cell (say 3.0V - 4.2V) which is then stepped down to 2.5V for the rest of the system (2.5V is the PIC's VDD). The PIC in question is the 16LF18344 (datasheet here). I'm using the otherwise unconnected LVP pin of the PICKIT 3 interface (6-pin header) to connect a CC/CV charger, that I've designed, to the cell in order to charge it. The only disadvantage of this is that I could plug this system into the charger either way round (either the correct 'charging' pin or the MCLR/VPP pin could be connected to the 4.2V charger output). For context, I intend to program the device when it is NOT connected to the charger so the PICKIT 3 will be able to dish out all the correct signals as normal.
 
The attachment should give a better idea of what I mean.
 
P.S. MCLR/VPP is tied to VDD via a 10k pull-up on the device side, so that's covered as well.
 
 
So my question: By sticking the charge voltage (4.2V) onto the MCLR line, what would happen?
 
My assumption is nothing. MCLR is not (as far as I know) connected to VDD through ESD protection diodes as that would interfere with high-voltage programming - I assume this means no chance of latch-up and/or excessive current. 4.2V is also a long way off from the minimum VPP voltage spec (7.9V) so I can't imagine I'd be in danger of accidentally entering programming mode?
 
Feel free to educate me as this is probably all pretty naive of me.
 
Also, I know there are better design solutions such as a keyed connector or polarity switching circuitry etc. etc. but I'm not asking for better design solutions, I already know they exist.
 
Regards,
Adam

Attached Image(s)

#1

9 Replies Related Threads

    HungryBadger
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2018/11/10 06:23:47
    • Location: United Kingdom
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/01 16:23:24 (permalink)
    0
    HungryBadger 
    So my question: By sticking the charge voltage (4.2V) onto the MCLR line, what would happen?

     
    So I've done some testing on a 'standard' 16F part (the 16F15313) and observed that an overvoltage condition of about VDD + 1V triggers a reset condition identical to as if one was shorting the pin to ground. This condition appeared to release at about VDD + 0.8V. This was measured by connecting a 10k potentiometer across the 4.2V rail and connecting the wiper directly to the MCLR pin, the resulting voltage being measured with a standard multimeter.
     
    This value seems suspiciously close to that of a diode drop; however, there was no significant current draw whatsoever.
    • MCLR @ 0V (standard reset): 89uA sourced by pin
    • MCLR @ 3.5V (VDD + 1V): 62uA sunk by pin
    • MCLR @ 4.2V (VDD + 1.7V): 68uA sunk by pin
    Do these findings mean that I'm actually entering programming mode (device has low voltage programming currently enabled via the config bits though)? Also, would the lack of internal voltage regulator on an LF part have any impact? Unfortunately I don't have an LF part to hand to test this with.
    #2
    ric
    Super Member
    • Total Posts : 30244
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/01 16:39:11 (permalink)
    +2 (2)
    HungryBadger
    Do these findings mean that I'm actually entering programming mode

    Maybe, or it might really just be triggering an MCLR reset.
    Overvoltage on some pins has been known to trigger a Brown Out Reset in other devices.

    (device has low voltage programming currently enabled via the config bits though)?

    High voltage mode is  always active, you cannot disable it.
    The LVP setting should have no effect on this behaviour.
     

    Also, would the lack of internal voltage regulator on an LF part have any impact? Unfortunately I don't have an LF part to hand to test this with.

    Sorry, no idea.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    RISC
    Super Member
    • Total Posts : 6067
    • Reward points : 0
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/01 17:00:02 (permalink)
    +2 (2)
    Hi,
    MCLR pin is meant under any Vdd condition to allow up to 9.0V on both F and LF parts (look at table 35.1).
    In the Programming Specification MCLR min is 8.0V to enter Program/verify mode so below that you should be ok...
    but do some testing ;=)
    Regards

    For support make sure to check first here : http://microchipdeveloper.com
    There are hundreds of PIC, AVR, SAM...which one do YOU use ?
    #4
    Mysil
    Super Member
    • Total Posts : 4130
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: online
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/01 19:48:41 (permalink)
    +1 (1)
    Hi,
    Minimum VPP is the lowest voltage where Programming mode is guaranteed to be entered.
    So to fulfill this, programming mode reset is actually entered at some unspecified voltage
    between Vdd and Vpp min.  Vdd + 1V, as observed in message #2 seem reasonable.
    To get fully into programming mode, and erase or program the chip, there is additional signaling required on PGC and PGD pins.
     
        Mysil
    post edited by Mysil - 2021/03/01 19:49:53
    #5
    HungryBadger
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2018/11/10 06:23:47
    • Location: United Kingdom
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/02 08:49:07 (permalink)
    +1 (1)
    ric
    Overvoltage on some pins has been known to trigger a Brown Out Reset in other devices.

     
    This could be happening, but I'm more inclined (based purely on the evidence presented here) to believe Mysil's response:
     
    Mysil
    programming mode reset is actually entered at some unspecified voltage between Vdd and Vpp min.

     
    This is because I also disabled BOR for test purposes (my standard 'quick setup' is to disable anything that could cause a reset outside of my explicit control).
     
    The comments made by RISC and Mysil give me hope that I'm not about to brick my part anytime soon which is always a plus.
     
     
    #6
    NorthGuy
    Super Member
    • Total Posts : 6589
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/02 17:21:34 (permalink)
    +1 (1)
    In my experience, most modern PICs enter HVP mode way below the stated Vpp.
     
    #7
    HungryBadger
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2018/11/10 06:23:47
    • Location: United Kingdom
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/03 05:31:39 (permalink)
    0
    NorthGuy
    In my experience, most modern PICs enter HVP mode way below the stated VPP.

     
    Annoying as it is, my tests would appear to back this up. Just now I built up a transistor buffer (see the attached schematic) and ran the following tests:
     
    NOTE: PIC VDD was at 2.5V, and was NOT supplied by the PICKIT3. Oldskool HVP was enabled for this.
    1. PICKIT3 MCLR tied to PIC MCLR and buffer input; buffer output left floating. Buffer output and PIC MCLR scoped to check waveforms were similar (they were). This, obviously, programmed the PIC fine.
    2. PICKIT3 MCLR tied to buffer input only; buffer output connected to PIC MCLR. This also worked fine, the voltage level coming out of the buffer was set to 0V for a logic '0' and 8.5V (approximately the high VPP) for a logic '1'. This also programmed the PIC fine.
    3. As with [2] but with the buffer output swinging from 0V to 4.2V. This, to my surprise, also programmed the PIC successfully.
    4. As with [2] but with the buffer output swinging between 0V and 3.5V (the minimum voltage presented at MCLR required to 'reset' the PIC whilst it's running). EDIT: Yet again, the PIC programmed successfully.
    In the attached 'scope screenshots, channel A is always connected to PICKIT MCLR, and channel B always to the buffer output. A simple 10Hz blinky was the program for testing whether or not the chip was 1) running 2) programmed successfully.
     
    So, I conclude that, from test [4], the 'reset' I was hoping for, is actually just the PIC entering programming mode. What would be interesting is to see if this 'VDD + 1V' threshold is a hard limit across the full VDD range, or whether it's ratiometric? Clearly, it's not an absolute threshold for the datasheet specs, as otherwise, I wouldn't have been able to program it with a VPP of 3.5V!
     
    Still haven't been able to test an LF part though...
    post edited by HungryBadger - 2021/03/03 07:01:37

    Attached Image(s)

    #8
    blue_led
    New Users
    • Total Posts : 146
    • Reward points : 0
    • Status: online
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/03 07:19:28 (permalink)
    0
    Any chance to left MCLR_PK3 connection floating on your buffer ? Smoke Goddess waiting you.
    #9
    NorthGuy
    Super Member
    • Total Posts : 6589
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: What happens if you put MCLR above VDD but below minimum VPP? 2021/03/03 07:53:11 (permalink)
    +1 (1)
    The very old PICs required actual current from Vpp for the flash controller, and very stable voltage. For new ones, it's only a matter of passing a threshold. In earlier PICs, such as PIC16F628, the threshold is quite high - about 10V.The modern ones have lower thresholds. Hence a danger - voltage variations can reset your PIC. Hence using a resistor to Vdd may be important.
    #10
    Jump to:
    © 2021 APG vNext Commercial Version 4.5