EasyManuals Logo

Microchip Technology PICkit 3 User Manual

Microchip Technology PICkit 3
102 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #52 background imageLoading...
Page #52 background image
PICkit™ 3 Starter Kit User’s Guide
DS41628B-page 52 2012 Microchip Technology Inc.
3.4.5.2 ENHANCED MID-RANGE
3.4.5.3 PIC18
3.4.5.3.1 lsrf/rrcf
The difference between a logical shift and a shift through carry is that a logical shift right
will shift in a ‘0’ from the left. The latter will shift whatever was in the carry bit to the left
most bit. They both shift the LSb into the carry bit. For example:
FIGURE 3-1: LOGIC SHIFT TO THE RIGHT
FIGURE 3-2: ROTATE RIGHT THROUGH CARRY
If a bit is shifted into a carry, it is crucial that the designer clear it before a next rotate is
performed since the bit will then be shifted into the register, unless of course, that is
what is intended.
3.4.6 Assembly
3.4.6.1 ENHANCED MID-RANGE
EXAMPLE 3-14:
TABLE 3-9: NEW INSTRUCTIONS FOR ENHANCED MID-RANGE
Instruction English Purpose
lsrf Logical shift right Shift bits to the right
TABLE 3-10: NEW INSTRUCTIONS FOR PIC18
Instruction English Purpose
rrcf Rotate right through carry Shift bits to the right
76543210
00010111X
0010111100
MSb
LSb
C
76543210
00010111
C
001011110
MSb
LSb
1
Rotate:
lsrf LATC,F ;shift the LEDs and turn on the next LED to the right
btfsc STATUS,C ;did the bit rotate into the carry (i.e. was DS1 just lit?)
bsf LATC, 3 ;yes, it did and now start the sequence over again by turning on DS4
goto MainLoop ;repeat this program forever

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Microchip Technology PICkit 3 and is the answer not in the manual?

Microchip Technology PICkit 3 Specifications

General IconGeneral
BrandMicrochip Technology
ModelPICkit 3
CategoryComputer Accessories
LanguageEnglish

Related product manuals