27220 Parallax Inc, 27220 Datasheet - Page 188

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
Page 178 · StampWorks
For the counter program we initially want to use Hex (numeric) decoding for digits
0 – 2, blank digits 3 and 4, and set the decimal point to be on digit 2. The proper
configuration register value for this requirement is %00110001 (review the
configuration bit table above). The Update_Cfg subroutine handles sending the
configuration register to the MC14489.
The decimal point is controlled by one of the six nibble-sized registers passed to the
MC14489 for display. The position of the decimal point(s) – if used – is transmitted
using the Update_Segs subroutine along with the control values for each of the
display digits.
Most of the work takes place in the subroutine called Show_The_Money. When the
money count is less than 500, the value will be displayed on the 7-segment LEDs.
The routine scans through each digit of money and sends the digit position and value
(from the DIG operator) to the MC14489. Since the display shows dollars and cents,
the decimal point on the third digit is enabled.
When the value of money reaches or passes 500, the display will change to “FULL.”
This is accomplished by setting Banks 1 – 3 (digits 0 – 2) to Special Decode so that
the letters “U” and “L” can be displayed. The letter “F” is part of the hexadecimal
number set so Bank 4 (digit 3) is left in Hex Decode mode.
The main loop of the program is simple: it scans the switch inputs with Get_Coins
and updates the money count for each switch pressed. When the “bank” is full, the
program enters an infinite loop that toggles the display bit of the configuration
register; this is a simple way to flash the display without modifying display contents.
Challenge
Modify the code in Experiment #28 to display the input voltage on the seven-
segment displays.

Related parts for 27220