DM164120-2 Microchip Technology, DM164120-2 Datasheet - Page 37

BOARD DEMO PICKIT 2 44PIN

DM164120-2

Manufacturer Part Number
DM164120-2
Description
BOARD DEMO PICKIT 2 44PIN
Manufacturer
Microchip Technology
Type
MCUr
Datasheets

Specifications of DM164120-2

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F
Silicon Manufacturer
Microchip
Kit Contents
PIC16F Device, 2 PCB Boards
Features
Small Surface Mount Prototype Area, Two Bare PCB Boards
Development Tool Type
Hardware - Daughter Card
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
PIC16F887
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-2
Manufacturer:
Microchip Technology
Quantity:
135
© 2007 Microchip Technology Inc.
FIGURE 3-12:
This lesson uses the look-up table to implement a binary to Gray code converter. Gray
code is a binary code in which only a single bit changes from one sequence to the next.
They are frequently used in encoder applications to avoid wild jumps between states.
Binary encoders are typically implemented as an opaque disk with slots sensed by light
sensors. Due to different threshold levels on different bits, bits may change at slightly
differently times yielding momentary invalid results. Gray code prevents this because
only one bit changes from one sequence to the next. The current code is correct until
it transitions to the next.
The algorithm to convert between binary and Gray code is fairly complex. For a small
number of bits, the table look-up is smaller and faster.
This lesson takes the Analog-to-Digital value upper nibble and converts it to Gray code
displayed on the first four LEDs. The code changes one bit at a time as the potentiom-
eter rotates across its range (seeExample 3-12).
Gray Code Converter
Decimal
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PC
Binary
0000
0001
0011
0010
0110
0111
0101
0100
1100
1101
1111
1110
1010
1011
1001
1000
12
PC LOADING AS DESTINATION OF INSTRUCTION
5
PCH
PCLATH<4:0>
44-Pin Demo Board Lessons
PCLATH
8 7
PCL
8
0
ALU Result
Instruction with
Destination
PCL as
DS41296B-page 33

Related parts for DM164120-2