28123 Parallax Inc, 28123 Datasheet - Page 183

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
Parts and Circuit for Displaying Digits
Same as previous activity
Programming On/Off Patterns Using Binary Numbers
In this activity, you will experiment with the variables
that controls the direction (input or output) of I/O pins P8 through P15.
high or low signals that each I/O pin sends. As you will soon see,
useful because you can use it to set the high/low signals at eight different I/O pins at once
with just one command. Here is an example program that shows how these two variables
can be used to count from 0 to 9 on the 7-segment LED display without using
LOW
Example Program: DisplayDigits.bs2
This example program will cycle the 7-Segment LED display through the digits 0
through 9.
' What's a Microcontroller - DisplayDigits.bs2
' Display the digits 0 through 9 on a 7-segment LED display.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program Running!"
OUTH = %00000000
DIRH = %11111111
'
OUTH = %11100111
PAUSE 1000
OUTH = %10000100
commands:
BAFG.CDE
8 bits: A binary number that has 8 digits is said to have 8 bits. Each bit is a slot where you
can store either a 1 or a 0.
A byte is a variable that contains 8 bits. There are 256 different combinations of zeros and
ones that you can use to count from 0 to 255 using 8 bits. This is why a byte variable can
store a number between 0 and 255.
Enter and run DisplayDigits.bs2.
Verify that the digits 0 through 9 are displayed.
' OUTH initialized to low.
' Set P8-P15 to all output-low.
' Digit:
' 0
' 1
DIRH
and
OUTH
.
OUTH
DIRH
OUTH
is especially
is a variable
controls the
HIGH
and

Related parts for 28123