参数资料
型号: DM240002
厂商: Microchip Technology
文件页数: 18/42页
文件大小: 0K
描述: BOARD DEV EXPLORER 16 44-PIN
标准包装: 1
系列: Explorer 16 44 引脚
类型: MCU
适用于相关产品: dsPIC30,dsPIC33,PIC32,PIC24FJ,PIC24HJ
所含物品: Explorer 16 开发板,PIC24FJ64GA004 和 dsPIC33FJ32GP204 PIM 模块
产品目录页面: 659 (CN2011-ZH PDF)
44-Pin 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 PIC ? 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 RD0 through RD7. When one of these I/O pins
drives 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 Special Function Register bits use the conven-
tion 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 <p16F887.inc>
__CONFIG _CONFIG1, _LVP_OFF & _FCMEN_OFF & _IESO_OFF &
_BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_OFF &
_PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
__CONFIG _CONFIG2, _WRT_OFF & _BOR21V
org 0
Start:
BSF
BCF
BCF
BSF
GOTO
STATUS,RP0
TRISD,0
STATUS,RP0
PORTD,0
$
;
;
;
;
;
select Register Bank 1
make IO Pin RD0 an output
back to Register Bank 0
turn on LED RD0 (DS0)
wait here
END
Now lets look at the program that makes this happen.
DS41296B-page 14
;
#include
__Config
Org 0
BCF TRISC,0
BSF PORTD,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 Regis-
ters available on the PIC16F887. 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
p16F887.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 PIC ? micro-
controller devices start at address ‘ 0 ’, also called the Reset
vector.
Tells the processor to clear a bit in a file register. TRISD is the
tri-state register for pin 0 of PORTD. 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 PORTD. This will force the I/O
pin to a high condition turning on the LED.
Tells the processor to go to the current instruction.
? 2007 Microchip Technology Inc.
相关PDF资料
PDF描述
DM240011 KIT STARTER MPLAB FOR PIC24F MCU
DM240021 KIT STARTER MPLAB FOR PIC24H
DM240311 BOARD DEV PIC24F16KA102 XLP
DM300018 BOARD DEMO DSPICDEM 2
DM300019 BOARD DEMO DSPICDEM 80L STARTER
相关代理商/技术参数
参数描述
DM240002 制造商:Microchip Technology Inc 功能描述:Explorer 16 kit(44-PIN) w/ PIC24FJ64GA00
DM240011 功能描述:开发板和工具包 - PIC / DSPIC MPLAB Starter Kit for PIC24F MCU RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240012 功能描述:开发板和工具包 - PIC / DSPIC PIC24E USB Starter Kit RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-1 功能描述:开发板和工具包 - PIC / DSPIC Microstick for 3V PIC24F K-series RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM240013-2 功能描述:开发板和工具包 - PIC / DSPIC RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: