DM163035 Microchip Technology, DM163035 Datasheet - Page 31

KIT DEVELOPMENT PICDEM LAB

DM163035

Manufacturer Part Number
DM163035
Description
KIT DEVELOPMENT PICDEM LAB
Manufacturer
Microchip Technology
Type
MCUr
Datasheet

Specifications of DM163035

Contents
Board, Cable, Components, CD, PICkit Programmer
Processor To Be Evaluated
PIC10F, PIC12F615, PIC16F616
Data Bus Width
8 bit
Operating Supply Voltage
1.3 V to 5 V
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC10, PIC12, PIC16
Silicon Core Number
PIC10F, PIC12F, PIC16F
Silicon Family Name
PIC10F2xx, PIC12F6xx, PIC16F6xx
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC10F206, PIC16F690, PIC16F819
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
© 2009 Microchip Technology Inc.
The Do_Outputs() changes somewhat from the previous lab by implementing the
XOR operator to toggle the value in each PORTC bit location each time through the
software loop. The XOR operator is implemented in code as follows:
RCx ^= 1;
This translates to: “Make RCx equal to the current value in RCx XOR’d with 1”
When a value is XOR’d with itself, the result is ‘0’ (i.e., 1 XOR’d with 1 = 0, 0 XOR’d
with 0 = 0). When a value is XOR’d with a value different than itself, the result is ‘1’ (i.e.,
1 XOR’d with 0 = 1). Therefore, each time through the loop PORTC bits will toggle from
1-to-0 or 0-to-1 depending on its current value.
3.3.5.2
Using the code developed in the previous lab, make the following changes:
1. Copy/paste the code in Example 3-4 over the Initialize() code from the
EXAMPLE 3-4:
The only change from the previous lab is that the PORTC bits are all set high to 1.
2. Copy/paste the code in Example 3-5 over the Do_Outputs() code from the
Note:
previous lab.
previous lab to accommodate the XOR bit toggle.
//Set all PORTC bits HIGH (to a known state)
PORTC = 0b11111111;
//Configure PORTC's ANALOG/DIGITAL pins as all Digital
ANS4 = 0;//Associated with RC0
ANS5 = 0;//Associated with RC1
ANS6 = 0;//Associated with RC2
ANS7 = 0;//Associated with RC3
ANS8 = 0;//Associated with RC6
ANS9 = 0;//Associated with RC7
//Configure PORTC pins as all output
//i.e. 1 = Input, 0 = Output
TRISC0 = 0;//Make RC0 (pin 16) output
TRISC1 = 0;//Make RC1 (pin 15) output
TRISC2 = 0;//Make RC2 (pin 14) output
TRISC3 = 0;//Make RC3 (pin 7) output
TRISC4 = 0;//Make RC4 (pin 6) output
TRISC5 = 0;//Make RC5 (pin 5) output
TRISC6 = 0;//Make RC6 (pin 8) output
TRISC7 = 0;//Make RC7 (pin 9) output
PROCEDURE
The reader may wish to create a new project as per the previous lab called
GPIO_Lab2.mcp
General Purpose Input/Output Labs
INITIALIZE() CODE FOR LAB 2
DS41369A-page 27

Related parts for DM163035