Electronic Components Datasheet Search
  English  ▼

X  

MCP402XEV Datasheet(PDF) 35 Page - Microchip Technology

Part # MCP402XEV
Description  Digital Potentiometer Evaluation Board User?셲 Guide
PDF  46 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

MCP402XEV Datasheet(HTML) 35 Page - Microchip Technology

Back Button MCP402XEV Datasheet HTML 31Page - Microchip Technology MCP402XEV Datasheet HTML 32Page - Microchip Technology MCP402XEV Datasheet HTML 33Page - Microchip Technology MCP402XEV Datasheet HTML 34Page - Microchip Technology MCP402XEV Datasheet HTML 35Page - Microchip Technology MCP402XEV Datasheet HTML 36Page - Microchip Technology MCP402XEV Datasheet HTML 37Page - Microchip Technology MCP402XEV Datasheet HTML 38Page - Microchip Technology MCP402XEV Datasheet HTML 39Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 35 / 46 page
background image
00066_MCP402XEV.ASM Source Code
© 2005 Microchip Technology Inc.
DS51546B-page 31
;**********************************************************************************************
; General Pupose Register Definitions
;**********************************************************************************************
GPRS
UDATA
State
res
1
; variable to track the “state” value
; this code functions as a state machine
; bits 3:0 stores the state 0-15 indicator
; bits 7:6 stores the debounced button states
OldState
res
1
; allows program to see if State changed
Exit
res
1
; variable to count the number ms to test for a button press
DebounceUP
res
1
; variable to count the number of ms UP was pressed
DebounceDOWN res
1
; variable to count the number of ms DOWN was pressed
DLYCNT1
res
1
; variable for the delay subroutines
DLYCNT2
res
1
; variable for the delay subroutines
#define
UD
GPIO,1
; GP1 tied to UD & has “INCR” switch connected via 2.2k resistor
#define
CS
GPIO,0
; GP0 tied to CS & has “DECR” switch connected via 2.2k resistor
#define
UP
GPIO,1
; Momentary switch UP
#define
DOWN
GPIO,0
; Momentary switch DOWN
#define
CP
GPIO,2
; OSCOUT pin for Charge Pump
#define
PowerDown GPIO,3
; Vpp for programming & PowerDown input to put uC to SLEEP
#define
HV_CS
OSCCAL,FOSC4
; Drives CS to HVDD (drive CS high first)
#define
UP_State
State,7
; Debounced UP State - using bits 5:4 are critical
#define
DOWN_State State,6
; Debounced DOWN State - using bits 5:4 are critical
;***********************************************************************************************
; Reset Code
;***********************************************************************************************
RESET
CODE
; processor reset vector + 1
;ResetVector
; Device resets to 0x1FF to get the factory calibration
goto
Start
; Lower half of memory reserved for subroutines
;***********************************************************************************************
; Main Code
;***********************************************************************************************
MAIN
CODE
Start
Init_Oscillator
; Internal RC calibration value is placed at location 0xFF by Microchip
; as a movlw k, where the k is a literal value.
movwf
OSCCAL
; update register with factory cal value
;
bcf
OSCCAL,FOSC4
; make sure the FOSC4 is disabled to shut charge pump off
StateMachineReset
movlw
b’11110011’
; Disable the Comparator & make inputs digital
movwf
CMCON0
;
bcf
CMCON0, CMPON ; needs to be on to get GP2 as a General Purpose Output
movlw
b’10011010’
; disable Wake-Up on Pin Change,
; enable weak pullups for button inputs
; T0CS must be 0 for GP2 TRIS to be active
; set up for 72ms WDT
option
Init
clrf
State
clrf
OldState
call
InitGPIO
; make GP0/DECR/CS & GP1/INCR/UD outputs, block undesired U/D commands
TABLE E-1:
00066_MCP402XEV.ASM
SOURCE CODE (CONTINUED)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com