DM163035+TEFLCST3 Microchip Technology, DM163035+TEFLCST3 Datasheet - Page 40
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
DM163035+TEFLCST3
Manufacturer Part Number
DM163035+TEFLCST3
Description
KIT, PICDEMLAB+FLOWCODE-HOME BUNDLE/
Manufacturer
Microchip Technology
Datasheet
1.DM163035TEFLCST3.pdf
(112 pages)
Specifications of DM163035+TEFLCST3
Kit Contents
Component Kit, PICDEM Lab Development Board, PICkit 2 Programmer/ Debugger, CD Containing User Guide
Svhc
No SVHC (15-Dec-2010)
Development Tool Type
Hardware / Software - Dev
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC10, PIC12, PIC16
Silicon Core Number
PIC10F, PIC12F, PIC16F
Silicon Family Name
PIC10F2xx, PIC12F6xx, PIC16F6xx
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
PICDEM
DS41381A-page 36
TM
2.3.6
2.3.6.1
This lab introduces a macro called by the Decide functional block that will shift a high
bit in the LED_Output variable from left-to-right each time through the Software
Control loop before being assigned to the PORTC register for output to the LEDs in the
Do_Outputs functional block (Figure 2-30).
FIGURE 2-30:
Macros are sections of code that can be used and reused in projects. Macros allow
complex tasks to be handled by code blocks and can be imported and exported.
The macro called by the Decide functional block will first check the current value in
LED_Output to see if the Least Significant bit (LSb), bit 0, is high. If so, this means
that on the next shift to the right, the contents of the LED_Output variable will be all
‘0’s. To avoid this condition, the macro re-initializes LED_Output to set the Most
Significant bit (MSb), bit 7, high. Otherwise, if any other condition exists, the contents
of the LED_Output variable are shifted by 1 bit position to the right.
2.3.6.2
1. Create a new project in Flowcode using steps 1 through 9 from GPIO_Lab1
2. Construct the Software Control loop flowchart using steps 2 through 9 developed
3. Next, the Decide functional block is constructed using the flowcode macro
Lab Flowcode Companion Guide
Next time through Software Control Loop:
First time through Software Control Loop):
LED_Output variable
LED_Output variable
saving the project as GPIO_Lab3.fcf in the
C:\PICDEM_Lab\flowcode\GPIO_Labs\GPIO_Lab3 directory.
in the previous lab omitting the Decide functional block (step 6). In the Ini-
tialize block, initialize the LED_Output variable so that the MSb is high and
the rest of the bits are low (i.e., 0b10000000).
feature. Create a new macro by selecting Macro>New...
The Create a New Macro window should open. In the “Name of new macro” box
enter Shift_Rt. The “Description of new macro:” box describes what this macro
does. Enter the description shown in Figure 2-31 or a description that clearly
defines how this macro will behave and click OK to close the window.
1
0
Decide shifts contents of LED_Output
0
1
Lab 3: Using Macros to Rotate LEDs
OVERVIEW
PROCEDURE
Initialize determines initial
contents of LED_Output
0
0
Left by 1 bit position
0
0
RESULTS OF DO_OUTPUT( )
0
0
0
0
0
0
0
0
LED_Output to
LED_Output to
Do_Outputs
Do_Outputs
PORTC
assigns
PORTC
assigns
PORTC
PORTC
1
0
0
1
0
0
© 2009 Microchip Technology Inc.
Corresponding LED lights
Corresponding LED lights
0
0
0
0
0
0
0
0
0
0