28123 Parallax Inc, 28123 Datasheet - Page 195

TEXT WHAT'S A MICROCONTROLLER

28123

Manufacturer Part Number
28123
Description
TEXT WHAT'S A MICROCONTROLLER
Manufacturer
Parallax Inc
Type
Programmingr
Datasheet

Specifications of 28123

Style
Book
Title
What's a Microcontroller?
Contents
Whats a Microcontroller? Text
Product
Microcontroller Accessories
Core Processor
PIC16C57c
Flash
128 Bytes
Operating Supply Voltage
9 V
Board Size
31 mm x 16 mm
Lead Free Status / RoHS Status
Not applicable / Not applicable
P1. Use the Schematic from Figure 6-10 on page 172. To solve this problem, modify
E1. The first step for configuring
E2. The key to solving this problem is to draw out each letter and note which segments
DisplayDigitsWithLookup.bs2, using the letter patterns worked out in Exercise 1.
In the solution, the letters have been set up as constants to make the program more
intuitive. Using the binary values is fine too, but more prone to errors.
' What's a Microcontroller - Ch6Prj01_FishAndChips.bs2
' Use a lookup table to store and display digits with a 7-segment display.
' Spell out the message:
'{$STAMP BS2}
'{$PBASIC 2.5}
Letter LED Segments B A F G . C D E OUTL Value =
HIGH
and 13 get a "0", as shown. To configure
and 13 must be set as outputs by setting those bit to "1". 15 and 14 are configured
as inputs by placing zeroes in bits 15 and 14. The second step is to translate this to a
PBASIC statement.
must be lit. Place a 1 in every segment that is to be lit. Translate that to the binary
OUTH
OUTH = %00010101
Bit
OUTH
H
C
d
F
n
P
S
a
I
. So bits 8, 10, and 12 get set to "1". Then put a "0" for each
value.
15 14 13 12 11 10
all but d and e
0
e, f, a, b, c, g
b, c, d, e, g
f, e, b, c, g
a, f, g, c, d
a, f, e, d
a, f, e, g
0
e, g, c
f, e
0
1
0
1 1 1 1 0 1 0 1
0 1 1 0 0 0 1 1
1 0 0 1 0 1 1 1
0 1 1 1 0 0 0 1
1 0 1 1 0 1 0 1
0 0 1 0 0 0 0 1
0 0 0 1 0 1 0 1
1 1 1 1 0 0 0 1
0 1 1 1 0 1 1 0
1
FISH CHIPS And dIP
OUTH
9
0
8
1
From Figure 6-2, p. 160
is set to "1" in each bit position specified as
DIRH
Bit
DIRH
DIRH = %00111111
%11110101
%01100011
%10010111
%01110001
%10110101
%00100001
%00010101
%11110001
%01110110
, the specified pins, 8, 10, 12, 9, 11,
15 14 13 12 11 10
0
0
1
1
1
LOW
10 9
1 2
G F
E D
1
E
, so bits 9, 11,
F
Common
Common
Cathode
Cathode
D
8
3
G
9
1
A
7 6
4 5
C
A B
C DP
B
8
1

Related parts for 28123