参数资料
型号: DM164120-1
厂商: Microchip Technology
文件页数: 18/42页
文件大小: 0K
描述: BOARD DEMO PICKIT 2 LP COUNT
标准包装: 1
系列: PICkit™
类型: MCU
适用于相关产品: 28 引脚 PIC16C、16F、18C、18F
所含物品: 3 个板(1 个装有元件的板,2 个裸板)
产品目录页面: 659 (CN2011-ZH PDF)
Low Pin Count Demo Board User’s Guide
3.2.1
Lesson 1: Hello World (Light a LED)
The first lesson shows how to turn on a LED. This is the PICmicro ? microcontroller
version of “Hello World” and discusses the I/O pin structures.
New Instructions
BSF
BCF
Bit set
Bit clear
The LEDs are connected to I/O pins RC0 through RC3. When one of these I/O pins
drive high, the LED turns on. The I/O pins can be configured for input or output. On
start-up, the default is input. The TRIS bits use the convention of ‘ 0 ’ for output and ‘ 1 ’
for input. We want digital output so these must be configured.
EXAMPLE 3-1:
PICkit 2, LESSON 1: “HELLO WORLD”
; PICkit 2 Lesson 1 - 'Hello World'
;
#include <p16F690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF &
_MCLRE_OFF & _CP_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF)
org 0
Start
BSF STATUS,RP0 ;select Register Page 1
BCF TRISC,0 ;make I/O Pin C0 an output
BCF STATUS,RP0 ;back to Register Page 0
BSF PORTC,0 ;turn on LED C0
GOTO $ ;wait here
end
Now lets look at the program that makes this happen.
;
#include
__Config
Org 0
BCF TRISC,0
BSF PORTC,0
GOTO $
Starts a comment. Any text on the line following the semicolon
is ignored.
Brings in an include file defining all the Special Function
Registers available on the PIC16F690. Also, it defines valid
memory areas. These definitions match the names used in the
device data sheet.
Defines the Configuration Word. The labels are defined in the
p16F690.inc file. The labels may be logically ANDed
together to form the word.
Tells the assembler where to start generating code. Code may
be generated for any area of the part. Mid-range PICmicro ?
microcontroller devices start at address ‘ 0 ’, also called the
Reset vector.
Tells the processor to clear a bit in a file register. TRISC is the
Tri-state register for pin 0 of PORTC. A ‘ 1 ’ in the register
makes the pin an input; a ‘ 0 ’ makes it an output. We want to
make it an output, so the bit must be cleared.
Tells the processor to set pin 0 of PORTC. This will force the
I/O pin to a high condition turning on the LED.
Tells the processor to go to the current instruction.
For more information, refer to the I/O Ports Section of the PIC16F685/687/689/690
Data Sheet (DS41262).
DS51556A-page 14
? 2005 Microchip Technology Inc.
相关PDF资料
PDF描述
DM164120-3 BOARD DEMO PICKIT2 28-PIN
DM164120-5 BOARD DEMO PICKIT 2 64/80-PIN
DM164123 KIT MANAGEMENT SYSTEM PICDEM
DM180021 KIT STARTER MPLAB FOR PIC18F MCU
DM183022 BOARD DEMO PIC18FXX22 64/80TQFP
相关代理商/技术参数
参数描述
DM164120-1 制造商:Microchip Technology Inc 功能描述:DEVELOPMENT TOOLS - PICKIT 2 LOW PIN COU
DM164120-2 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 44-Pin Count Demo Brd RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-3 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 Count Demo Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-4 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 1 Dem Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-4 制造商:Microchip Technology Inc 功能描述:PICkit 2 18-Pin Demo Board