MAX6954是一個(gè)通用顯示驅(qū)動(dòng)器,能夠通過(guò)一個(gè)串口控制多個(gè)分立、7段、14段或16段LED顯示器。本篇應(yīng)用筆記介紹驅(qū)動(dòng)8位單色、16段LED顯示器的典型應(yīng)用與配置。
有關(guān)MAX6954的詳細(xì)信息請(qǐng)參考MAX6954的數(shù)據(jù)資料。
應(yīng)用筆記"快速入門(mén): 使用MAX6954驅(qū)動(dòng)7段LED顯示器" 和"快速入門(mén): 使用MAX6954驅(qū)動(dòng)14段LED顯示器" 與本文類(lèi)似,分別介紹了如何配置MAX6954驅(qū)動(dòng)7段和14段顯示器。
MAX6954的一個(gè)常見(jiàn)應(yīng)用是驅(qū)動(dòng)多達(dá)8位的16段單色LED。本篇應(yīng)用筆記指導(dǎo)用戶(hù)如何連接MAX6954與16段顯示器,以及如何配置其內(nèi)部寄存器控制顯示內(nèi)置字模中的104個(gè)字符。
MAX6954使用一種交替改變驅(qū)動(dòng)器端口極性的復(fù)用技術(shù)來(lái)減少引腳數(shù)目。這與驅(qū)動(dòng)器陰極和陽(yáng)極引腳單獨(dú)使用的標(biāo)準(zhǔn)LED復(fù)用連接方式不同。應(yīng)用筆記"Charlieplexing - Reduced Pin-Count LED Display Multiplexing"對(duì)這一技術(shù)進(jìn)行了討論。表1為MAX6954與16段顯示器的連線(xiàn)表,此表兼容于MAX6954的復(fù)用配置及其104個(gè)字符的內(nèi)置字模。表1中的字母對(duì)應(yīng)于圖2中的段標(biāo)識(shí)。圖1為MAX6954驅(qū)動(dòng)八位16段顯示器的電路示意圖。
放大顯示
圖1. MAX6954 16段顯示應(yīng)用電路
圖2. 16段顯示器的段標(biāo)識(shí)
表1.與八位16段顯示器連線(xiàn)表
DIGIT | O0 | O1 | O2 | O3 | O4 | O5 | O6 | O7 | O8 | O9 | O10 | O11 | O12 | O13 | O14 | O15 | O16 | O17 | O18 |
0 | CCO | -- | a1 | a2 | b | c | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
1 | -- | CC1 | a1 | a2 | b | c | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
2 | a1 | a2 | CC2 | -- | b | c | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
3 | a1 | a2 | -- | CC3 | b | c | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
4 | a1 | a2 | b | c | CC4 | -- | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
5 | a1 | a2 | b | c | -- | CC5 | d1 | d2 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
6 | a1 | a2 | b | c | d1 | d2 | CC6 | -- | e | f | g1 | g2 | h | i | j | k | l | m | dp |
7 | a1 | a2 | b | c | d1 | d2 | -- | CC7 | e | f | g1 | g2 | h | i | j | k | l | m | dp |
完成MAX6954與16段顯示器連線(xiàn)后,可利用顯示測(cè)試模式檢查連線(xiàn)正確性。顯示測(cè)試模式不受控制和數(shù)據(jù)寄存器影響,點(diǎn)亮顯示器所有的段,但不改變?nèi)魏渭拇嫫鲀?nèi)容。向寄存器0x07寫(xiě)入0x01啟動(dòng)顯示測(cè)試模式。測(cè)試模式下顯示器如果有不亮的段則說(shuō)明連線(xiàn)有誤。向寄存器0x07寫(xiě)入0x00退出顯示測(cè)試模式。
完成連線(xiàn)檢查后,需要按驅(qū)動(dòng)16段顯示器的要求設(shè)置MAX6954寄存器值。表2包括MAX6954一些重要寄存器的上電初始值。MAX6954初次上電時(shí)處于關(guān)斷模式,各位顯示消隱,選擇16段字模并將掃描位數(shù)設(shè)為最大,即八位。譯碼模式寄存器(0x01)和數(shù)字類(lèi)型(0x0C)的默認(rèn)值適用于16段顯示器。
圖3. 16段顯示字模
表2. MAX6954上電后寄存器初始狀態(tài)
REGISTER | POWER-UP CONDITION | ADDRESS (HEX) |
REGISTER DATA | |||||||
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | |||
Decode Mode | 16-segment font enabled | 0x01 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Global Intensity | 1/16 (minimum intensity) | 0x02 | X | X | X | X | 0 | 0 | 0 | 0 |
Scan Limit | Display eight 16-segment digits: 0, 1, 2, 3, 4, 5, 6, 7 | 0x03 | X | X | X | X | X | 1 | 1 | 1 |
Control Register | Shutdown enabled, blink disabled, blink speed is slow | 0x04 | 0 | 0 | X | X | 0 | 0 | 0 | 0 |
Display Test | Normal operation (display test disabled) | 0x07 | X | X | X | X | X | X | X | 0 |
Digit Type | Digits 0 through 7 are 16 segment digits | 0x0C | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Intensity10 | 1/16 (min on), digits 1 and 0 | 0x10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Intensity32 | 1/16 (min on), digits 3 and 2 | 0x11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Intensity54 | 1/16 (min on), digits 5 and 4 | 0x12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Intensity76 | 1/16 (min on), digits 7 and 6 | 0x13 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Digit 0 | Blank digit, both planes | 0x60 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 1 | Blank digit, both planes | 0x61 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 2 | Blank digit, both planes | 0x62 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 3 | Blank digit, both planes | 0x63 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 4 | Blank digit, both planes | 0x64 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 5 | Blank digit, both planes | 0x65 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 6 | Blank digit, both planes | 0x66 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
Digit 7 | Blank digit, both planes | 0x67 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
配置寄存器(0x04)用來(lái)設(shè)置進(jìn)入和退出關(guān)斷模式,控制閃爍功能,全局清除各位數(shù)據(jù),以及選擇對(duì)各位亮度進(jìn)行全局還是單獨(dú)控制。配置寄存器包含7位(見(jiàn)表3)。
- S 位用來(lái)選擇關(guān)斷模式還是正常工作模式(讀/寫(xiě))。
- B 位用來(lái)選擇閃爍速率(讀/寫(xiě))。
- E 位用來(lái)全局啟動(dòng)或禁止閃爍功能(讀/寫(xiě))。
- T 位用來(lái)復(fù)位閃爍時(shí)序(此數(shù)據(jù)不被存儲(chǔ)―瞬態(tài)位)。
- R 位用來(lái)全局清除所有顯示位對(duì)應(yīng)的P0和P1兩級(jí)寄存器(此數(shù)據(jù)不被存儲(chǔ)―瞬態(tài)位)。
- I 位用來(lái)選擇對(duì)各位亮度進(jìn)行全局還是單獨(dú)控制(讀/寫(xiě))。
- P 位用來(lái)返回當(dāng)前閃爍時(shí)序相位(只讀―向此位寫(xiě)入值將被忽略)。
CONFIGURATION REGISTER DATA BIT |
DATA BIT LABEL |
STATE | FUNCTION |
D7 | P | 0 | P1 Blink Phase |
1 | P0 Blink Phase | ||
D6 | I | 0 | Intensity for all digits is controlled by one setting in the Global Intensity Register |
1 | Intensity for digits is controlled by the individual settings in the Intensity10 through Intensity76 registers. | ||
D5 | R | 0 | Digit data for both planes P0 and P1 are unaffected |
1 | Digit data for both planes P0 and P1 are cleared on the rising edge of active-low CS | ||
D4 | T | 0 | Blink timing counters are unaffected. |
1 | Blink timing counters are reset on the rising edge of active-low CS. | ||
D3 | E | 0 | Blink function disabled |
1 | Blink function enabled | ||
D2 | B | 0 | Slow Blinking. Segments blink on for 1s, off for 1s with fOSC = 4MHz. |
1 | Fast Blinking. Segments blink on for 0.5s, off for 0.5s with fOSC = 4MHz. | ||
D1 | X | X | Don't care |
D0 | S | 0 | Shutdown |
1 | Normal Operation |
通過(guò)向寄存器0x04寫(xiě)入0x01啟動(dòng)顯示器驅(qū)動(dòng)器,同時(shí)將工作方式設(shè)置為全局亮度控制、禁止閃爍。內(nèi)部振蕩器在MAX6954退出關(guān)斷模式時(shí)啟動(dòng),振蕩器輸出引腳為OSC_OUT。注意,數(shù)據(jù)控制寄存器0x60至0x67上電狀態(tài)為0x20或沒(méi)有段被點(diǎn)亮?xí)r,16段顯示器保持顯示消隱(見(jiàn)表2和圖3)。
MAX6954內(nèi)置了用于16段顯示器的104個(gè)字符的ASCII字模圖。字符為標(biāo)準(zhǔn)ASCII字模加和這些常用符號(hào)。用7位表示這104個(gè)字符,第8位用于選擇是否點(diǎn)亮小數(shù)點(diǎn)(DP)(見(jiàn)表4)。數(shù)據(jù)寄存器有兩級(jí),P0和P1。每個(gè)顯示位用存儲(chǔ)器中的2字節(jié)表示,一個(gè)字節(jié)位于P0,另一個(gè)位于P1(見(jiàn)表7)。數(shù)據(jù)寄存器為映射地址方式,所以每位數(shù)據(jù)可在P0(寄存器0x20至0x27)中更新,也可在P1(寄存器0x40至0x47)中更新,還可以?xún)杉?jí)同時(shí)更新(寄存器0x60至0x67)。數(shù)據(jù)寄存器中的數(shù)據(jù)并不直接控制16段顯示器中各段的顯示。而是被用來(lái)尋址一個(gè)存儲(chǔ)著16段字模數(shù)據(jù)的字符發(fā)生器(見(jiàn)圖3)。寄存器數(shù)據(jù)低7位(D6至D0)用來(lái)從字模中選擇字符。最高位(D7)控制小數(shù)點(diǎn)(DP)顯示;置為1則顯示DP,置為0則不顯示DP。
表 4. 數(shù)字類(lèi)型數(shù)據(jù)寄存器格式
MODE | ADDRESS CODE (HEX) | REGISTER DATA | ||||||||
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | |||
16-segment mode, writing digit data to use font map data with decimal place unlit | 0x20 to 0x27 0x40 to 0x47 0x60 to 0x67 |
0 | Bits D6 to D0 select font character 0 to 127 | |||||||
16-segment mode, writing digit data to use font map data with decimal place lit | 0x20 to 0x27 0x40 to 0x47 0x60 to 0x67 | 1 | Bits D6 to D0 select font character 0 to 127 |
如果閃爍功能被配置寄存器閃爍使能位E(見(jiàn)表3)禁止,則P0中數(shù)據(jù)寄存器的數(shù)據(jù)被用作顯示器復(fù)用。而P1中數(shù)據(jù)寄存器的數(shù)據(jù)不被使用。如果閃爍功能被啟用,則交替使用P0和P1中的數(shù)據(jù)復(fù)用顯示器。P0和P1中的數(shù)據(jù)分別應(yīng)用于閃爍時(shí)鐘交替變化的不同相位,從而復(fù)用LED顯示器實(shí)現(xiàn)閃爍功能。
下面是一個(gè)利用MAX6954驅(qū)動(dòng)顯示八個(gè)字符,“MAXIM-IC”,的實(shí)例。設(shè)置配置寄存器禁止閃爍功能,這樣就可以通過(guò)向寄存器0x20至0x27寫(xiě)入數(shù)據(jù)來(lái)分別控制數(shù)據(jù)位0至7。使用圖3中的字模圖得到每個(gè)字符對(duì)應(yīng)的代碼。
表 5. MAXIM-IC顯示范例
REGISTER ADDRESS (HEX) |
DIGIT | CHARACTER | FONT MAP EQUIVALENT CODE | |
DECIMAL | HEX | |||
0x20 | 0 | M | 0100 1101 | 0x4D |
0x21 | 1 | A | 0100 0001 | 0x41 |
0x22 | 2 | X | 0101 1000 | 0x58 |
0x23 | 3 | I | 0100 1001 | 0x49 |
0x24 | 4 | M | 0100 1101 | 0x4D |
0x25 | 5 | - | 0010 1101 | 0x2D |
0x26 | 6 | I | 0100 1001 | 0x49 |
0x27 | 7 | C | 0100 0011 | 0x43 |
通過(guò)向寄存器0x02(全局亮度控制寄存器)寫(xiě)入數(shù)據(jù)來(lái)調(diào)節(jié)顯示亮度,亮度可在0x00(最小亮度,1/16的電流)和0xFF(最大亮度,15/16的電流)之間調(diào)節(jié)。也可以對(duì)每一位的亮度進(jìn)行單獨(dú)控制。關(guān)于顯示亮度調(diào)節(jié)和其它先進(jìn)特性(如GPIO和按鍵掃描)的詳細(xì)信息請(qǐng)參考MAX6954的數(shù)據(jù)資料。
表6. 快速入門(mén)例程指令集
REGISTER (HEX) |
COMMAND (HEX) |
FUNCTION |
0x07 | 0x01 | Enter display test mode |
0x07 | 0x00 | Exit display test mode |
0x04 | 0x01 | Exit shutdown mode, disable blinking and select global intensity control |
0x20 | 0x4D | Write "M" to digit 0 |
0x21 | 0x41 | Write "A" to digit 1 |
0x22 | 0x58 | Write "X" to digit 2 |
0x23 | 0x49 | Write "I" to digit 3 |
0x24 | 0x4D | Write "M" to digit 4 |
0x25 | 0x2D | Write "-" to digit 5 |
0x26 | 0x49 | Write "I." to digit 6 |
0x27 | 0x43 | Write "C" to digit 7 |
0x02 | 0xFF | Set globalk intensity to full-scale |
表7. MAX6954/MAX6955的部分寄存器地址圖
REGISTER | ADDRESS (COMMAND BYTE) | ADDRESS (HEX CODE) | |||||||
D15 | D14 | D13 | D12 | D11 | D10 | D9 | D8 | ||
Decode Mode | R/active-low W | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0x01 |
Global Intensity | R/active-low W | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0x02 |
Scan Limit | R/active-low W | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0x03 |
Configuration | R/active-low W | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0x04 |
Display Test | R/active-low W | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0x07 |
Digit Type | R/active-low W | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0x0C |
Intensity 10 | R/active-low W | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0x10 |
Intensity 32 | R/active-low W | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0x11 |
Intensity 54 | R/active-low W | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0x12 |
Intensity 76 | R/active-low W | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0x13 |
Digit 0 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0x20 |
Digit 1 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0x21 |
Digit 2 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0x22 |
Digit 3 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0x23 |
Digit 4 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0x24 |
Digit 5 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0x25 |
Digit 6 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0x26 |
Digit 7 Plane P0 | R/active-low W | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 0x27 |
Digit 0 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0x40 |
Digit 1 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0x41 |
Digit 2 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0x42 |
Digit 3 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0x43 |
Digit 4 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0x44 |
Digit 5 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0x45 |
Digit 6 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0x46 |
Digit 7 Plane P1 | R/active-low W | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0x47 |
評(píng)論
查看更多