MCP401X/2X Digital Potentiometer Evaluation Board User’s Guide © 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.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Table of Contents Preface ........................................................................................................................... 1 Chapter 1. Product Overview 1.1 Introduction ..................................................................................................... 5 1.2 What is the MCP402X Digital Potentiometer Evaluation Board? ................... 5 1.3 What the MCP402X Digital Potentiometer Evaluation Board Kit Includes .....
MCP401X/2X Evaluation Board User’s Guide NOTES: DS51546B-page iv © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no exception. Microchip tools and documentation are constantly evolving to meet customer needs, so some actual dialogs and/or tool descriptions may differ from those in this document. Please refer to our web site (www.microchip.com) to obtain the latest documentation available. Documents are identified with a “DS” number.
MCP401X/2X Evaluation Board User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS Description Arial font: Italic characters Initial caps Quotes Underlined, italic text with right angle bracket Bold characters ‘bnnnn Text in angle brackets < > Courier New font: Plain Courier New Italic Courier New 0xnnnn Square brackets [ ] Curly brackets and pipe character: { | } Ellipses...
Preface THE MICROCHIP WEB SITE Microchip provides online support via our web site at www.microchip.com. This web site is used as a means to make files and information easily available to customers.
MCP401X/2X Evaluation Board User’s Guide NOTES: DS51546B-page 4 © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Chapter 1. Product Overview 1.1 INTRODUCTION This chapter provides an overview of the MCP402X Digital Potentiometer Evaluation Board and covers the following topics: • What is the MCP402X Digital Potentiometer Evaluation Board? • What the MCP402X Digital Potentiometer Evaluation Board includes 1.
MCP401X/2X Evaluation Board User’s Guide 1.3 WHAT THE MCP402X DIGITAL POTENTIOMETER EVALUATION BOARD KIT INCLUDES This MCP402X Digital Potentiometer Evaluation Board Kit includes: • One populated Printed Circuit Board (PCB) - MCP4021-103/OT - PIC10F206-I/OT with 00066_MCP402XEV.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Chapter 2. Installation and Operation 2.1 INTRODUCTION The MCP402X Digital Potentiometer Evaluation Board provides a tested, out-of-the-box example of a MCP401X/2X application. The circuit description is described in Section 2.2 “PCB Description”, while the test and operating instructions are described in Section 2.3 “Test and Operating Instructions”.
MCP401X/2X Evaluation Board User’s Guide 2.2.1 Evaluating the MCP4021 and MCP4011 The MCP4021/11-XXXI/SN is an 8-pin digital potentiometer device with terminals A, B and W available on the device pins. Footprint U1 supports the 150 mil SOIC package. Resistors R2 and R3 are 2.5 kΩ on the populated PCB, along with the 10 kΩ MCP4021-103I/SN digital potentiometer. This creates a “windowed” voltage divider with a transfer function illustrated in Equation 2-1.
Installation and Operation 2.2.3 Evaluating the MCP4023 and MCP4013 The MCP4023/13-XXXI/OT is a 6-pin, grounded digital potentiometer with terminals A and W available on the device pins. Footprint U2 supports the SOT-23-6 package. Populating R2 will create a voltage divider with a transfer function illustrated in Equation 2-2. EQUATION 2-2: GROUNDED POTENTIOMETER – VOLTAGE DIVIDER CALCULATION V DD ⋅ Rwb 5.
MCP401X/2X Evaluation Board User’s Guide 2.3 TEST AND OPERATING INSTRUCTIONS The populated PCB is configured to create a voltage divider from VDD to VSS using a 2.5 kΩ pull-up resistor (R2), the MCP4021-103I/SN (10 kΩ) and a 2.5 kΩ pull-down resistor (R3). To quickly evaluate the digital potentiometer’s performance, the following test equipment is required: • 2.7V to 5.
Installation and Operation 2.3.1 Test Setup 1. Connect the power supply “+” to VDD and the “–” to GND. 2. Connect the voltmeter to the W terminal and GND. The voltmeter should reflect the wiper setting with respect to Equation 2-3. EQUATION 2-3: POPULATED PCB – VOLTAGE DIVIDER CALCULATION VDD ⋅ ( R wb + R3 ) 5.0V ⋅ ( ( d ⋅ 10k ) ⁄ 63 + 2.5k ) V wiper = ------------------------------------------- = --------------------------------------------------------------------R2 + R3 + R AB 2.5k + 2.
MCP401X/2X Evaluation Board User’s Guide 2.3.2 MCP402X Digital Potentiometer Evaluation Board Firmware Operation The 00066_MCP402XEV.HEX firmware programmed into the PIC10F20X provides a very simple interface to operate the MCP402X digital potentiometer. There are ten basic commands supported for the user to exercise the MCP402X digital potentiometer. Table 2-1 shows the firmware commands of the Digital Potentiometer Evaluation Board. DS51546B-page 12 © 2005 Microchip Technology Inc.
DECR 7 6: Note 1: 2: 3: 4: 5: 64(4) - (High Voltage)(6) Yes Yes Yes - (High 64(4) Yes - (Low Voltage) Voltage)(6) 1(3) - (High Yes 1(3) Voltage)(6) - (Low Voltage) 1(3) Yes - (High Yes 64(2) Voltage)(6) - (Low Voltage) 64(2) Yes 1(1) Yes Yes - (High Voltage)(6) - (High 1(1) 1(1) Voltage)(6) - (Low Voltage) # of Steps High Voltage on No CS and U/D pins? Yes No Yes Yes No Yes No Yes Yes After Command Wiper is — — Yes — — — — Yes — — — Yes — — Yes —
MCP401X/2X Evaluation Board User’s Guide 2.3.3 Running the Ratiometric Voltage Demo Table 2-2 provides step-by-step instructions to perform a demonstration of the MCP402X Digital Potentiometer Evaluation Board. Measuring Ratiometric Voltage TABLE 2-2: MEASURING RATIOMETRIC VOLTAGE Step Action Result 1 — Power up the populated Digital Potentiometer Evaluation Board. Voltage calculations use a system voltage of 5V.
Installation and Operation TABLE 2-2: MEASURING RATIOMETRIC VOLTAGE (CONTINUED) Step Action Result 11 On the Digital Potentiometer Evaluation Board: Wiper is NOT moved due to the wiper being locked (WiperLock™ Technology is enabled). On the Digital Potentiometer Evaluation Board: Implement Command #1 (see Table 2-1). On DMM: Voltage equals approximately 3.38V. 12 On the Digital Potentiometer Evaluation Board: Turn off/disconnect power supply. On DMM: Voltage equals approximately 0V.
MCP401X/2X Evaluation Board User’s Guide 2.3.4 Wiper Voltages Table 2-3 shows the relation between the wiper position and the voltage on the wiper when 5.0 volts is applied to the MCP402X Digital Potentiometer Evaluation Board where the resistors R2 and R3 are 2500Ω and the MCP4011 resistor value (RAB) is 10 kΩ. Equation 2-4 shows the formula for these calculations.
Installation and Operation 2.4 FIRMWARE DESCRIPTION The 000066_MCP402XEV.ASM source code was written using assembly language for the PIC10F206 microcontroller. Refer to Appendix E. “00066_MCP402XEV.ASM Source Code”. The firmware initializes its I/O so that it can poll the INCR and DECR buttons every millisecond. If the button has been depressed for 40 out of 50 ms, it is considered to be debounced and asserted. The button state is used to determine if a new “Action State” is desired.
MCP401X/2X Evaluation Board User’s Guide NOTES: DS51546B-page 18 © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Appendix A. Schematic and Layouts A.1 INTRODUCTION This appendix contains the following schematics and layout diagrams for the MCP402X Digital Potentiometer Evaluation Board. • Schematic – Shows the schematic of the MCP402X Digital Potentiometer Evaluation Board. The populated PCB was built using this schematic.
MCP401X/2X Evaluation Board User’s Guide SCHEMATIC M A.2 DS51546B-page 20 © 2005 Microchip Technology Inc.
Schematic and Layouts A.3 MCP402X BOARD LAYOUT – TOP LAYER + SILK-SCREEN A.4 MCP402X BOARD LAYOUT – BOTTOM LAYER © 2005 Microchip Technology Inc.
MCP401X/2X Evaluation Board User’s Guide A.5 MCP402X BOARD LAYOUT – TOP SILK-SCREEN A.6 MCP402X BOARD LAYOUT – BOTTOM LAYER + SILK-SCREEN DS51546B-page 22 © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Appendix B. Bill Of Materials (BOM) TABLE B-1: Qty BILL OF MATERIALS Reference Description Manufacturer ® Part Number C0805C103K5RACTU 2 C1,C2,C3 Cap 0.01 µF 50V CERAMIC X7R 0805 Kemet 1 C4 Cap .1 µF 25V CERAMIC X7R 0805 Panasonic® Corporation – ECG ECJ-2VB1E104K 1 D1 Dual Diode, SOT-23-3, May substitute with Fairchild® BAV99 ON Semiconductor® BAV99LT1 2 INCR, DECR Switch LT Touch 6X3.
MCP401X/2X Evaluation Board User’s Guide NOTES: DS51546B-page 24 © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Appendix C. Using the BFMP Programmer to Power the Board C.1 POWERING THE BOARD USING THE BFMP PROGRAMMER The BFMP programmer (PG164101) uses a 6-pin interface for programming. The PICkit™ 2 Flash Starter Kit (PG164120 or DV164120) uses the same interface. The MCP402X Digital Potentiometer Evaluation Board (MCP402XEV) plugs into the BFMP (or PICkit™ 2 Flash Starter Kit) in the orientation shown in Figure C-1.
MCP401X/2X Evaluation Board User’s Guide These programmers use the PICkit™ 1 Baseline Flash Programmer software. This GUI should be configured as shown in Figure C-2. Selecting Device Power causes the BFMP to power the attached board all the time (not just during programming). This allows the MCP402X Digital Potentiometer Evaluation Board to be easily demonstrated without needing to carry a power supply (although a DMM is still required). Select PIC10F206 FIGURE C-2: Ensure Device Power IS checked and 2.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Appendix D. Potential Programming Issue of the MCP402XEV D.1 INTRODUCTION When programming the MCP402XEV with a Microchip programmer (such as the BPMF or MPLAB® ICD 2), the PIC10F206 may not program correctly due to the load on the ICSPDAT pin. This issue relates to PCBs marked 104-00066 and 104-00066R2.
M MCP401X/2X Evaluation Board User’s Guide This is the node that needs to be open when programming. JP1 C2 FIGURE D-2: DS51546B-page 28 MCP402XEV R2 Schematic PCB R2, ECN #1. © 2005 Microchip Technology Inc.
MCP401X/2X EVALUATION BOARD USER’S GUIDE Appendix E. 00066_MCP402XEV.ASM Source Code E.1 INTRODUCTION This appendix documents the example PIC10F20X source code used on the populated PCB. The source code is described in detail by the comments within the.ASM file. The 00066_MCP402XEV.ASM, PIC10F206.INC and MCP402XEV.HEX files can be found on the Microchip web site (www.microchip.com) and on the included CD.
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) ButtonCheck ; Debounce Buttons btfss PowerDown ; If pulled low, put uC to SLEEP goto LowPowerMode bsf UP_State bsf DOWN_State ; initialize Button_State to indicate no button pressed movlw .50 ; debounce the buttosns for 50mS to see if pressed movwf Exit movlw .
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) Loop1_2sec call GPIO_TestDOWN ; make GP0/DECR/CS an input (w/pu enabled) movlw .5 ; 5ms delay call VAR1000TcyDELAY btfss DOWN ; if DOWN gets pressed, exit retlw .1 call GPIO_TestUP ; make GP1/INCR/UD an input (w/pu enabled) movlw .5 ; 5ms delay call VAR1000TcyDELAY btfsc UP ; if UP gets released, exit retlw .
00066_MCP402XEV.ASM Source Code TABLE E-1: State4 call movlw call clrf retlw State5 movlw movwf Loop5_2sec call movlw call btfsc retlw call movlw call btfsc retlw decfsz goto call movlw call ; movlw ; call HV_IncrExit call movlw call btfss goto call movlw call btfss goto clrf retlw State6 movlw movwf Loop6_2sec call movlw call btfsc retlw call movlw call btfsc retlw decfsz goto call movlw call ; movlw ; call 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) InitGPIO .1 LV_Decrement State .4 .
00066_MCP402XEV.ASM Source Code TABLE E-1: HV_DecrExit call movlw call btfss goto call movlw call btfss goto clrf retlw State7 State8 State9 State10 State11 call movlw call clrf retlw State12 call movlw call clrf retlw State13 call call clrf retlw State14 call call clrf retlw State15 goto 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) clrwdt GPIO_TestUP .10 VAR1000TcyDELAY UP HV_DecrExit GPIO_TestDOWN .10 VAR1000TcyDELAY DOWN HV_DecrExit State .
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) ;*********************************************************************************************** ; State Machine Subroutines ;*********************************************************************************************** DetermineState swapf State,f rrf State,f rrf State,w andlw b’00111111’ ; mask invalid states addwf PCL,f S0_00 retlw .0 ; both buttons pressed at same time, shouldn’t be here S0_01 retlw .
00066_MCP402XEV.ASM Source Code TABLE E-1: S13_10 S13_11 S14_00 S14_01 S14_10 S14_11 S15_00 S15_01 S15_10 S15_11 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) retlw retlw retlw retlw retlw retlw retlw retlw retlw retlw .0 .0 .0 .0 .0 .0 .0 .0 .0 .
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) ;*********************************************************************************************** ; High Voltage Increment & Decrement Subroutines ;*********************************************************************************************** HV_Increment_WL_Disable movwf Exit ; load the loop counter bsf UD goto $+1 ; creates a 3us total delay bsf HV_CS ; starts 1Mhz Charge Pump movlw .
00066_MCP402XEV.ASM Source Code TABLE E-1: DLOOP_HVIWL clrwdt nop decfsz goto bcf goto bsf goto bcf goto bcf bcf goto bsf retlw 00066_MCP402XEV.
00066_MCP402XEV.ASM Source Code TABLE E-1: 00066_MCP402XEV.ASM SOURCE CODE (CONTINUED) ;************ ; VARIABLE 5 Tcy DELAY UP TO 256*5Tcy+5Tcy ; DLYCNT1 = W ; DELAY = T(1 + 5 DLYCNT1 - 1) + CALL + RETLW ; ; ex. To create a 250us delay, (250/5)-1 = 49 ; movlw .49 ;load .49 into WREG ; call VAR5TcyDELAY ;call VAR5TcyDELAY ;************ ; The value in W at the time of the CALL = x.
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.