参数资料
型号: DM163001
厂商: Microchip Technology
文件页数: 22/57页
文件大小: 0K
描述: BOARD DEMO PICDEM-1
标准包装: 3
其它名称: DM163001R
DM163001R-ND
PICDEM-1
PICDEM-1 User’s Guide
4.4
Detailed Code Description
The program starts out by defining three constants: TEMP, a general purpose
file register; ADIF, the bit location (1) of the A/D interrupt flag in ADCON0; and
ADGO, the A/D GO/DONE bit in ADCON0. The next sections of code define
the reset and interrupt vectors.
TEMP
equ
10h
ADIF
ADGO
equ
equ
1
2
;A/D interrupt flag
;A/D enable bit
;
org
0x00
;
goto
org
goto
Start
0x04
Service_int
;reset vector
;interrupt vector
The actual program begins at Start, where PORTB is defined as all outputs by
writing 0’s to the PORTB tristate register TRISB. Note that 0’s were written to
the PORTB register prior to setting the port to outputs so that the port would
initialize with all outputs in the low state.
Start
movlw
movwf
bsf
B’00000000’
PORTB
STATUS, RP0
;set port b as
;all outputs
CLRF
bcf
TRISB
STATUS, RP0
;
/
;
call
InitializeAD
After initializing PORTB, InitializeAD is called. The page register is set for
page 1, RA0 through RA3 are selected to be analog inputs, and V REF is
selected to be V DD (if all four pins are selected to be analog inputs, V REF is
set to V DD by default) by writing to ADCON1. The page register is then reset
for page 0, the internal RC oscillator is selected for the conversion clock, and
ADON, the A/D on/off bit is set so that the A/D converter module is operating.
The last action this routine takes before returning is to clear the A/D result
register.
InitializeAD
bsf
movlw
movwf
bcf
movlw
movwf
clrf
return
DS33015C-page 18
STATUS,5
B’00000000’
ADCON1
STATUS,5
B’11000001’
ADCON0
ADRES
;select pg1
;select ch0-ch3...
;as analog inputs
;select pg0
;select:RC,ch0..
;turn on A/D.
;clr result reg.
? 1999 Microchip Technology Inc.
相关PDF资料
PDF描述
DM163004-LT BOARD DEMO PICDEM.NET
DM163005 KIT EVAL PIC16C432/433 LIN BUSS
DM163007 PICDEM CAN-LIN 1 FOR 18C658/858
DM163008 KIT MCP2120/2150 FOR IRDA COMM
DM163010 BOARD DEMO PICDEM USB
相关代理商/技术参数
参数描述
DM163002 制造商:Microchip Technology Inc 功能描述:PIC16C64/74 DEMO BOARD
DM163003 功能描述:开发板和工具包 - PIC / DSPIC PICDEM 3 PIC16C923/4 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163004 功能描述:开发板和工具包 - PIC / DSPIC USE 579-DM163004-LT RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163004 制造商:Microchip Technology Inc 功能描述:DEMO BOARD W/TCP/IP ((NW))
DM163004-LT 功能描述:开发板和工具包 - PIC / DSPIC PICDEM.net Demo Kit w/o TCP/IP Lean Book RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: