44-Pin Demo Board Lessons
3.2.3
Lesson 3: Rotate (Move the LED)
Building on Lessons 1 and 2, which showed how to light up a LED and then make it
blink with a delay loop, this lesson adds rotation. It will light up DS8 and then shift it to
DS7, then DS6 and on down to DS1, and then back to DS8.
New Instructions
MOVLW
MOVWF
MOVF
RRF
RLF
Note:
Loads WREG with a literal value
Moves the contents of WREG to a file register
Moves the contents of a file register, either to WREG or back into
the file register (see note)
Rotate file register right
Rotate file register left
Moving a file register to itself looks like a NOP at first. However, it has a
useful side effect in that the Z flag is set to reflect the value. In other words,
MOVF fileregister,f is a convenient way to test whether or not the
value is zero without affecting the contents of the WREG.
Rotate Program Flow
?
?
?
?
First, initialize the I/O port and the Display,
Copy the Display variable to the I/O Port, then
Delay for a little while
Rotate the display
FIGURE 3-1:
ROTATE PROGRAM FLOW
Initialize I/O Port
Put Up Display
Delay
Rotate Display
? 2007 Microchip Technology Inc.
Did it overflow?
No
Reset Display
Yes
DS41296B-page 17
相关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
DM300024 KIT DEMO DSPICDEM 1.1
DM330012 KIT USB STARTER FOR DSPIC33E
DM330013 MICROSTICK DSPIC33F/PIC24H BOARD
相关代理商/技术参数
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 接口类型: 工作电源电压:
DM240014 制造商:Microchip Technology Inc 功能描述:MICROSTICK FOR USB PIC24F - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:ACCY MICROSTICK USB PIC24F 制造商:Microchip Technology Inc 功能描述:MICROSTICK USB PIC24F
DM240015 制造商:Microchip Technology Inc 功能描述:MPLAB STARTER KIT FOR PIC24F INTELLIGENT INTEGRATED ANALOG - Boxed Product (Development Kits) 制造商:Microchip Technology Inc 功能描述:KIT MPLAB STARTER FOR PIC24F ANL 制造商:Microchip Technology Inc 功能描述:PIC24F GC INTELLIGENT ANALOG DEV KIT 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT 制造商:Microchip Technology Inc 功能描述:Starter Kit for PIC24F Intelligent Integrated Analog Series 制造商:Microchip Technology Inc 功能描述:Development Boards & Kits - PIC / DSPIC 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Arc 制造商:Microchip Technology Inc 功能描述:PIC24F, GC INTELLIGENT ANALOG, DEV KIT, Silicon Manufacturer:Microchip, Core Architecture:PIC, Core Sub-Architecture:PIC24, Silicon Core Number:PIC24FJ128GC010, Silicon Family Name:PIC24FJxxxGCxxx, Kit Contents:Starter Board 制造商:Microchip Technology Inc 功能描述:MPLAB Starter Kit for PIC24F Intelligent Integrated Analog, Starter Kits
DM240021 功能描述:开发板和工具包 - PIC / DSPIC MPLAB STARTER KIT FOR PIC24H RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压: