TM1638 TITAN | Alldatasheet
Document overview
- Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
- PDF pages: 18
Technical content
Features
bits) Brightness adjustment circuit (8-level adjustable duty ratio) Serial interfaces (CLK, STB, DIO) Oscillation mode: RC oscillation Built-in power-on reset circuit Package type: SOP28 III. Pin definition:
www.titanmec.com V1.3 IV. Pin function: Symbol Pin Name Pin ID
Description
clock, starting from lower bits. Output serial data at falling edge of the clock, starting from lower bits. During output, this is a PMOS open drain output. CLK Clock input Read serial data at rising edge and output data at falling edge. STB Chip selection input Initialize the serial interface at falling edge, then wait to receive instructions. The first byte after STB becomes low is considered as an instruction. When an instruction is being processed, other current processes are terminated. When STB is high, CLK is ignored. keypad scanning signal input The data input into this pin is latched at the end of display cycle SGE1/KS1 SEG8/KS8 Output (segment) Segment output (also used as keypad scanning output). This is a PMOS open-drain output GRID1 GRID8 Output (bit) Bit output. This is an NMOS open-drain output. SEG SEG10 Output (segment) Segment output. This is a PMOS open drain output. VDD Logic Supply Power GND Logic GND 18,25 System GND Note: When DIO outputs data, it is an NMOS open drain outpu To read the keypad, an external pull-up resistor should be provided to connect 1K-10K. The Company recommends a 10K pull up resistor. At falling edge of the clock, DIO controls the operation of NMOS, at which point, the reading is unstable until rising edge of the clock.
www.titanmec.com V1.3 Instructions: The first byte input by DIO after the falling edge of STB is considered as an instruction. After decoding, obtain the topmost and bits to distinguish different instructions. Instruction Setting of Data Command Setting of Display Control Command Setting of Address Command If STB is set high during instruction or data transmission, serial communication is initialized, and the instruction or data being transmitted is invalid (but the instruction or data transmitted before remains active.) Setting of Data Command This instruction is used to set data writing and reading. Bits and cannot set to or 11. MSB LSB Function item, fill Setting of data read-write mode Write data to the display register Read key scanning data Sett address increment mode Auto increment Fixed address Test mode setting (for internal use) Normal mode Test mode Setting of Address Command MSB LSB Display address Unrelated item, fill 00H 01H 02H 03H 04H 05H 06H 07H 08H 09H 0AH 0BH 0CH 0DH 0EH 0FH
www.titanmec.com V1.3 This instruction is used to set the address of the display register. If the address is 10H or higher, data will be ignored until a valid address is set. On power-up, the address is set to 00H by default. Display control MSB LSB Function item, fill Set the number of extinction Set the pulse width to Set the pulse width to Set the pulse width to Set the pulse width to Set the pulse width to Set the pulse width to Set the pulse width to Set the pulse width to Setting of display switch Display Off Display ON VI. Address of display register: The register stores data transmitted through the serial interface from an external device to TM1638, or, to the address of bytes ranging from 00H-0FH, each corresponding to the LEDs connected with the chip SEG and GRID pins, as assigned below: LED display data are written in an ascending order of both display address and data byte. SEG1 SEG2 SEG3 SEG4 SEG5 SEG6 SEG7 SEG8 SEG9 SEG10 X X X X X X xxHL (low four) xxHU (high four) xxHL (low four) xxHU (high four) 00HL 00HU 01HL 01HU GRID1 02HL 02HU 03HL 03HU GRID2 04HL 04HU 05HL 05HU GRID3 06HL 06HU 07HL 07HU GRID4 08HL 08HU 09HL 09HU GRID5 0AHL 0AHU 0BHL 0BHU GRID6 0CHL 0CHU 0DHL 0DHU GRID7
www.titanmec.com V1.3 0EHL 0EHU 0FHL 0FHU GRID8 Figure (2) Note: The moment the display register of the chip is powered on, the values stored inside may be random, at which point, customers may directly send a command to turn on the screen. Messy codes are likely to appear. Considering that, the company advise customers to clear the display register upon power-on, i.e., writing 0x00 into all the 16-byte memory addresses (00H-0FH).
www.titanmec.com V1.3 VII. Display 1.Driving common cathode LEDs: Figure (7) Figure is a diagram for the wiring of common cathode LEDs. To display off the LED segment display, customers only need to write 0x3F to the 00H (GRID1) address starting from lower bits, at which point, 00H corresponds to the data in SEG1-SEG8 as shown in the table below. SEG8 SEG7 SEG6 SEG5 SEG4 SEG3 SEG2 SEG1 GRID1(00H) Driving common anode LEDs: Figure (8) Figure is a diagram for the wiring of common anode LEDs. To display off the LED segment display, customers only need to write O1H into 00H (GRID1), 02H (GRID2), 04H (GRID3), 06H (GRID4), 08H (GRID5),and 0AH (GRID6), and 00H into 0CH (GRID7) and 0EH (GRID8). SEG1-SEG8 correspond to the data table below. SEG8 SEG7 SEG6 SEG5 SEG4 SEG3 SEG2 SEG1 GRID1(00H) GRID2(02H) GRID3(04H) GRID4(06H) GRID5(08H)
www.titanmec.com V1.3 GRID6(0AH) GRID7(0CH) GRID8(0EH) Note: To drive common cathode LEDs or common anode LEDs, SEG pins can only be connected with LED anode, and GRID, only with LED cathode. Do not connect them in reverse direction. VIII. Keypad scanning and key combination: The keypad scanning matrix is 8bit, as shown in Figure (3) below: KS1 KS2 KS3 KS4 KS5 KS6 KS7 KS8 Figure (3) The storage address for keypad data is shown in (4). Upon a key reading command, the device starts to read key data BYTE1-BYTE4. Data already read will be output starting from lower bits. When a key corresponding to a pin of chips K and KS is pressed, the BIT corresponding to the byte is X X KS1 KS2 BYTE1 KS3 KS4 BYTE2 KS5 KS6 BYTE3 KS7 KS8 BYTE4 Figure (4) Note: TM1638 can be read up to four bytes only. Data are read in order from BYTE1to BYTE4 without skipping any byte. For example: When the key corresponding to and KS8 on a hardware, it is impossible to know the data unless and until the data from the key is read down to the fifth BIT of the forth byte. When two keys corresponding to and KS8 as well as and KS8 respectively are pressed simultaneously, the data read from and are at BYTE4. A combination key can only be formed on the same KS pins and different K pins. It is impossible to from a combination key on the same K pin but different KS pins. Keypad scan and combination keys:
www.titanmec.com V1.3 (1) Keypad scan: keypad scanning is automatically done by TM1638 without user control. User s only need to read key codes according to time sequence. It takes a display cycle to scan keypad and a display cycle takes about T 4.7ms. During this 4.7ms, if two different keys are pressed, the key code read in both times is the one of the key pressed first. (2) Combination keys Unusual problems with combination keys: SEG1/KS1-SEG8/KS8 are for combined use for display and keypad scanning. Take Figure (12) for example,to turn on and off, we have make sure SEG1 is in the status of "0" and SEG2, the status of "1". If and are pressed simultaneously, it is to the effect that SEG1 and SEG2 are short-circuited, then and are turned on. GRID1 SGE1/KS1 SGE2/KS2 Figure (12) Solution: In terms of hardware, it is advisable to arrange the keys to be pressed at the same time on different K line, as shown in F i g u re (13). SGE1/KS1 GRID1 GRID2 Figure (13) Series diodes are shown in Figure (14). GRID1 SGE1/KS1 SGE2/KS2 Figure (14) Note: It is recommend to form combination keys on the same KS but different Ks.
www.titanmec.com V1.3 IX. Transmission format of serial data: a BIT is read and received at rising edge of the clock. Data reception (write data) CLK DIO STB Figure (5) Data reading (read data) CLK STB Twait DIO 发读按键命令 读取按键数据 Figure (6) Note: When data is read, it takes a waiting time Twait (minimum μ from instruction setting at the eighth rising edge of the serial clock CLK to data reading at falling edge of the CLK. See the Timing Characteristics table for specific parameters. Send key reading command Read key data
www.titanmec.com V1.3 Transmission of serial data in application (1) Address increment mode If address automatically increments by the essence of address setting is to set the starting address where a data stream transmitted is stored. After the command word of the Starting Address has been sent, "STB" does not need to be set high to transmit data immediately thereafter, given BYTEs at most. It is advisable to set STB high after data transmission. Command1: Set data command Command2: Set display address Data1 Transmit display data to the Command3 address and the following addresses (16 bytes at most) Command3: Set display control command (2) Fixed Address Mode If fixed address mode is adopted, the essence of address setting is to set the address where BYTE data to be transmitted is stored. After transmission of address, it is not necessary to set "STB" high to transmit 1BYTE data immediately thereafter. It is advisable to set STB high after data transmission. Then users may set the address where the second data is stored. After transmission of date up to BYTES at most, "STB" is set high. Command1: Set data command Command2: Set display address1 Data1: Transmit display data to Command3 address Command3: Set display address Data2: Transmit display data to Command4 address Command4: Set display control command (3) Timing for key reading CLK DIO STB Com m and1 Data1 Data2 Data3 Data4 Command1: Set key reading command Data1 read key data
www.titanmec.com V1.3 (4) Flowchart for program design in the modes of auto address increment by and fixed address: Flowchart for program design in the mode of auto address increment by S t a r t I n i t i a l i z a t i o n S e t c o m m a n d f o r w r i t i n g d a t a i n t o d i s p l a y m e m o r y i n t h e m o d e o f a u t o a d d r e s s i n c r e m e n t b y H S e t s t a r t i n g a d d r e s s C H T r a n s m i t d a t a H a v e t h e b y t e d a t a b e e n t r a n s m i t t e d T r a n s m i t t h e d i s p l a y c o n t r o l c o m m a n d t o s e t m a x i m u m b r i g h t n e s s F H S e t d a t a c o m m e n d f o r k e y r e a d i n g H R e a d t h e c o n t e n t s o f b y t e S a v e t h e k e y v a l u e i n t o t h e r e g i s t e r o f M C U H a s b y t e s b e e n r e a d I s a n y k e y p r e s s e d K e y p r o c e s s i n g p r o g r a m E n d N o N o N o Y e s Y e s Y e s Transmit data
www.titanmec.com V1.3 Flowchart for program design in the mode of fixed address: S t a r t I n i t i a l i z a t i o n S e t c o m m a n d f o r w r i t i n g d a t a i n t o d i s p l a y m e m o r y i n t h e m o d e o f f i x e d a d d r e s s H S e t s t a r t i n g a d d r e s s C H T r a n s m i t b y t e d a t a T r a n s m i t t h e d i s p l a y c o n t r o l c o m m a n d t o s e t m a x i m u m b r i g h t n e s s F H S e t d a t a c o m m e n d f o r k e y r e a d i n g H R e a d t h e c o n t e n t s o f b y t e S a v e t h e k e y v a l u e i n t o t h e r e g i s t e r o f M C U H a s b y t e s b e e n r e a d I s a n y k e y p r e s s e d K e y p r o c e s s i n g p r o g r a m E n d S e t a n e w a d d r e s s C H T r a n s m i t b y t e d a t a T r a n s i t t h e r e s t d a t a N o Y e s
www.titanmec.com V1.3 XI. Application Circuit: Hardware circuit diagram for TM1638 to drive a common cathode LED screen MCU
www.titanmec.com V1.3 Hardware circuit diagram for TM1638 to drive a common anode LED screen Note: During PCB board wiring, the filter capacitor between VDD and GND shall be placed as close as possible to TM1638 to strengthen the filtering effect. The three 100P capacitors connected to the three communication ports, DIO, CLK, and STB will reduce interference with the communication ports. Considering the turn-on voltage drop of blue digital led display is about 3V, the power supply for TM1638 should be 5V. MCU
www.titanmec.com V1.3 XII Electrical Parameters: Limit parameter (Ta Vss Parameter Symbol Scope Unit Logic Supply Voltage VDD -0.5 +7.0 V Logic input voltage VI1 -0.5 VDD 0.5 V LED Seg drives output current IO1 -50 mA LED Grid drives output current IO2 +200 mA Power loss PD 400 mW Operating temperature Topt -40 +80 Storage temperature Tstg -65 +150 Normal operating range (Ta -20 Vss Parameter Symbol Minimum Typical Maximum Unit Test Conditions Logic Supply Voltage VDD V High-level input voltage VIH 0.7 VDD VDD V Low-level input voltage VIL 0.3 VDD V Electrical Characteristics (Ta -20 VDD 4.5 5.5 Vss V Parameter Symbol Minimum Typical Maximum Unit Test Conditions SEG drives current draw Ioh1 mA SGE1 SEG10 Vo VDD-2V Ioh2 mA SGE1 SEG10 Vo VDD-3V GRID drives sink current IOL1 140 mA GRID1-GRID8 Vo=0.3V
www.titanmec.com V1.3 Output pull-down resistance RL K Ω Input current II μ A VI VDD VSS High-level input voltage VIH 0.7 VDD V CLK DI0 STB Low-level input voltage VIL 0.3 VDD V CLK DI0 STB Lagging voltage VH 0.35 V CLK DI0 STB Dynamic current loss IDDdyn mA No load, Display Off Switching Characteristics (Ta -20 VDD 4.5 5.5 Parameter Symbol Minimum Typical Maximum Unit Test Conditions Oscillation frequency fosc 500 KHz R 16.5 K Ω Transmission delay time tPLZ 300 ns CLK DIO tPZL 100 ns CL 15pF, RL 10K Ω Rise Time TTZH μ s CL 300p F SEG SEG10 Fall Time TTHZ 120 μ s CL 300pF SEGN GRIDN Maximum clock frequency Fmax MHz Duty ratio=50% Input capacitance CI pF
www.titanmec.com V1.3 Timing Characteristics (Ta -20 VDD 4.5 5.5 Parameter Symbol Minimum Typical Maximum Unit Test Conditions Clock pulse width PWCLK 400 ns Strobing pulse width PWSTB μ s Data setup time tSETUP 100 ns Data Hold Time tHOLD 100 ns CLK STB time tCLK STB μ s CLK STB Waiting time tWAIT μ s CLK CLK Timing Waveforms:
www.titanmec.com V1.3 XIII. Package size Package size for SOP28 e b D E A L C θ Symbol Unit: mm Unit: Inch Minimum Maximum Minimum Maximum A 2.350 2.65 0.093 0.104 0.10 0.3 0.004 0.012 2.290 2.5 0.090 0.098 b 0.330 0.51 0.013 0.020 c 0.204 0.33 0.008 0.013 D 17.70 18.10 0.697 0.713 E 7.40 7.70 0.291 0.303 10.21 10.61 0.402 0.418 e 1.270(BSC) 0.050(BSC) L 0.4 1.27 0.016 0.050 θ All specs and
applications
notice.