摘要
This application note describes a PC program, downloadable free, to assist design, evaluation, font design with MAX6952 and MAX6953 5x7 matrix LED display drivers.
The MAX6952 and MAX6953 are 4-digit common-row 5x7 matrix LED display drivers that are controlled through a high speed SPI™ (MAX6952) or I²C (MAX6953) serial interface. This application note describes a utility program which allows a MAX6952 or MAX6953 driver to be controlled from a PC. The utility can be used standalone simply to help an engineer familiarize himself or herself with the registers and functions of the drivers. More usefully, it can be used to "prove" a display board prototype by directly controlling the MAX6952 or MAX6953 registers before the equipment's software is designed.
Requirements
A PC running Windows® 95, 98, 98SE, ME, NT, or 2000 with a parallel printer port configured for either LPT1 or LPT2.
Description
The utility is a Visual Basic 5 program called MAX6952.EXE which requires the standard Visual Basic run time library MSVBVM50.DLL in order to run at all. The program uses the DriverLINX™ freeware parallel port driver DLPortIO.DLL which provides the Win32 DLL hardware I/O functions not available as standard in Visual Basic. Windows NT and 2000 users also require the DLPortIO.SYS kernel mode driver. Both of these drivers are copyright Scientific Software Tools, Inc. (http://www.driverlinx.com).
Installation
To install to a Windows 95, 98, 98SE, ME platform, download the MAX6952-95.EXE file. This is a WinZIP self-extracting archive that contains ReadMe.txt, ReadMeSST.txt, MAX6952.EXE, DLPortIO.DLL, and MSVBVM50.DLL. The default download directory is C:MAX6952. MSVBVM50.DLL may be deleted if the library is already registered on the computer.
To install to a Windows NT or 2000 platform, download the MAX6952-NT.EXE file. This is a WinZIP self-extracting archive that contains ReadMe.txt, ReadMeSST.txt, MAX6952.EXE, PORT95NT.EXE, and MSVBVM50.DLL. The default download directory is C:MAX6952. PORT95NT.EXE is the install program for the DriverLINX drivers which installs and registers the DLPortIO.DLL library and DLPortIO.SYS driver. PORT95NT.EXE can be deleted after installation. Windows 95, 98, 98SE, ME users can also use this installation procedure if they wish.
Source Code
The source code for this application note is available http://www.maximintegrated.com/products/display/software/.
Connecting a MAX6952 or MAX6953 to the Parallel Port
This utility uses 3 of the 8 parallel port printer output lines to simulate SPI serial interface activity, and another 2 output lines to simulate I²C serial interface activity. A parallel port control input line is additionally used to read back blink status. You may operate multiple (up to 16, daisy-chained) MAX6952s and/or multiple (up to 16, configured with different I²C addresses) MAX6953s at once. You may select either LPT1 or LPT2 port from the software. The port can be a standard, ECP, or EPP type. The port connections are shown in Figure 1.
Figure 1. MAX6952 or MAX6953 connections to the parallel port.
The program display on start up is shown in Figure 2 below. The register defaults mirror the register power-up conditions of the MAX6952 and MAX6953. The "Driver type" radio buttons select whether the software will transmit to MAX6952 (using the SPI connection) or the MAX6953 (using the I²C connection).
Figure 2. Program display on startup.
In SPI mode, the software controls up to 16 MAX6952 drivers. The drivers are presumed to be cascaded, i.e. the DOUT pin of the first MAX6952 connects to the DIN pin of the second MAX6952, whose DOUT pin connects to the DIN pin of the third MAX6952 (and so on). The total number of MAX6952 devices is set by the "Number of Drivers" slider. When this is set to more than 1, the "Enable global driver write" and "Enable auto-increment" check boxes are available. When "Enable global driver write" is clear, only the MAX6952 driver selected by the "Current Driver" slider is written to when a write command is selected, the others receive the no-op instruction. When "Enable global driver write" is checked, all the MAX6952 drivers are written to with the same data. When "Enable auto-increment" is checked, the current driver number is automatically incremented after each write action. This allows the user to quickly send the same data to a series of MAX6952 drivers.
The SPI interface connection to the parallel port can be tested with the "Test Stream" facility which can be found under "Port Connections and Help..." when the program is running. The "Test Stream" facility transmits the no-op instruction continuously to the MAX6952(s) (as set by the "Number of Drivers" slider) allowing the interface connections to be verified without affecting register contents.
In I²C mode, the software controls up to 16 MAX6953 drivers. The first driver is presumed to be set to address 1010000x, with the addresses of subsequent devices increasing to 1011111x for the last device. To access, for example, a single MAX6953 driver at address 1011111x, simply set the "Number of Drivers" slider to 16 and then the "Current Driver" slider to 16, address 1011111x. The main form in I²C mode is shown in Figure 3.
Figure 3. I²C program display.
The I²C interface connection to the parallel port can be tested with the "Test Stream" facility which can be found under "Port Connections and Help..." when the program is running. The "Test Stream" facility transmits the no-op instruction continuously to all MAX6953(s) (as set by the "Number of Drivers" slider) allowing the interface connections to be verified without affecting register contents.
The "Design User Fonts..." button brings up a form to allow the user to load from disk, create, and save to disk the 24 user-definable fonts that the MAX6952 and MAX6953 can store. The form is shown in Figure 4. The software comes with some pre-defined fonts in the file MAX6952-3_fonts.txt. These fonts are shown in Figure 4. The fonts can be changed by clicking pixels with the mouse. Clicking a pixel toggles it's condition. The user-definable fonts are stored in memory, and are not automatically sent to the MAX6952 and MAX6953 drivers. The fonts can be transmitted to any or all drivers from the main menu. It is possible to send different user-definable fonts to each driver, if desired.
Figure 4. Designing user definable fonts.
The format of the data in the file MAX6952-3_fonts.txt is shown in Figure 5. The software searches for a line starting "Font xx" where xx is a one or two digit decimal number ranging from 0 to 23 identifying the font. Up to seven lines starting "Data" are parsed for an 8 bit binary word, MSB to LSB, which describe the font character. The file can contain the data for as few or as many font characters are desired. When the file is read, the on screen patterns for characters omitted from the file are not cleared or overwritten.
The program saves the data in order Font 0 to Font 23, and it is therefore in the same order as required to write sequentially to a MAX6952 or MAX6952. Therefore the MAX6952-3_fonts.txt file data can be taken with minimum edits for inclusion in a user's application code.
Font 0
Data 00011100
Data 00011100
Data 00011100
Data 00011100
Data 00011100
Font 1
Data 01111111
Data 01111111
Data 00111110
Data 00011100
Data 00001000
Font 2
Data 00000000
Data 00000000
Data 01111111
Data 00000000
Data 00000000
...
Figure 5. Example user definable font data format