27220 Parallax Inc, 27220 Datasheet - Page 80

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
segment pattern on the anodes and then enabling the desired digit (by making its
cathode low).
It would be nice, though, if we could see all four digits at the same time. Well, we
can’t, but if we switch between them fast enough we can fool our eyes into thinking
that they are.
The human eye has a property known as
to hold an image briefly. The brighter the image, the longer it holds in our eyes. POV
is what causes us to see a bright spot in our vision after a friend snaps a flash photo.
We can use POV to our advantage by rapidly cycling through each of the four digits,
displaying the proper segments for that digit for a short period. If the cycle is fast
enough, the POV of our eyes will cause the all four digits to appear to be lit at the
same time. This process is called multiplexing.
Multiplexing is the process of sharing data lines; in this case, the segment lines to
the 7-segment displays. If we didn’t multiplex, 28 output lines would be required to
control four 7-segment displays. That’s 12 more lines than are available on the
BASIC Stamp module. To be honest, multiplexing in PBASIC is not terribly practical,
but it does allow us to gain an understanding of the process so that when we turn to
multiplexers for assistance (see Experiment #31), we are able to get the results we
desire.
The main loop of the program proceeds in three stages:
Note again how the modulus operator (//) is used to keep seconds in the range of 0
to 3599 (the number of seconds in one hour).
The real work in this experiment happens in the subroutine called Show_Clock. Its
purpose is to reformat the raw seconds into a time format (MMSS) and then update
the current digit. Since the routine can only show one digit at a time, it must be
called very frequently, otherwise display strobing will occur. As we saw earlier, the
main loop of the program does nothing but call this subroutine while waiting for the
Signal Generator input to change.
Display the current time while the signal generator input is high
Display the current time while the signal generator input is low
Update the seconds counter
Persistence of Vision
(POV), which causes it

Related parts for 27220