TB087 Using Voltage Supervisors with PICmicro® Microcontroller Systems which Implement In-Circuit Serial Programming™ Author: This technical brief will show how the MCP111 and MCP121 may be used in PICmicro microcontroller systems where ICSP is required. Mark Palmer Microchip Technology Inc. INTRODUCTION Reset Characteristics Even though many microcontrollers offer an on-chip brown-out function, it may be desirable to use an external voltage supervisor. This may be due to the microcontroller’s limited trip point selections or the additional current requirement for enabling the brownout function. In these cases, an external voltage supervisor device may be preferable. The two main reasons to consider an external voltage supervisor device are: Many standard microcontrollers are Flash memory devices. This means that the device can be programmed in-circuit. Typically, to enter the in-circuit programming mode, some non-typical state needs to be forced. For PICmicro® microcontrollers, the mode is called In-Circuit Serial Programming™ (ICSP™). A typical microcontroller – ICSP system is shown in Figure 1. ICSP can be used to program the device after assembly as well as for firmware updates in the field. In most cases, entering the ICSP mode requires that the MCLR pin go from a low voltage (VIL) to the programming high voltage (VIHH). The VIHH is dependent on the PICmicro microcontroller and typically ranges from a minimum of the PICmicro microcontroller’s VDD + 3.5V to a maximum of 14V. Note: Refer to the specific programming specification for the desired PICmicro microcontroller. 1. 2. Voltage trip point Operating current Table 1 shows a voltage trip point and operational current comparison between a couple of PICmicro microcontrollers and either the MCP111 or MCP121. The MCP1X1 offers more voltage trip points and a significantly lower operating current. TABLE 1: RESET CHARACTERISTICS Trip Point Voltages (V) (Typ.) Device Operating Current (µA) (min./max.) PIC16F87XA 4.00 —/200 (1) PIC18F1320 2.72, 4.22, 4.54 19/45 (1) MCP121 1.90, 2.32, 2.63, 2.93, 3.08, 4.38, 4.63 —/1.75 MCP111 1.90, 2.32, 2.63, 2.90, 2.93, 3.08, 4.38, 4.63 —/1.75 (2) This current added to either device IDD or IPD current. Power-up Timer Active current is 20 µA. This is NOT the typical state. Note 1: 2: As can be expected, these voltages are beyond the maximum voltage specification of the voltage supervisor output pin. FIGURE 1: A TYPICAL PICmicro® MICROCONTROLLER SYSTEM WITH ICSP™ VDD VDD © 2005 Microchip Technology Inc. ICSP™ Connector Other Circuitry PICmicro® MCU VPP RPU MCLR/VPP Other Circuitry DS91087A-page 1 TB087 A LOOK AT ICSP™ OPERATION When the application board is assembled, the PICmicro microcontroller can either be blank (unprogrammed) or programmed. Application boards assembled with blank devices require the ICSP feature. Application boards assembled with programmed devices may or may not require the ICSP feature. This is dependent on whether or not the application board supports firmware upgrades. TABLE 2: VIHH on MCLR Min. Max. 12.5V VDD + 4.0V 12.75V Application boards (assembled with programmed devices) that do not support firmware upgrades are not an issue for voltage supervisor devices. This is due to the fact that the MCLR pin does not require an ICSP high voltage (VIHH) to be applied. Many PICmicro microcontroller applications utilize the ICSP feature of these devices. However, with the ICSP feature, a high voltage (VIHH) is applied to the MCLR pin. Depending on the device used, this maximum voltage on the MCLR pin may be up to 14V. Most devices specify a maximum of 13.5V or below. ICSP Requirements The ICSP requirements for the desired PICmicro microcontroller is shown in that device’s programming specification document. For voltage supervisors and voltage detectors, one of the most important specifications is the VIHH specification. The VIHH specification states the voltage requirement on the MCLR pin for the device to be in the ICSP mode. The voltage supervisor open-drain output pin typically would be connected to the MCLR pin. Table 2 shows the minimum and maximum VIHH specifications for the VIHH voltage on the MCLR pin. Table 2 also shows the Microchip programming specification documents (and the document revision) referenced for this information. 12.5V 10.0V 10.0V VDD + 3.5V There are only a few devices where the ICSP maximum VIHH specification is greater than 13.5V; they are 14.0V devices. Note: Please check the most current revision of the programming specification for the desired device for VIHH and other application requirements. For these devices (with the 14V maximum VIHH), the maximum voltage on the MCLR pin would then be limited by the MCP111 or MCP121 device, which has a maximum of 13.5V. This should NOT be an issue since the minimum VIHH voltage of these devices is 12.0V and 10.0V (when the device VDD is 5.5V). Therefore, a significant ICSP VIHH voltage window remains (1.5V, worst-case). 9.0V 12.0V VDD + 4.5V 11.0V 10.0V Note 1: DS91087A-page 2 VIHH PROGRAMMING SPECIFICATIONS Document Rev DS30480, B, DS39622, C, DS39643 A 13.25V DS20072, B, DS30139, I, DS30228, K, DS30257, A, DS30261, D, DS30274, B, DS30278, B, DS30298, D, DS30324, B, DS30492, A, DS30555, B, DS30557, G, DS30603, B, DS39028, E, DS39588, A, DS40036, A, DS40037, A, DS40175 C 13.5V DS30190, H, DS30467, A, DS41207, C, DS41208, B, DS41226, D, DS41227, D, DS41228, D, DS41243 A 12.0V DS39624, A, DS41237, A, DS41244 B 13.5V DS41196 E 13.5V DS30034, D, DS39025, F, DS39589, B, DS39603, C, DS39607, B, DS41191 C 13.25V DS30499, B, DS30500, A, DS39576, B, DS39583, B, DS39592, B, DS39606, C, DS70102 D 14.0V DS30262 E 14.0V DS41156, D, DS41157, D, DS41163 D 13.5V DS40245 B 13.0V DS41204 D MCP1X1 maximum = 13.5V. Comment Note 1 Note 1 Note 1 Note 1 © 2005 Microchip Technology Inc. TB087 VIHH on the MCLR pin Figure 2 shows a typical microcontroller–voltage supervisor system circuit with this in-line resistance (RS). RPU is the MCLR pull-up resistor, RS is the in-line resistor to the open-drain output of the voltage supervisor or voltage detector. VRS is the voltage into the MCLR pin. It is recommended that the current into the open-drain output (IRS) be limited to 2 mA, even though characterization was done using a 1 kΩ resistor. This was to allow PICmicro MCU devices with the internal pull-up on the MCLR pin to also be used, since the minimum pull-up resistance can be calculated to 12.5 kΩ. This ensures the VOL of the voltage supervisor can meet the requirements of the MCLR pin VIL. OPEN-DRAIN HIGH VOLTAGE SPECIFICATION Table 3 shows an example voltage supervisor/voltage detector device data sheet open-drain high voltage (VODH) specification. Note: The device is not specified to constantly maintain the maximum VODH voltage on the open-drain output pin. This is intended for short ICSP programming cycles. This specification is specified for a worst-case scenario, where the device VDD is 3V and a VPP of 13.5V. This causes a voltage differential of 10.5V. If the device VDD is 5V, there are less issues since the voltage differential is reduced to 8.5V, decreasing the current into the voltage supervisor open-drain output pin. WHEN USING THE MCLR’S INTERNAL PULLUP RESISTOR Some PICmicro microcontrollers have an internal pullup resistor option on their MCLR pin. For example, the PIC16F684 has a typical internal 20 kΩ pull-up on the MCLR pin. Looking at the specifications, the minimum pull-up resistance can be calculated to 12.5 kΩ, from the maximum current specification. With the in-line 1 kΩ resistance, the minimum PIC16F684 VIL specification (0.2 x VDD) is not a problem (see VDR calculation from Table 4 and VRS calculation from Table 5). A TYPICAL PICmicro® MICROCONTROLLER SYSTEM WITH ICSP™ AND AN EXTERNAL VOLTAGE SUPERVISOR FIGURE 2: VDD VDD/VPP VDD Voltage Supervisor RS RPU (1) RST MCLR VRS TABLE 3: Note 1: PICmicro® MCU Some PICmicro® microcontrollers have a weak pull-up on the MCLR pin, so an external pull-up would not be required. EXAMPLE DATA SHEET SPECIFICATION Electrical Specifications: Unless otherwise indicated, all limits are specified for VDD = 1V to 5.5V, RPU = 100 kΩ, TA = –40°C to +125°C. Parameters Open Drain High Voltage on Output Note 1: 2: Sym Min Typ Max Units Conditions VODH — — 13.5 (1) V VDD = 3.0V, Time voltage > 5.5V applied ≤ 100s, current into pin limited to 2 mA, 25°C operation recommended Note 1, Note 2 This specification allows this device to be used in PICmicro microcontroller applications that require the ICSP feature (see device-specific programming specifications for voltage requirements). This specification does NOT allow a continuous high voltage to be present on the open-drain output pin (VOUT). The total time that the VOUT pin can be above the maximum device operational voltage (5.5V) is 100s. Current into the VOUT pin should be limited to 2 mA; it is recommended that the device operational temperature be maintained between 0°C to 70°C (25°C preferred). For additional information, please refer to Figure 4. This parameter is established by characterization and not 100% tested. © 2005 Microchip Technology Inc. DS91087A-page 3 TB087 RS and RPU FIGURE 3: The value of the RPU pull-up resistor and the RS in-line resistor should be selected to ensure that the voltage supervisor output voltage (VOL) can meet the PICmicro microcontroller MCLR VIL specification. VDD VDD/VPP VDD Voltage Supervisor Figure 3 shows a typical circuit with symbols for each of the components. RST Equation 1 shows the equation for the Voltage Divider Ratio (VDR) of the RS and RPU resistors. Equation 2 show the equation for calculating the worst case low voltage on the MCLR pin, where VOL is the maximum output low voltage from the MCP1X1 device. VOLTAGE SUPERVISOR CIRCUIT RPU (1) RS MCLR V (1 kΩ min.) RS EQUATION 1: VOLTAGE DIVIDER RATIO (VDR) The VRS voltage must not exceed the MCLR VIL specification. Table 4 shows some values for RS and the resultant maximum current into the open-drain output pin (IRS). Futhermore, it shows a recommended RPU value for cases when the RPU resistor is external. Given the RS and the RPU, the VDR is shown. PICmicro® MCU RS VDR = ----------------------R S + R PU EQUATION 2: VRS V RS = ( ( V DD – V OL ) × VDR ) + V OL Table 5 shows values for voltage divider ratios, and how these values relate to the VRS voltage at different system VDD levels. RS AND RPU TABLE 4: RPU (kΩ) IRS (1) (mA) VDR 12.5 (2) 10.5 0.0741 63 2 RS (kΩ) 1 5.25 Comment Note 1: 2: 0.0769 Recommended IRS When VDD = 3V and VIHH = 13.5V This in the minimum MCLR pin internal pull-up resistance. TABLE 5: VDR, VRS CALCULATIONS VRS VDR 0.0741 VDD = 5.5V Comment (1) 0.592 0.778V 0.0769 0.6 0.792 Max VDR for VDD = 3.0V 0.1219 — 1.022 Max VDR for VDD = 4.5V (MCLR VIL = 0.9V) 0.1304 — 1.065 Max VDR for VDD = 5.0V (MCLR VIL = 1.0V) — 1.1V Max VRS for VDD = 5.5V 0.1373 Note 1: DS91087A-page 4 VDD = 3.0V When MCLR VIL = 0.2 VDD © 2005 Microchip Technology Inc. TB087 MCP111 and MCP121 Open-Drain High Voltage Characterization Although this curve shows that the device can support operation at -40°C at 13.5V, it is recommended that the device be operated as close as possible to 25°C. Also, the lower the voltage, the better, since this adds to the “safety margin” for your system. Figure 4 shows the characterization curve of the current into the voltage supervisor devices (MCP111 and MCP121) as the voltage on the open-drain pin is increased. This characterization was done with a 1 kΩ in-line resistance to limit current into the device. This low current will not damage the structure of the output pin. We suggest that the lower the voltage on the output pin, the better. However, there should not be any issues with a limited time duration (100 sec.) at 13.5V (through the 1 kΩ resistor). Based on the design of the device and the characterization data, here are the recommended operating rules: 1. The majority of programming specifications for the PICmicro microcontrollers recommend a programming temperature of 25°C. Only at low temperature, and voltages above 13.5V, does this pin current start to rise, leveling off at the mA range. FIGURE 4: 2. 3. 4. Minimize the voltage differential between the device VDD and the VPP voltage. - a VDD = 5.0V and VPP = 13.0V (8V delta) is much better than a VDD = 3.0V and VPP = 13.5V (10.5V delta) Maximize size of current limiting resistor (RS). - an RS = 10 kΩ is better than an RS = 1 kΩ. Apply the high voltage at warmer temperatures. Limit time at high voltage. EXAMPLE VOLTAGE SUPERVISOR OUTPUT PIN CURRENT VS. VOLTAGE GRAPH 1.00E-02 1.00E-03 1.00E-04 1.00E-05 Open Drain Leakage (A) 1.00E-06 125°C 1.00E-07 1.00E-08 1.00E-09 25°C 1.00E-10 1.00E-11 -40°C 1.00E-12 1.00E-13 1.00E-14 1.00E-15 0V 1V 2V 3V 4V 5V 6V 7V 8V 9V 10V 11V 12V 13V 14V Pull-Up Voltage (V) -40°C Average © 2005 Microchip Technology Inc. 25°C Average 125°C Average DS91087A-page 5 TB087 OTHER MICROCHIP VOLTAGE SUPERVISOR DEVICES Other Microchip voltage supervisor devices with an open-drain output have not yet been evaluated for their ability to support the ICSP VIHH voltage requirements on their open-drain output pin. Devices that have a push-pull output (or those opendrain devices that have an internal pull-up resistor) are not suitable due to the high currents that can occur when the internal semiconductor devices become forward-biased. These high currents can lead to the device being damaged after programming (immediate or long-term reliability). Figure 5 shows an alternate circuit that can be used with any voltage supervisor device. There are two drawbacks for these types of circuit implementations. First is the additional cost of the Schottky diode (with a low voltage drop, ~ 0.3V). Second is the additional current consumption. The operation of the circuit is as follows: When the RST pin is not driven low, the Schottky diode will “block” the VPP voltage from the RST pin (so the voltage on the RST pin does not violate the device specifications). When the VPP signal is disconnected (open), the RPU will pull up the voltage on the MCLR pin to above it’s VIH level. OTHER MANUFACTURER’S DEVICES After inspecting many other competitor’s voltage supervisor/voltage detector data sheets, it did not appear that their open-drain outputs are specified to support the VIHH voltage requirements of the PICmicro microcontroller ICSP feature. When using a voltage supervisor or voltage detector, ensure that the device’s specifications meet the ICSP operation conditions of your application. Failure to do so may result in damage to the voltage supervisor or voltage detector (immediate or long-term reliability). QUICK EVALUATIONS Microchip offers a SOT-23-3 evaluation board (Part Number: VSUPEV). This board can be purchased via the Microchip web site and allows the voltage supervisor and in-line resistor to be installed and then connected to the PICmicro MCU circuit. When installing the in-line resistor (R3, see Figure 6), be sure to cut the default trace that shorts out this component. Additional information can be found in the “Voltage Supervisor SOT23 Evaluation Board User’s Guide”, DS51510. FIGURE 6: SOT-23-3 EVALUATION BOARD – VSUPEV When the RST pin is driven low (and the VPP signal is disconnected), the Schottky diode will block the RST pin’s VOL from the MCLR pin. The MCLR pin will essentially be floating. So something needs to ensure that the voltage level on the MCLR pin does not exceed the MCLR pin’s VIL specification. This could be attributed to either the leakage characteristics of the Schottky diode, or an external pull-down resistor. The selection of the RPU and RPD resistor values should ensure that both the MCLR VIH and VIL specifications can be met (RPD ~= 10* RPU). FIGURE 5: ALTERNATE VOLTAGE SUPERVISOR CIRCUIT VDD VDD Voltage Supervisor VDD RPU RST Schottky Diode (~ 0.3V drop) PICmicro® MCU MCLR RPD (1) VPP Note 1: This pull-down resistor may or may not be required. That depends on the leakage characteristics of the Schottky diode. If required, the RPD value must be selected to ensure the MCLR pin VIH and VIL specifications are met (RPD ~= 10*RPU). DS91087A-page 6 SUMMARY This technical brief has shown how Microchip’s MCP111 or MCP121 can be interfaced to devices that require a temporary high voltage on one of their pins. This is particularly relevant to applications using the InCircuit Serial Programming (ICSP) feature with one of Microchip Technology’s PICmicro microcontrollers. Not all applications require the use of an external voltage supervisor solution. But if they do, ensure that a device is selected that is specified to allow the high voltage required by ICSP. © 2005 Microchip Technology Inc. Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in their particular Microchip Data Sheet. • Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. • There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. • Microchip is willing to work with the customer who is concerned about the integrity of their code. • Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as “unbreakable.” Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip’s products as critical components in life support systems is not authorized except with express written approval by Microchip. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. Trademarks The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Analog-for-the-Digital Age, Application Maestro, dsPICDEM, dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel, Total Endurance and WiperLock are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. All other trademarks mentioned herein are property of their respective companies. © 2005, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company’s quality system processes and procedures are for its PICmicro® 8-bit MCUs, KEELOQ® code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip’s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. © 2005 Microchip Technology Inc. DS91087A-page 7 WORLDWIDE SALES AND SERVICE AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office 2355 West Chandler Blvd. Chandler, AZ 85224-6199 Tel: 480-792-7200 Fax: 480-792-7277 Technical Support: http://support.microchip.com Web Address: www.microchip.com Australia - Sydney Tel: 61-2-9868-6733 Fax: 61-2-9868-6755 India - Bangalore Tel: 91-80-2229-0061 Fax: 91-80-2229-0062 China - Beijing Tel: 86-10-8528-2100 Fax: 86-10-8528-2104 India - New Delhi Tel: 91-11-5160-8631 Fax: 91-11-5160-8632 Austria - Weis Tel: 43-7242-2244-399 Fax: 43-7242-2244-393 Denmark - Ballerup Tel: 45-4450-2828 Fax: 45-4485-2829 China - Chengdu Tel: 86-28-8676-6200 Fax: 86-28-8676-6599 Japan - Kanagawa Tel: 81-45-471- 6166 Fax: 81-45-471-6122 France - Massy Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79 China - Fuzhou Tel: 86-591-8750-3506 Fax: 86-591-8750-3521 Korea - Seoul Tel: 82-2-554-7200 Fax: 82-2-558-5932 or 82-2-558-5934 Germany - Ismaning Tel: 49-89-627-144-0 Fax: 49-89-627-144-44 Atlanta Alpharetta, GA Tel: 770-640-0034 Fax: 770-640-0307 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-285-0071 Fax: 630-285-0075 Dallas Addison, TX Tel: 972-818-7423 Fax: 972-818-2924 Detroit Farmington Hills, MI Tel: 248-538-2250 Fax: 248-538-2260 Kokomo Kokomo, IN Tel: 765-864-8360 Fax: 765-864-8387 China - Hong Kong SAR Tel: 852-2401-1200 Fax: 852-2401-3431 China - Shanghai Tel: 86-21-5407-5533 Fax: 86-21-5407-5066 China - Shenyang Tel: 86-24-2334-2829 Fax: 86-24-2334-2393 China - Shenzhen Tel: 86-755-8203-2660 Fax: 86-755-8203-1760 China - Shunde Tel: 86-757-2839-5507 Fax: 86-757-2839-5571 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Kaohsiung Tel: 886-7-536-4818 Fax: 886-7-536-4803 Taiwan - Taipei Tel: 886-2-2500-6610 Fax: 886-2-2508-0102 Italy - Milan Tel: 39-0331-742611 Fax: 39-0331-466781 Netherlands - Drunen Tel: 31-416-690399 Fax: 31-416-690340 England - Berkshire Tel: 44-118-921-5869 Fax: 44-118-921-5820 Taiwan - Hsinchu Tel: 886-3-572-9526 Fax: 886-3-572-6459 China - Qingdao Tel: 86-532-502-7355 Fax: 86-532-502-7205 Los Angeles Mission Viejo, CA Tel: 949-462-9523 Fax: 949-462-9608 San Jose Mountain View, CA Tel: 650-215-1444 Fax: 650-961-0286 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 03/01/05 DS91087A-page 8 © 2005 Microchip Technology Inc.