|
Home | AVR | FPGA | M680x | Zilog Z8 | Zilog Z80 | Hitachi SH | Transputer | Linux | DOS |
|
Z8 Multiplexed 12 digit LED display controller |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Z86E04, or Z86E08 micro-controller is used in this application to multiplex a 12 digit seven segment LED display. It can drive small calculator type displays or a large dual LED per segment display. If you happen to have an old LED calculator in the garage that doesn't work any more then pull out the display part and re-use it here. There is a restriction to the design through: the circuit can only drive seven segment type displays that can only show numbers 0 to 9. It is not a dot matrix LED display which can show an entire character set. However, the letters A to F have been implemented allowing hexadecimal data display. Using this schematic diagram shows a LED display taken from an old Texas Instruments calculator that had stopped working years ago. I don't know the part number to it but these things are all pretty much the same. Most other parts to the system can be acquired from the given chip manufacturers or their suppliers. I would like to add a small note on the BP5020 device though: It is produced by the company ROHM around a hybrid technology. It is a DC to DC converter using a switched mode method to manage the voltage drop and regulation. The entire package requires very little PCB real estate while very few external components. It has proved to be a useful solution to PSU problems on small electrical designs. Contents
The firmware has been written in assembler code to extract the most from the microprocessor. A lot of functionality has been included into the program with two main features, besides driving the LED displays:
The firmware also supports some pretty neat tricks to get it to do all the tasks required and still keep up with time while maintaining a flicker free display. For example it can continue to keeping count of the arriving digital clocks arriving at input CLOCK while interpreting data received through its software UART. On the prototype a 12 digit display is refreshed 125 times per second making it fast enough to limit the strobing effect when moved suddenly. Such a scan rate for a 12 digit display translates to each digit being lit for a period of 10.4 milliseconds. To light each digit in that time means a 20-bit data stream has to be clocked into the 20-bit driver/latch before 10.4 milliseconds is up. It actually does this in less than 300 microseconds. Even so it does not leave a lot of time to do much else. But there are tricks that can be applied in the software to extract that extra time from a very busy little microprocessor. The software has been written to exploit a 10MHz master clock driving the system. All delay counters and UART bit times have been calibrated to use this clock speed to its optimum (10MHz). ABOUT THE DISPLAY DEVICE The program will control a 20 bit latch/driver which in turn controls the LED segments and cathode digit selects. The software expects a "common cathode" type LED multiplexed display to be the display device. In order to display different data in each digit requires that the digits be multiplexed. This means one digit is given its segments to light while all others are turned off. Then a little bit later the next digit gets its chance to light its segments and so on until all 12 digits have been displayed. After that it is all repeated again and again. To set the Decimal Point on a digit, or many digits, of the display can be achieved through setting up the DP place through the UART then switching the display mode back to counter/latch mode. In counter latch mode "leading zero suppression" is active meaning that all zeros left of the current count will be blanked out. Its similar to using a calculator. The result "1245" shows as "1245" and not "00000001245". The later is how the actual count is representation in memory so the computer does a bit of filtering for our benefit. CLOCK/COUNTER DIGIT INPUT The program also accepts raw digital controls into the "LATCH", "CLOCK", "RESET" and "BLANK" inputs. These control the counters in CPU memory in a serial method. The clock input directly drives the internal counter to allow counts up to 500KHz to be captured. Anything faster than this will be lost and you may have to place a prescaler circuit in the clock circuit. There is a prescaler on Timer/counter #1 which is not used here and that can be set to a maximum of 64 counts, the clock frequency can then be increased to 500K*64=32MHz before clocks begin to be lost. However, there is a limit of 10MHz demanded by the z8's counters and silicon design. SOFTWARE UART To change all digits quicker can be achieved by delivering data through the software UART. A special control packet is set up to ensure correct data is received and displayed. Once data begins to roll in through the serial UART then data from "CLOCK" is not shown on the display, however, the received clocks are still counted and stored away. The UART can instruct this software to revert back to the CLOCK/COUNTER mode with a single command within the packet ('+') or a reset pulse on the "RESET" input. Using the UART to control the display is simple, it can set any digit with any display data you like. 14 bytes are all that is required to fill out the complete display. At 2400bps this would take 40mS to complete. Z8 (86E04/8) pin allocations are:
CPU FUNCTIONAL BLOCK RESOURCE ALLOCATION
UART COMMUNICATION PROTOCOL and CONTROL CODES
Using the communications into the device with this protocol is simple. Every communication begins with a [SOH] character and ends by a [CR] character. There does not have to be anything in-between, or there can be a million characters in-between. However, to get something meaningful shown on the display requires there to be present in the middle some control codes as shown in this table. Remember that at the moment a [SOH] character is received the operating mode of the controller will flip over to display mode. The digital counter will have no effect on displayed data, even though the counter is still running and registering clocks. Another point to keep in mind is that the digit pointer is always reset to position zero (0). It is the right most digit on the display so feeding numbers into the display goes in backwards. i.e.: The rightmost digit (unit) is first into the controller. DETERMINE CONTROL RESPONSE This packet will force the controller to say something. It can be very useful in determining in the controller is plugged in and still working. Places to use this type of feature is in systems that "auto-detect" their hardware and peripheral list. [SOH][PING][CR] response from controller is [PINGRSP] CLEAR ALL DIGITS TO BLANK This packet will remove all displayed data from the display, accept the decimal points and commas. [SOH][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][BLNK][CR]
LOAD DISPLAY WITH VARIABLE LENGTH DIGIT This packet will display the number "3210" on the display. All digits are right justified. [SOH]['0']['1']['2']['3'][CR] PLACE DECIMAL POINT AT SECOND DIGIT FROM RIGHT This packet is going to set the decimal point at the second digit from the right and the flick the operating mode over to counter/latch. The data displayed at any digit is of no concern since the mode switch will lock onto the current counter value in memory. [SOH][['0']['0'][DP][RS][CR] CLEARING DP and COMMA settings If your displays has filled up with randomly placed decimal points or commas then it can be cleared away using a packet like this one. [SOH][ND][ND][ND][ND][ND][ND][ND][ND][ND][ND][ND][ND][CR] Data Sheets for chips used in this design:
The source code can be compiled using Zilog's Z8 CCP Emulator (Order code: Z86CCP00ZEM) downloadable from www.zilog.com. To program the Z86E04, or Z86E08 you will need to get a hold of a blank chip and a programmer. Zilog also provides these in at least one form: Z8 CCP Emulator (Order code: Z86CCP00ZEM)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This page was last updated: Friday, February 07, 2003 14:45 Au EST.
Copyright © C.A.T.E 2001-02