PICDEM-1 User’s Guide
Start
; start main program
Start1
movlw
movfp
0x20
WREG,FSR0
; clear ram space
; use indirect addressing
clrf
incfsz
goto
call
call
INDF0, F
FSR0, F
Start1
Init_ports
Init_serial
;
;
;
;
;
clear ram
from 0x20 to 0xff
/
initialize all ports
initialize serial port
Loop
movpf
btfss
call
goto
PORTA,TEMP
TEMP,1
Xmit
Loop
;
;
;
;
get porta
check for key press
send next value
check again
The routine Init_ports sets all pins of PORTB to be outputs and sets them
to the low state (LEDs off).
Init_ports
movlb
clrf
clrf
0
DDRB, F
PORTB, F
; select bank 0
; port b all ouptuts
; and all low.
return
Init_serial initializes the USART. The baud rate is set to 9600 for both
transmit and receive, the receiver is enabled in an asynchronous continuous
reception mode with 8-bit words. The transmitter is enabled in an
asynchronous, 8-bit mode.
Init_serial
movlb
movlw
movfp
movlw
movfp
clrf
movlb
clrf
clrf
bsf
movlb
bsf
bsf
0
.25
WREG,SPBRG
0x90
WREG,RCSTA
TXSTA, F
1
PIR, F
PIE, F
_rcie
0
_txen
_peie
;
;
;
;
;
;
;
;
;
;
;
;
;
select bank 0
select 9600 baud
/
set up serial pins
/
setup transmit status
select bank 1
clear all interrupts
clear all enables
enable receive interrupt
select bank 0
enable transmit
enable peripheral ints
retfie
DS33015C-page 40
? 1999 Microchip Technology Inc.
相关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
DM163012 BOARD DEMO PICDEM FOR 16C781/782
DM163024 BOARD DEMO PICDEM.NET 2
DM163025 PIC DEM FULL SPEED USB DEMO BRD
相关代理商/技术参数
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 接口类型: 工作电源电压:
DM163005 功能描述:开发板和工具包 - PIC / DSPIC PICDEM PIC16C432/3 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163006 功能描述:开发板和工具包 - PIC / DSPIC 18R PIC18C601/801 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM163007 功能描述:开发板和工具包 - PIC / DSPIC For PIC18C658/858 RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: