HT8 MCU Integrated LCD Application Example (2) C Type Bias D/N: AN0413E Introduction The Holtek LCD type MCUs provide four LCD driving schemes including the R type, C type, SCOM type as well as SCOM and SSEG type, each of which has its own features. This article will use the BS67F350 microcontroller as a model to show how to use the C type LCD driver through a specific example. Functional Description The nature of LCD require that only AC voltages can be applied to their pixels as the application of DC voltages to LCD pixels may cause permanent damage. For this reason the relative contrast of an LCD display is controlled by the actual RMS voltage applied to each pixel, which is equal to the RMS value of the voltage on the COM pin minus the voltage applied to the SEG pin. This differential RMS voltage must be greater than the LCD saturation voltage for the pixel to be on and less than the threshold voltage for the pixel to be off. So the LCD driver needs several voltage levels to generate the time and amplitude varying signals. The bias voltage of the C type LCD driver will be generated by an internal charge pump. VDD or VDD or VDD or ==3/2* == ==3* == ==2/3* ==2* ==1/2* ==1/3* == Power Supply from pin Power Supply from pin Power Supply from pin Note: The pin must be connected to the maximum voltage to prevent from the pad leakage. C Type Bias External Power Supply Scheme 1/3 Bias AN0413E.00 1 / 10 December 11, 2016
VDD or VDD == ==3/2* ==3* ==2/3* VDD == ==2* ==1/3* ==1/2* VREFIN == Power Supply from Power Supply from Power Supply from Note: The pin must be connected to the maximum voltage to prevent from the pad leakage. C Type Bias Internal Power Supply Scheme 1/3 Bias Operating Principles An area of Data Memory is especially reserved for use for the LCD display data. This data area is known as the LCD Memory. Any data written here will be automatically read by the internal display driver circuits, which will in turn automatically generate the necessary LCD driving signals. Therefore any data written into this Memory will be immediately reflected into the actual display connected to the microcontroller. As the LCD Memory addresses overlap those of the General Purpose Data Memory, it is stored in its own independent Sector 4 area. The Data Memory sector to be used is chosen by using the Memory Pointer high byte register, which is a special function register in the Data Memory, with the name, MP1H or MP2H. To access the LCD Memory therefore requires first that Sector 4 is selected by writing a value of 04H to the MP1H or MP2H register. After this, the memory can then be accessed by using indirect addressing through the use of Memory Pointer low byte, MP1L or MP2L. With Sector 4 selected, then using MP1L or MP2L to read or write to the memory area, starting with address 00H for all the devices, will result in operations to the LCD Memory. Directly addressing the LCD Display Memory can be implemented using the extended instructions for the full range address access. The accompanying LCD Memory Map diagrams shows how the internal LCD Memory is mapped to the Segments and Commons of the display for the devices. 00H 01H 02H 03H b3 b2 b1 b0 SEG 0 SEG 1 SEG 2 SEG 3 1CH 1DH 1EH 1FH SEG 28 SEG 29 SEG 30 SEG 31 COM 0 COM 1 COM 2 COM 3 32 SEG x 4 COM BS67F350 LCD Memory Map AN0413E.00 2 / 10 December 11, 2016
The best frame frequency is in the range of 25Hz~250Hz. If a higher frequency is provided, it will lead to an increase in the driver power consumption while if too low a frequency is used, it will result in display flickering. The LCD clock source is the internal clock signal, f SUB, divided by 8 using an internal divider circuit. The f SUB internal clock is supplied by either the LIRC or LXT oscillator, the choice of which is determined by a software control bit. For proper LCD operation, this arrangement is provided to generate an ideal LCD clock source frequency of 4kHz. There are control registers, named as LCDC0 and LCD, in the Data Memory which is used to control the various setup features such as LCD wave type, bias type, supply power selection, total bias resistor selection together with the overall LCD enable and disable control. The time and amplitude varying signals generated by the LCD Driver function require the generation of several voltage levels for their operation. For C type biasing, the C type bias voltage source is selected using the LCDP1 and LCDP0 bits in the LCDC0 register. When the LCDP1 and LCDP0 bits are set to 00, the LCD voltage source can be supplied on the external pin, or. When the LCDP1 and LCDP0 bits are set to 01, 10 and 11, the LCD voltage source can be derived from the internal voltage source. The C type biasing scheme uses an internal charge pump circuit which can generate voltages higher than what is supplied on or. This feature is useful in applications where the microcontroller supply voltage is less than the supply voltage required by the LCD. Additional charge pump capacitors must also be connected between pins and to generate the necessary voltage levels. For the C type 1/3 bias external power supply scheme, the LCD power can be supplied on, or pin. However, the LCD power is internally supplied on V A, V B or V C for the C type 1/3 bias internal power supply scheme. Four internally generated voltage levels V SS, V A, V B and V C are utilised. These bias voltages have different levels depending upon different LCD power supply schemes. LCD Power Supply V A Voltage V B Voltage V C Voltage External Power Supply Internal Power Supply V IN = V IN 2/3 V IN 1/3 V IN V IN = V 3/2 V IN V IN 1/2 V IN V IN = 3 V IN 2 V IN V IN V A = V DD V DD 2/3 V DD 1/3 V DD V B = V DD 3/2 V DD V DD 1/2 V DD V C = V REFIN 3 V REFIN 2 V REFIN V REFIN C Type Bias Power Supply Scheme AN0413E.00 3 / 10 December 11, 2016
The connection to the pin depends upon the LCD power supply scheme. It is extremely important to ensure that these charge pump generated internal voltages do not exceed the maximum V DD voltage of 5.5V Condition V DD > V 1.5 Otherwise Connection Connect to VDD Connect to C Type Bias Pin Connection The requirement to limit the DC voltage to zero and to control as many pixels as possible with a minimum number of connections requires that both a time and amplitude signal is generated and applied to the application LCD. These time and amplitude varying signals are automatically generated by the LCD driver circuits in the microcontroller. What is known as the duty determines the number of common lines used, which are also known as backplanes or COMs. The duty, which is to have a value of 1/4 and which equates to a COM number of 4, therefore defines the number of time divisions within each LCD signal frame. Two types of signal generation are also provided, known as Type A and Type B, the required type is selected via the TYPE bit in the LCDC0 register. Type B offers lower frequency signals, however, lower frequencies may introduce flickering and influence display clarity. AN0413E.00 4 / 10 December 11, 2016
LCD Display Off Mode COM0 ~ COM3 All sengment outputs Normal Operation Mode 1 Frame COM0 COM1 COM2 COM3 All segments are OFF COM0 side segments are ON COM1 side segments are ON COM2 side segments are ON COM3 side segments are ON COM0,1 side segments are ON COM0,2 side segments are ON COM0,3 side segments are ON (other combinations are omitted) All sengments are ON LCD Driver Output Type A, 1/4 Duty, 1/3 Bias AN0413E.00 5 / 10 December 11, 2016
LCD Display Off Mode COM0 ~ COM3 All sengment outputs Normal Operation Mode 1 Frame COM0 COM1 COM2 COM3 All segments are OFF COM0 side segments are ON COM1 side segments are ON COM2 side segments are ON COM3 side segments are ON COM0,1 side segments are ON COM0,2 side segments are ON COM0,3 side segments are ON (other combinations are omitted) All sengments are ON LCD Driver Output Type B, 1/4 Duty, 1/3 Bias AN0413E.00 6 / 10 December 11, 2016
When using a C type LCD driver, the setup steps are summarised in the following table: Step Operation Register Setting bits Functional Description 1 2 3 4 5 6 Set the pin-shared pin as a SEG pin LCD waveform type selection LCD bias type selection C type bias LCD power supply selection LCD function enable control LCD pixel light/dark control PXSn PXSnn Select SEG function LCDC0 LCDC0 LCDC0 LCDC0 TYPE: 0: Type A 1: Type B RCT: 0: R Type 1: C Type LCDP1~LCDP0: 00: From external pin, or 01: From internal reference voltage V REFIN supplied to 10: From internal voltage VDD supplied to 11: From internal voltage VDD supplied to LCDEN: 0: Disable 1: Enable Use LCD RAM data Select LCD waveform type Select LCD bias type Select C type bias LCD power supply Enable LCD function Control the LCD pixel on/off H/W Description 10uF VDD C3 C4 C5 1 2 3 C6 4 C0 5 6 7 C3 8 9 10 11 12 13 14 15 16 U1 PA1/CTP0_0/ PA5/CTP0_1/ PA6/CTCK0/INT0/ COM0 COM1 COM2 COM3 SEG31 SEG30 SEG29 SEG28 SEG27 SEG26 SEG25 SEG24 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 PA2/SCSB/OCDSCK PA0/SDO/OCDSDA PA3/XT1 PA4/XT2 VDD PB0/VREF/RESB/SDI/SDA/AN0 PB1/SCK/SCL/AN1 PB2/PTP0_0/PTP0I_0/TX/AN2 PB3/RX/AN3 PB4/PTP0_1/PTP0I_1/AN4/KEY1 PB5/STCK0/AN5/KEY2 PB6/PTCK0/AN6/KEY3 PB7/INT1/AN7/KEY4 SEG23 SEG22 SEG21 SEG20 SEG19 SEG18 SEG17 SEG16 SEG15 SEG14 SEG13 SEG12 SEG11 SEG10 SEG9 SEG8 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 PC0/KEY5 P/KEY6 P/KEY7 PC3/KEY8 PC4/KEY9 PC5/KEY10 PC6/KEY11 PC7/KEY12 SEG0 SEG1 SEG2 SEG3 SEG4 SEG5 SEG6 SEG7 48 47 46 45 44 43 42 41 40 S0 39 S1 38 S2 37 S3 36 S4 35 S5 34 S6 33 S7 COM0 1 C0 COM1 2 COM2 3 COM3 4 C3 SEG0 5 S0 SEG1 6 S1 SEG2 7 S2 SEG3 8 S3 SEG4 9 S4 SEG5 10 S5 SEG6 11 S6 SEG7 12 S7 SEG8 13 S8 LCD PANEL BS67F350 S8 Description: Here we focus on the BS67F350 application circuit. The LCD operating voltage,, is equal to 5V which is applied to the pin. The LCD driver can provide four voltage levels V A, V B, V C and V SS, so the bias type is 1/3. There are four COM lines, so the Duty is 1/4. AN0413E.00 7 / 10 December 11, 2016
S/W Description LCD Panel Description In this example, using the following LCD as a model, we will show a program to display the clock by using 4 COM lines with 9 SEG lines. In this program, the clock source is derived from the timer. In the LCD panel, the digit[1:2] field displays the Minute, the digit[3:4] field displays the Second and the COL flashes at a frequency of 1Hz. S/W Flowchart Start Second++ Sysint Second=60? No i=0 Yes Second=0 Minute++ Reach 0.5s? Yes No Minute=60? No Flash Col(:) Refresh Diplay i++ Yes Minute=0 Toggle AM/PM i<2 No Yes Refresh Diplay AN0413E.00 8 / 10 December 11, 2016
ISR Sec_Counter-- Sec_Counter=0? No Yes Sec_Counter=125 FG_HalfSec=1 RETI Conclusion Through the application example above, a description has been provided of how to use the C type LCD driver which users can adapt for their different applications. Version and modify information Date Author Issue and Revision 2015.12.15 David Xue First Version Reference Files 1. BS67F350 Datasheet 2. Related Firmware Archives BS67F350_C_Type.rar For more information, refer to the Holtek s official website www.holtek.com. AN0413E.00 9 / 10 December 11, 2016
Disclaimer Disclaimer All information, trademarks, logos, graphics, videos, audio clips, links and other items appearing on this website ('Information') are for reference only and is subject to change at any time without prior notice and at the discretion of Holtek Semiconductor Inc. (herein after 'Holtek', 'the company', 'us', 'we' or 'our'). Whilst Holtek endeavors to ensure the accuracy of the Information on this website, no express or implied warranty is given by Holtek to the accuracy of the Information. Holtek shall bear no responsibility for any incorrectness or leakage. Holtek shall not be liable for any damages (including but not limited to computer virus, system problems or data loss) whatsoever arising in using or in connection with the use of this website by any party. There may be links in this area, which allow you to visit the websites of other companies. These websites are not controlled by Holtek. Holtek will bear no responsibility and no guarantee to whatsoever Information displayed at such sites. Hyperlinks to other websites are at your own risk. Limitation of Liability In no event shall Holtek Limited be liable to any other party for any loss or damage whatsoever or howsoever caused directly or indirectly in connection with your access to or use of this website, the content thereon or any goods, materials or services. Governing Law The Disclaimer contained in the website shall be governed by and interpreted in accordance with the laws of the Republic of China. Users will submit to the non-exclusive jurisdiction of the Republic of China courts. Update of Disclaimer Holtek reserves the right to update the Disclaimer at any time with or without prior notice, all changes are effective immediately upon posting to the website. AN0413E.00 10 / 10 December 11, 2016