brief introduction
Users can use MAX7456 single-channel OSD generator to superimpose customized graphics on dynamic video. MAX7456 does not need external video driver, synchronous separator and video switch, which greatly reduces the system cost. The device provides 256 user-programmable monochrome characters with 525 and 625 line standards, which can serve all domestic and international markets. It can easily display information such as company logo, custom graphics, time and date in any font and size. This application note explains how to use MAX7456 to naturally customize characters and graphics. The file format of MAX7456 evaluation board (EV) is also explained.
MAX7456 memory organization structure
The user-defined character set is combined with the input video stream to generate CVBS and OSD video output. It can store up to 256 characters, 12 x 18 pixels, which can be set dynamically. In 525-line mode, display 13 lines of x 30 characters; In 625-line mode, 16 lines x 30 characters are displayed.
MAX7456 OSD contains two sets of memories: display memory and nonvolatile character memory (NVM).
Display memory
The display memory (SRAM) stores 480 character addresses, which "point" to the characters stored in the NVM character memory. Users can program the contents in the display memory through SPI. Compatible with serial interface. The display memory address corresponds to the fixed location of the monitor. Please refer to the following figure 1, each character needs two bytes. The first byte contains the number of characters in the character memory (refer to the discussion below); The second byte contains the character attribute status bit. As shown in Figure 2, the characters are sorted from left to right and from top to bottom.
Figure 1. Fixed location of display memory
Figure 2. Displays the character attribute status bits of memory.
Character memory
The nonvolatile character memory stores characters or graphic maps to be displayed. The contents in the character memory can be programmed by the user and adopt SPI-compatible serial interface. Each character contains 12 rows and x 18 columns of pixels. Each pixel contains two bits:
00 = dark black, opaque.
0 1 = transparent
10 = white, opaque
1 1 = transparent
Therefore, each character has 12 x 18 = 2 16 pixels. An 8-bit byte represents 4 pixels. Therefore, each character needs 2 16/4 = 54 bytes of data (see Figure 3).
For the convenience of addressing, the memory organization structure adopts 64-byte blocks. Every first 54 bytes represents a character. The remaining 10 bytes are not used. Therefore, the length of the character memory is 64×256 = 16384 bytes.
Therefore, the numerical value contained in each display memory address position is actually a 64-byte block address corresponding to the selected character.
Figure 3. Character storage configuration
Graphical user interface (GUI) software for evaluation board
MAX7456 evaluation board provides GUI software to support users to control devices and download customized graphics.
The organization structure of software-related files is similar to that of MAX7456 memory. Characters store data in one file and display stored data in another file. The file extension of these files is:
*.mdm display memory
*.mcm character memory
Windows? Text editors such as Notepad can view these ascii text files. Therefore, each line ends with a carriage return/line feed sequence of ASCII characters.
Displays the organization structure of memory files.
Figure 4 below shows. Displays the memory file.
Figure 4. Display memory organization structure
In Figure 4, the first line gives the device type: MAX7456. The second line gives the video standard: PAL or NTSC. The third line shows the file name of the related character file: Duck.mcm, and the fourth line and the following lines are line pairs, giving the characters in various positions on the screen, as shown in the above figure 1.
Therefore, x is the position of the character in 438+0 in fig. 65, and the lines explaining this character are as follows:
N = 4+2 × x number of characters
N = 5+2 × x character attribute
Role attributes are shown in Figure 5:
Figure 5. Character attribute of character position in figure 1
In this example:
The character 0 on the display screen uses the character 1 in the character memory.
The character 0 is not blinking, inverted or transparent.
The character 1 on the display screen uses the character 2 in the character memory.
The character 1 is not blinking, inverted or transparent.
The character 2 on the display uses the character 2 in the character memory.
Character 2 is not blinking, inverted or transparent.
wait for
Please pay attention. The mdm file depends on the video standard. If PAL is selected, the file will contain 480 line pairs; In NTSC, the file contains 390 line pairs.
Organization structure of character storage file
Part of *. *. The mcm file is shown in Figure 6 below.
Figure 6. Display memory organization structure
The first line gives the device type. The second and subsequent rows define the pixels shown in Figure 3 above. In this example, each pixel of the character 0 is set to "0 1", that is, transparent.
Character storage description
It is not necessary to set every bit of the character 0 to "0 1". When the device is powered on, the display memory is reset, and then it is assumed to point to the character 0. Therefore, there is no wrong superimposed image in the transmitted input video when power is on. After the device is correctly initialized, the correct characters will be superimposed and displayed.
Why do pixels appear gray or transparent?
If a pixel is defined as transparent in the character memory ("0 1" or "1 1" in the memory), it can be displayed as transparent or gray according to other conditions.
There are three situations that affect pixels:
The character level is defined by the attribute bits of each character set in the display memory. The global level is defined in the background bit (bit 7, Register 0 1) of the video mode register. The status of the external synchronization detector.
This bit can also be transparent, depending on the status of input video synchronization detection. The truth table is shown in table 1, assuming that pixels are defined as transparent at the pixel level. If it is opaque, the pixel will appear as dark black or white, regardless of any other settings, assuming, of course, that the OSD display is on.
Table 1. External synchronous detection of character attributes of gray pixels
(1 = Yes, 0 = No) Global Background Mode Character Level Attribute Pixel Appearance
0 X X gray
1 0 0
1 0 1
1 1 X gray
If a pixel is displayed in gray, its brightness can be set line by line through registers Rbo to RB 15 at address positions 90H to 9FH.
Convert pixel colors in character memory files
After understanding the structure of the evaluation board file, you can easily convert pixels into dark black, white or transparent.
Excel and other programs can easily convert character memory files. Figure 7 below shows an example. When loading the evaluation board software, its subtitles are as follows.
Figure 7. Changing the character memory with Excel can change the color of pixels.
Letters are displayed in dark black on a white background. There is a simple way to convert this color scheme.
Load. Mcm file is imported into Excel. As a text file, you can open the. Mcm file. Remember that lines must be treated as text, otherwise leading zeros will be deleted. Therefore, during the import process, the column data format is set to text. In order to protect the format, it is best to copy the numeric column into the new table. Use the Excel MID function to divide the line into 4 x 2 characters. In this way, two character values are converted. Rebuild the line. Replace the columns in the original file with the merged columns and save them. To test the results, load a new. Import mdm file into evaluation board software.
In this example, all dark black characters are converted to white, and all white characters are converted to transparent. Like this:
"00" became "10"-dark black turned white.
"10" changes to "01"-white changes to transparency.
"0 1" remains unchanged-the transparency remains unchanged.
It is easy to realize color conversion in Excel. The results are returned to the original file to save the format.
Excel formula is relatively simple, as shown below, column A is the original data.
Column b = MID(Ax, 1, 2) Select two characters starting from the character 1.
C column = MID(Ax, 3, 2) Select the first two characters of character 3.
Column d = MID(Ax, 5, 2) selects the first two characters of character 5.
E column = MID(Ax, 7, 2) Select the first two characters of character 7.
Column f = if (bx = "00 ","10 ",if (bx =" 10 ","0 1 ",bx))
G column = if (CX = "00 ","10 ",if (CX =" 10 ","0 1 ",CX))
Column h = if (dx = "00 ","10 ",if (dx =" 10 ","0 1 ",dx))
Column I = if (ex = "00 ","10 ",if (ex =" 10 ","0 1 ",ex))
Replace "00" with "10" or "10" with "0 1"
J column = CONCATENATE(F2, G2, H2, I2) Rebuild new words.
The j column is copied to the original file and saved in the save format (Figure 8).
Figure 8. The above formula is used to convert pixel colors in Excel.
Once the evaluation board software is loaded, the new file is shown in Figure 9.
Figure 9. Pixel color changed in Excel.
You can download AN4 1 17.zip, and find the Excel table above and the related documents of the evaluation board.
SPI is a trademark of Motorola.
Windows is a registered trademark and service mark of Microsoft Corporation.
Correlation model
MAX7456 single-channel monochrome screen display with integrated EEPROM.