AN52927 PSoC® 3 and PSoC 5LP - Segment LCD Direct Drive Author: Rajiv Vasanth Badiger Associated Project: Yes Associated Part Family: All PSoC 3 and PSoC 5LP families ® Software: PSoC Creator™ 3.0 SP1 AN52927 demonstrates how easy it is to drive a segment LCD glass using the integrated LCD driver in PSoC 3 and PSoC 5LP. This application note gives a brief introduction to segment LCD drive features and provides a step-bystep procedure to design Segment LCD applications using the PSoC Creator tool. Contents Introduction Introduction .......................................................................1 Segment LCD Drivers in PSoC .........................................1 Segment LCD Component Configuration ..........................2 PSoC Creator Project ........................................................5 Segment LCD configuration .........................................7 Other Components in the Design ............................... 10 Top Design ................................................................. 11 Firmware ......................................................................... 11 Test Setup ....................................................................... 13 LCD Component Low Power Modes ............................... 13 Using Segment LCD Component in Low Power Mode .... 14 Summary ......................................................................... 15 Appendix A ...................................................................... 16 LCD Operating Principle.................................................. 16 Classification of LCDs ..................................................... 17 Classification (Based on Number of Backplanes/Commons) .............................................. 17 Classification (Based on Light Source) ....................... 19 Classification (Based on LCD Technology) ................ 20 Classification (Based on Image Produced)................. 21 LCD Viewing Angle ......................................................... 21 Worldwide Sales and Design Support ............................. 23 PSoC Creator, which is used to create PSoC 3 and PSoC 5LP projects, includes building blocks in the form of components for different functions. The segment LCD component is included for the segment LCD drive, which significantly reduces the design cycle time. www.cypress.com This application note takes you through an example project that uses the segment LCD component. If you are unfamiliar with the PSoC 3 and PSoC 5LP device, see the PSoC 3 and PSoC 5 LP Introduction webpage. To learn the basics of the Segment LCD, see Appendix A. Segment LCD Drivers in PSoC PSoC 3 and PSoC 5LP have 64 inbuilt segment LCD drivers. This gives it the capability to drive up to 768 pixels (16 commons x 48 segments). Following are the major features of the segment LCD drivers in PSoC 3 and PSoC 5LP: Direct drive with internal bias generation—no other external hardware is required. Maximum 64 inbuilt LCD drivers (which includes both common and segment pin driver). Supports 14-segment and 16-segment alphanumeric display, 7-segment numeric display, dot matrix, and special symbols. Supports both Type A and Type B waveforms. Wide LCD bias range (2 V to supply voltage). Static, 1/3, 1/4, 1/5 bias ratios. Supports LCD glass with up to 16 common lines. No CPU intervention in LCD refresh. Adjustable refresh rate from 10 Hz to 150 Hz. Document No. 001-52927 Rev. *H 1 PSoC® 3 - Segment LCD Direct Drive Configurable power modes, which allows power optimization. For a more detailed view of the hardware operation of the LCD drive system, see the Technical Reference Manual. PSoC Creator Component: Segment LCD To ease the application design process, the PSoC Creator IDE includes a Segment LCD Component that does most of the work: from setting the LCD drive configuration registers to LCD refresh. You can find the “Segment LCD” component in the Component Catalog under “display” in PSoC Creator. Segment LCD Component Configuration Double-click on the component placed in the Top Design. There are four tabs, which configure the SegLCD component completely based on the requirements. Basic Configuration Tab Figure 2. Basic Configuration Tab Instance name Figure 1. Component Catalog in PSoC Creator This tab accepts the following: There are two components: one for static segment LCD and another for multiplexed segment LCD. In this application note, only the multiplexed segment LCD component—segment LCD—is discussed. This component can also be configured to drive static LCD. Number of commons and segment lines. The number of commons can be from 1 to 16. The maximum number of segment lines will then depend on the available I/Os in the selected PSoC device. Bias Type: 1/3, 1/4, or 1/5 Waveform Type: Type A or Type B Frame Rate or Refresh Rate: 10 Hz to 150 Hz (max value depends on the driver power mode, waveform type, and number of commons). Drive Power Mode: This gives power optimization. There are three modes, as shown in the following table. Table 1. SegLCD Drive Power Modes Drive Power Mode No Sleep Power High Usage Tips Use under two conditions: www.cypress.com Document No. 001-52927 Rev. *H When the PSoC is always in active mode and no power saving feature is required When LCD is not required to be operational when the device is put to sleep 2 PSoC® 3 - Segment LCD Direct Drive Drive Power Mode Power Low Power Using ILO Low Low Power using Ext 32KHz crystal Low Usage Tips Use when extremely low power is required. In this mode, the SegLCD component works even when the PSoC is in the sleep mode. The SegLCD component takes the internal low-speed oscillator (ILO) clock for operation. ILO is low power; but, it comes at the cost of accuracy. If accurate LCD refresh rate is not required, you can use this mode. Bias Voltage: This defines the contrast of the LCD. There are two ranges available: 3.0 V and 5.5 V. Note that these two voltages represent the supply voltage (VDDA) to PSoC device. Table 2. SegLCD Bias Voltage 3.0 V supply Bias Range Step Size Figure 3. Driver Power Settings Tab This mode also gives low power operation. The only difference between this mode and “Low Power using ILO” is that this mode requires an external 32 kHz crystal for operation, thereby generating accurate clock for timing LCD refresh events. Note that if the mode is set to “Low Power using ILO”, there are limited values available for frame rate parameter. This is due to the use of low frequency 1 kHz ILO for the component. Frame rate is also a function of number of commons. As the number of common increases, maximum frame rate decreases. D r i ve r P o w e r S e t t i n g s This tab has settings to control the SegLCD component driver power. 5.5 V supply 2.017 V-3.0 V 2.35 V-5.5 V 27 mV 50 mV The driver operates in three stages: High Drive Stage: During this stage, LCD pixel capacitance is charged quickly using high drive current at the start of each refresh event. Low Drive stage: During this stage, power is supplied to the pixel to sustain the voltage, compensating for the leakages from the LCD pixel capacitance. This has less power than high drive stage. Tristate (Driver Disabled): During this stage, driver is disabled until the next refresh event. Whatever charge is stored in the pixel capacitance will cause the LCD liquid crystal orientation. Note that leakage can occur during this period. Keeping the driver in this stage for a long time will affect the display contrast. The following figure shows the three stages of the LCD driver. This step size comes from the 6-bit DAC that is used to generate these reference voltages. For this reason, you can get a maximum 64 levels of contrast. However, the number of levels of contrast actually depends on the supply voltage VDDA. The full 64 levels are obtained with a 5.5 V supply, but only 37 levels are obtained with a 3 V supply. Table 2 gives the reference for two supply voltages. The SegLCD component includes the API to adjust this bias level at run time. Ganging Commons This is useful when higher driver strength is required for driving a larger segment LCD display with higher capacitance. When this option is selected, two I/Os will be used to drive a common pin of LCD. www.cypress.com Document No. 001-52927 Rev. *H 3 PSoC® 3 - Segment LCD Direct Drive Figure 4. Drive Stages Voltage across pixel driven with 1/3 bias ratio Vbias Vbias/3 0V -Vbias/3 -Vbias t Glass Size Option Enlarged Vbias You can leave everything to the component to decide the drive strength and duration based on the glass size entered. The component calculates the drive strengths based on number of commons and the glass size value which gives information about the amount of glass capacitance. -Vbias t High Drive Low Drive TriState Note that when the drive power mode in the “Basic Configuration” tab is set to “No Sleep”, the LCD driver will go through all of the stages—High Drive, Low Drive, and Tristate. When any of the low power modes is selected in the Basic Configuration tab, then there will be no Low Drive stage; the driver will directly transition to Tristate after High Drive stage. You can configure the drive power strengths during High Drive as well as the period of time it remains in each stage. This gives flexibility in power and performance optimization. There are eight total modes you can use, as shown in the following table. Table 3. SegLCD Driver Modes Power strength Mode Seg=1x, Com=1x High Drive Seg=1x, Com=2x High Drive Seg=1x, Com=4x High Drive Seg=2x, Com=2x High Drive Seg=2x, Com=4x High Drive Seg=4x, Com=4x High Drive Seg=0.06x, Com=0.06x Low Drive Seg=0.06x, Com=0.12x Low Drive Notes Configurable by the user Clear the Advanced check box to use the glass size option. If advanced is selected, high drive and low drive time and high drive strength must be manually entered. Low drive strength will be automatically selected based on the high drive strength. Setting High Drive and Low Drive Duration High Drive and Low Drive duration are the periods when the LCD drive consumes power. Setting the duration too high will cause more power to be consumed. Setting it too low will cause the pixels to be charged for less time over the active common period and will cause contrast issues. It becomes even more important when the component is operated in low power modes and the device is put to sleep. In these modes, the entire device stays active during High Drive stage. The LCD component has the authority to give permission for the device to be put to sleep. If the sleep command is issued through firmware and the LCD driver is currently in high drive stage, the device will not enter sleep mode. The sleep command will be in pending state as long as the driver is in high drive stage. Thus, when operating the component in any of the low power modes, it is important to set the high drive time as low as possible. Displa y Helpers In this tab, LCD functional and hardware specific details are included. There are three sections on this tab: Configured automatically based on the selected high drive As shown in Table 3, there are six power modes in High Drive and two power modes in Low Drive. These modes give the ability to adjust the power of the common drive relative to the segment drive. Because the number of www.cypress.com commons will be less than the number of segment lines, AC coupling can occur if the drive strengths of both segment driver and common driver are same. To avoid this, programmable drive strengths are given in the driver system. The driver power strengths given in the previous table are comparable across the modes as well between segments and commons. For example, in high drive mode, Power strength Seg=1x, Com=4x implies common line drive strength is four times greater than segment line driver. Also common line drive strength in this mode is four times stronger than Seg=1x, Com=1x drive mode. Helpers Digits information Pixel mapping table Helper represents the kind of display features that you have on an LCD. As shown in Figure 5, helpers include the LCD display feature such as 7 segment, 14 segment, and so on. Click on the right arrow button to select a helper. To add specific number of digits, click the ‘+’ Document No. 001-52927 Rev. *H 4 PSoC® 3 - Segment LCD Direct Drive button. You can repeat this process for all the display features. The next step is to set the common-segment mapping (pixel mapping) table. This information is available in the LCD Glass datasheet. Drag the pixel or segment and drop it on the pixel mapping table. To understand this process much more clearly, look at the PSoC Creator project section. Figure 5. Display Helpers PSoC Creator Project In this project, you will learn to: Configure the segment LCD component based on the LCD Use the contrast control feature As an example, the segment LCD in the Cypress Segment LCD Drive Kit CY8CKIT-029 will be used. Resources required for building and testing the project: PSoC Development Kit—CY8CKIT-001 or any other custom development platform LCD Segment Drive Expansion Board Kit—CY8CKIT029 PSoC Creator Development Tool PSoC Programmer Software Details of LCD used in CY8CKIT-029: Segment LCD Glass Features: Display Technology: Twisted Nematic (TN) 8 common and 16 segment lines Viewing direction: 6:00 Operating voltage: 3 V Polarization Mode: Reflective/Positive Operating Temperature: 0 °C to 50 °C Various sections of the LCD are as follows. www.cypress.com Document No. 001-52927 Rev. *H 5 PSoC® 3 - Segment LCD Direct Drive Figure 6. Different Sections of Segment LCD Figure 7. Segment Naming The segment and common mapping table is given in the following figure. Table 4. Segment-Common Mapping Pin 1 2 3 4 5 6 7 8 COM7 COM7 COM6 COM5 COM6 COM5 COM4 COM3 COM2 COM1 COM0 COM4 COM3 COM2 COM1 COM0 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 T7 S1 S2 COL1 S3 S4 S5 COL2 T1 T4 T2 T3 COL3 COL4 T5 T6 1A 1J 2A 2J 3A 3J 4A 4J 5A 5J 6A 6J 10D 9D 8D 7D 1P 1K 2P 2K 3P 3K 4P 4K 5P 5K 6P 6K 10C 9C 8C 7C 1F 1B 2F 2B 3F 3B 4F 4B 5F 5B 6F 6B 10E 9E 8E 7E 1G 1L 2G 2L 3G 3L 4G 4L 5G 5L 6G 6L 10G 9G 8G 7G 1E 1C 2E 2C 3E 3C 4E 4C 5E 5C 6E 6C 10B 9B 8B 7B 1M 1R 2M 2R 3M 3R 4M 4R 5M 5R 6M 6R 10F 9F 8F 7F 1N 1D 2N 2D 3N 3D 4N 4D 5N 5D 6N 6D 10A 9A 8A 7A For more information on segment LCD glass and the EBK, see the user guide of CY8CKIT-029. Now, start to configure the segment LCD component. www.cypress.com Document No. 001-52927 Rev. *H 6 PSoC® 3 - Segment LCD Direct Drive In this LCD, one common line is multiplexed to control eight segments. Seg=1x, Com=4x is selected for this project. This is the maximum relative strength drive available in the driver to balance the total drive strengths of segment driver and a common line driver. Segment LCD configuration Basic Configuration Figure 8. Basic Configuration Displa y Helpers In the Display Helpers tab, you can see the pixel mapping table with 8 commons and 16 segment lines listed. This table is prepared based on the information entered in the basic configuration tab. Figure 10. Display Helpers Tab The number of commons and segment lines is set to 8 and 16, respectively. The LCD is driven with 1/4 bias ratio which is sufficient for this display. The component is operated in “No Sleep” mode, which means that the LCD will be non-functional if the device is put into sleep mode. In this project, device is always kept in active mode. The bias voltage is set to 3 V. Ganging is not used in this project. However, if the selected glass has high capacitance, then the ganging option should be used. D r i ve r P o w e r S e t t i n g s Figure 9. Driver Power Settings You must see the LCD datasheet to configure this tab. Use the following steps as a guide: Step 1: Select the display feature: The LCD used in this project has a 7-segment display section, 14-segment display section, and several symbols. The Helpers box in this tab lists all the features supported by the component. Select the required display feature in the Helpers box one by one by clicking on right arrow button. It will then be displayed in the Selected Helpers list box. To delete the selected helper, use the left arrow button. The Advanced setting is selected. By default, the high drive time is set as half of the maximum possible value. The maximum value in this case is ~1158 us. The high drive time is set to 25 percent of this value; that is, 290 us. Low drive time is set to 50 percent of maximum value. During the rest of the 25 percent of the frame time, the driver will be disabled. Tune these values depending on the contrast required and the acceptable power consumption. www.cypress.com Document No. 001-52927 Rev. *H 7 PSoC® 3 - Segment LCD Direct Drive Figure 11. Adding Display Helpers Helper_7Segment_0 Helper_14Segment_0 Helper_Bar_0 Step 3: Edit the segment names of each display feature according to the LCD used For special symbols, (Helper_Bar_0) is used. bargraph and Dial Helper Step 2: Add digits: The LCD has four 7-segment digits, six 14-segment digits, and 16 symbols. Click on the selected helper and add the required number of digits/symbols using the “+” button. It is important that you use the give all the segments of all display types the same name as the one mentioned in the LCD datasheet. In this project, the segment names of 14-segment display and all the symbols are changed based on what is specified in the LCD datasheet. This helps in avoiding mistakes while filling segment-common mapping tables. It also helps in easy identification of the each segment/pixel in firmware. To rename the segments, click on the segment and type the new name in the text box. Figure 13. Renaming Segment Name Figure 12. Adding More Digits Four 7-Segment Digits added Figure 13 shows that the name of one of the segments of 14-segment display is changed from H14SEG0_L to H14SEG0_R according to the LCD specification shown in Figure 7 All other segment names are also changed. The following figure shows the changed names of a 14-segment display and the symbols. 14-segment configured in component Six 14segment digits added Symbols configured in component www.cypress.com Document No. 001-52927 Rev. *H 8 PSoC® 3 - Segment LCD Direct Drive Repeat the process of mapping for all segments of display sections. You can choose any segment row in the pixel mapping table, as long as you put other corresponding segments sharing the LCD pin in the same row and do proper pin assignment. The completed table looks like this. In the case of symbols, it does not matter which segment you want to rename; segment-common mapping must be done appropriately. Figure 16. Completed Pixel Mapping Table Step 4: Fill segment-common mapping table: Drag the segment from the digits and drop it on the pixel mapping table. You should see the segment-common mapping table given in the LCD datasheet (shown in Table 4). Figure 14. Pixel Mapping Procedure Segment-common mapping table for your reference If you want to clear any mapping, right-click on the pixel and do a reset as shown in Figure 15: Figure 15. Clearing the Existing Mapping www.cypress.com This completes the component configuration. You now must assign the pins for the segment and common lines. Document No. 001-52927 Rev. *H 9 PSoC® 3 - Segment LCD Direct Drive Pin Assignment For pin assignment, use the .cydwr file. You must make the hardware compatible with the pins selected here. Figure 17. Pin Assignment Here the pins are assigned considering that the Segment LCD Drive Kit CY8CKIT-029 is plugged to port A of the PSoC Development Kit CY8CKIT-001. Other Components in the Design Delta-Sigma ADC: A potentiometer is connected to port P0[2] of the device for contrast adjustment. The DeltaSigma component is used to read the potentiometer value. www.cypress.com Document No. 001-52927 Rev. *H 10 PSoC® 3 - Segment LCD Direct Drive Top Design Figure 18. Top Design of the Project Firmware The component offers several APIs. For details of all the APIs, see the Segment LCD component datasheet. In this project: Text “PSOC” is displayed on the 14-segment display section Incrementing values (every second) are printed on the 7-segment display section 3. In the present project, a medical symbol is blinked every second. This is done by controlling an individual pixel. Segment LCD component gives the API: uint8 LCD_WritePixel(uint16 pixelNumber, uint8 pixelState); Pixel number can be obtained from the component .h file. Each every pixel of all the display sections is uniquely addressed based on the name set while configuring the component. If 1 is passed to pixel state, the pixel is turned ON. Medical symbol blinks every second This example will give an introduction to APIs associated with all types of display sections. You will also learn about the contrast control API. API to control particular pixel/segment 4. API to control the contrast of LCD Segment LCD APIs used in the project: uint8 1. This API sets the bias level controlling the contrast of LCD. This API accepts values between 1 and 64. API to print string on 14 segment display Void LCD_WriteString14Seg_1(uint8* character, uint8 position); LCD_SetBias(uint8 biasLevel) ; This prints the string on the 14-segment display with the specified start position. 2. API to display number on 7-segment display void LCD_Write7SegNumber_0(uint16 value, uint8 position, uint8 mode); This API prints the specified value on the 7-segment display with the specified starting position. Mode value, when set to 1, appends 0 to the MSB positions. When set to 0, it retains the previous value for MSB positions. www.cypress.com Document No. 001-52927 Rev. *H 11 PSoC® 3 - Segment LCD Direct Drive The main.c code is shown here: /* Increment display count */ DisplayCount++; if(DisplayCount>9999) DisplayCount=0; void main() { uint8 ADCValue; uint8 msCounter=0; uint16 DisplayCount=0; uint8 BlinkStatus=0; } } } /* Starts the Segment LCD */ LCD_Start(); /* Start ADC */ ADC_DelSig_1_Start(); ADC_DelSig_1_StartConvert(); /* Write on 14 segment display section */ LCD_WriteString14Seg_1("PSOC",0); while(1) { /* Give 100ms delay */ CyDelay(100); ADC_DelSig_1_IsEndConversion (ADC_DelSig_1_WAIT_FOR_RESULT); ADCValue=ADC_DelSig_1_GetResult8(); /* Divide the 8bit value by 4 as SetBias function accepts 6 bit value */ ADCValue=ADCValue>>2; /* Set the LCD bias which controls the contrast */ LCD_SetBias(ADCValue); /* Increment counter every 100ms */ msCounter++; if(msCounter==10) { msCounter=0; /* 1 sec has elapsed, blink medical symbol and increment count on seven segment display */ /* Blink Medical Symbol (T3) */ LCD_WritePixel(LCD_T3,BlinkStatus); BlinkStatus^=0x1; /* Toggle status */ /* Update display on 7-segment */ LCD_Write7SegNumber_0(DisplayCount,0 ,1); www.cypress.com Document No. 001-52927 Rev. *H 12 PSoC® 3 - Segment LCD Direct Drive Test Setup LCD Component Low Power Modes There are two low power modes include in the Segment LCD component: Low power using ILO In low power modes, LCD operates only in high drive stage. After the defined high drive time, the LCD driver is disabled (but timer enabled) and all the LCD pins are tristated. Following events occur at time TA and shortly afterward: Low power using external 32-kHz crystal With either of these modes, you can put the device to sleep and keep the LCD functional. The LCD component is equipped with a timer that gives periodic interrupt to the device to wake up and refresh the LCD glass. To understand the component behavior in low power mode, see the following figure. Figure 19. Segment LCD Component Behavior in Low Power Mode LCD timer issues interrupt. If the device is put in sleep mode, it wakes up the device. LCD component is completely powered ON. LCD component enters high drive stage Following events occur at time TB and shortly afterward: LCD driver is disabled; common and segment pins are tristated. If the sleep command is issued in firmware between time instants TA and TB, then the device enters sleep mode. Voltage across pixel driven with 1/3 bias ratio T If the sleep command is issued between TA and TB through firmware, the LCD component will keep that command in pending state as long as it is in High Drive stage. After the high drive stage is completed at TB, it gives permission to put the device to sleep. Vbias Vbias/3 0V -Vbias/3 -Vbias t Enlarged Vbias TriState High Drive TriState High Drive -Vbias t TA www.cypress.com TB TA + T TB + T TA + 2T Document No. 001-52927 Rev. *H 13 PSoC® 3 - Segment LCD Direct Drive 3. Clock Settings Using Segment LCD Component in Low Power Mode Figure 21. Clocks Window Here is the list of things that you need to do in PSoC creator to use the component in Low Power mode: 1. Set the operating mode of the component to one of the Low Power modes In the driver mode settings under the “Basic Configuration” tab, select either Low Power using ILO or using external 32 kHz crystal. Figure 20. Low Power Mode Selection 2. Select the High Drive time based on contrast and power requirement As mentioned in “Setting High Drive and Low Drive duration”, it is important that High Drive time is not set too high because it will block the device from going into sleep mode, which leads to higher power consumption. Keeping a low value of high drive time will cause contrast issues. Consider contrast and power requirements when you set the high drive time. In the .cydwr file, go to the Clocks tab. Click the Edit button to open the Clock Settings window. Figure 22. Clock Settings Settings for component configured in “Low power using external 32 kHz crystal”: www.cypress.com Enable 32 kHz crystal oscillator Disable PLL for reducing power consumption Document No. 001-52927 Rev. *H 14 PSoC® 3 - Segment LCD Direct Drive 4. Firmware LCD Low power modes are used along with device sleep mode. It is the responsibility of the user to put the device to sleep. The LCD component will wake the device but does not put the device back to sleep after LCD refresh. For this reason, it is important that the firmware is structured properly. The following snippet shows how the code can be structured if the design has multiple interrupt sources. void main() { /*Enable Global interrupt */ CYGlobalIntEnable; if ( condition ) { /*non-LCD interrupt has triggered */ /* User code */ } } } /* Initialize all the components and variables used */ /* Start the Segment LCD component */ LCD_Start(); LCD_EnableInt(); while(1) { /* Put the device to sleep */ CyPmSleep(PM_SLEEP_TIME_NONE,PM_ SLEEP_SRC_LCD); /* Device wakes up from sleep */ /* Check if other interrupts (non-LCD) in the design have triggered www.cypress.com else put the device back to sleep */ Use this kind of firmware structure when operating the device in sleep mode with the LCD component configured in low power mode. Summary PSoC 3 and PSoC 5LP offer segment LCD drive as a value-added feature in addition to other major functions with its configurable digital and analog hardware. This application note explains the PSoC 3 and PSoC 5LP segment LCD drive component through one simple example project. About the Author Name: Rajiv Vasanth Badiger Title: Sr. Applications Engineer Background: BE Electronics and Communication Contact: [email protected] Document No. 001-52927 Rev. *H 15 PSoC® 3 - Segment LCD Direct Drive Appendix A Figure 24. Liquid Crystal – No Excitation LCD Operating Principle Rear Polarizer Front Polarizer Liquid Crystals LCD operates based on the light polarization concept. Polarization is defined based on the electric field vector direction associated with light. To understand the fundamental concept, consider the following diagram. Light Source Figure 23. Basic LCD Concept Segment Electrode Generally, the available light source produces unpolarized light rays; that is, electric field vector direction is continuously and rapidly changing. Pass this unpolarized light through a polarizer sheet, which passes only light rays whose electric field is aligned vertically. Then, place a second polarizer, which passes light with horizontal polarization behind the first polarizer. No light rays will pass through the second polarizer. If you place some mysterious material between the two polarizers to control the polarization of light based on need, this will reorient the light parallel to the second polarizer or simply pass the light with the polarization created by the first polarizer which will be blocked by the second polarizer. This mysterious material is the liquid crystal by which LCD got its name. Liquid crystal orientation is changed by application of electrical signal across it with the help of electrodesbackplane (common) and segment. To avoid permanent orientation of liquid crystal, alternating waveform needs to be applied between the electrodes so that average voltage across the liquid crystals to be 0. Figure 24 shows the case when the pixel is in off state, that is, when light simply passes through the front polarizer. This is the case when no voltage is given between the electrodes. By default liquid crystals orient the light by 90°. This is an example of TN LCD glass which will be explained later in the document. To turn ON the pixel, liquid crystals are excited causing it to align parallel to the electric field as shown in Figure 25. Figure 25. Liquid Crystal – With Excitation Rear Polarizer www.cypress.com Liquid Crystals Front Polarizer Light Source Segment Electrode Figure 24 shows the basic LCD assembly consisting of rear polarizer, front polarizer, segment and backplane electrode, and Liquid crystal. The liquid crystal is sandwiched between the electrodes and polarizers. Backplane Electrode Backplane Electrode In this case, liquid crystal will not change polarization of light coming from the rear polarizer and it will be blocked by the front polarizer. It will be seen as a dark spot on the LCD front panel. Document No. 001-52927 Rev. *H 16 PSoC® 3 - Segment LCD Direct Drive Classification of LCDs There are many ways LCDs available in market can be classified. Figure 26. Classification of LCDs Based on number of backplanes: 1. Static 2. Multiplexed Based on LCD Technology: 1. TN 2. STN 3. FSTN LCD Based on light source location: 1. Transmissive 2. Reflective 3. Transflective Based on image: 1. Positive 2. Negative For the segment to be OFF, the segment and common signals are kept in phase. This results in 0 Vrms across the segment and common pin. Classification (Based on Number of Backplanes/Commons) 1. Static 2. Multiplexed Static LCD There is only one backplane or common in static LCDs and independent control for the segments. The voltage between the common and the segment pin decides the state of the pixel. As mentioned earlier alternating waveform needs to be applied to avoid permanent damage to the LCD. Following diagram shows the typical waveforms of static LCD: Figure 27. Static LCD Waveforms Vdd Common Common Vdd OFF Segment For the segment to be in ON state, segment and common signal are kept 180° out of phase. If the peak value of the square waveform is say VDD, then it results in RMS voltage of VDD across the segment and the common and average voltage of 0 which is the fundamental requirement. Multiplexed LCD In Static LCD, the number of pins and drivers to control the pixel is equal to the number of segments or pixels LCD has. This becomes a problem as the complexity of LCD increases which requires use of higher I/O count LCD drivers. Instead of having individual control pin for a segment or pixel, we can multiplex the use of control pin for other segments/pixels. Then, a question arises while exciting one pixel; how to avoid affecting another pixel controlled by same pin. The answer is to use multiple commons. These types of LCDs are called as multiplexed LCD. Multiplexed LCDs are specified based on the number of commons it has. Vdd ON Segment Segments Vdd 0V Resulting Voltage (Common-Segment) OFF Segment As an example, consider four segments or pixels in an LCD. In static LCD, there will be four segment control pins and one common pin as shown in the following figure. Therefore, it requires a total of five pins or drivers in a static configuration. -Vdd Vdd 0V Resulting Voltage (Common-Segment) ON Segment -Vdd www.cypress.com Document No. 001-52927 Rev. *H 17 PSoC® 3 - Segment LCD Direct Drive B i a s R a t i o / T yp e Bias is the number of voltage steps applied to the LCD. The number of voltage levels should be increased with increase in number of commons of LCD. This is done to avoid high RMS voltage across the pixel in OFF state. Figure 28. Static LCD Configuration Seg1 Seg3 Common Each multiplexed LCD manufacturer has a recommended bias ratio for the LCD. Common bias ratio values are 1/2, 1/3, ¼, and 1/5. Seg4 Seg2 In two common multiplexed LCDs, two segments will share the same pin. This configuration will result in four pins or drivers, that is, one less than static configuration. This advantage becomes clearly evident as the number of segments increases. Figure 29. Multiplexed LCD Configuration D r i ve W a ve f o r m s Multiplexed LCDs can be driven by two types of waveforms. These are called Type A and Type B waveforms. Type A waveforms take single frame to maintain zero average voltage across each pixel whereas Type B waveforms take two frames. Figure 30. Multiplexed LCD Drive Waveforms Type A waveforms Seg1 Type B waveforms Common Segment Com1 0V Com2 0V 1 Frame Seg2 D r i vi n g M u l t i p l e x e d L C D s Before considering the details of drive waveforms, it is necessary to understand some of the terms associated with multiplexed LCDs. Frame Frequenc y Frame frequency is the rate at which the drive waveform repeats for each segment line. In simple terms, it is the rate at which each segment LCD pixel is refreshed. It is generally in the range of 30 Hz to 150 Hz. High frame frequency results in higher power consumption and lower frequency causes flickering on LCD. Therefore, there is a tradeoff between power consumption and image display quality. Duty Ratio/Multiplex Ratio This term indicates the number of commons or backplanes multiplexed LCD has. It is specified inverse of number of commons/backplanes. For example, if multiplexed LCD has 4 commons, duty ratio is equal to ¼. While driving multiplexed LCDs, the segments associated with one common, gets refreshed for 1/(number of commons) of the frame period; that is Duty Ratio x Frame period. www.cypress.com Liquid crystals is energized Liquid crystals is not energized Common - Segment 1 Frame Liquid crystals is not energized Liquid crystals is energized Type B waveforms contain fewer edges than Type A waveforms in a given time duration. This is one major advantage of Type B waveforms. LCD pixel is modeled as a capacitor. So there will be current flow from the driver only during edges. Therefore, a Type B waveform results in lower power consumption compared to a Type A waveform. The drive waveforms for various combinations of Duty ratio and Bias ratio are discussed earlier in Appendix A. In all the waveforms, it should be noted that a frame consists of some number of phases (equal to number of commons). During each phase, one common is made active and it is driven with extreme voltage levels. All the other commons are pulled to intermediate voltage levels; value depends on the bias ratio. The segments associated with the active common which needs to be turned ON are driven with opposite phase signals with respect to active common. This generates peak RMS voltage across the pixel necessary to turn it ON, at the same time maintaining zero average voltage. The segments associated with the active common which needs to be turned OFF are driven with in-phase signals. This generates zero RMS voltage across the pixel. The segments associated with inactive commons will not experience high excitation as the inactive commons are excited with intermediate levels. Thus, the segments associated with inactive commons will remain unaffected when other commons are active. Document No. 001-52927 Rev. *H 18 PSoC® 3 - Segment LCD Direct Drive Adjusting Contrast Contrast level of LCD is adjusted by the changing the gap between ON Segment Voltage and OFF segment Voltage. all the voltages are scaled down by a factor of ¾. This results in decreased RMS value across pixels. RMS voltage controls the amount of twist to the light polarization in the assembly. As the RMS voltage goes down, the As an example, consider two common LCD drive with ½ change in light polarization due to liquid crystal also goes bias as shown in Figure 31. To reduce the contrast, all the down. This results in increased passing of light through voltage levels are scaled down. In the waveform shown, the front polarizer which means lower contrast. Figure 31. Contrast Control Higher Contrast Lower Contrast Vx ¾ Vx ½ Vx 3/8 Vx COM0 0 Vx ¾ Vx ½ Vx 3/8 Vx COM1 0 Vx ¾ Vx SEG ON 0 Vx ¾ Vx SEG OFF 0 ∆ Vx ¾ Vx ½ Vx 3/8 Vx 0 -3/8 Vx -½ Vx -¾ Vx -Vx COM0SEG ON ½ Vx 3/8 Vx 0 COM0SEG OFF -3/8 Vx -½ Vx Classification (Based on Light Source) Transmissive Reflective Transflective All LCDs are passive. They require an external light source to display information. T r a n s m i s s i ve L C D If the light source is required to be behind the rear polarizer, then it is Transmissive LCD. Figure 24, shown earlier, is an example of Transmissive LCD. A simplified form is shown in Figure 32. This type of LCD requires a backlight source. Depending on backlight brightness it can be used in either indoor or outdoor applications. www.cypress.com Document No. 001-52927 Rev. *H 19 PSoC® 3 - Segment LCD Direct Drive Figure 32. Transmissive LCD Classification (Based on LCD Technology) Liquid Crystal + Electrode assembly Rear Polarizer Front Polarizer R e f l e c t i ve L C D s Reflective LCDs are equipped with a reflector behind the rear polarizer. This reflector allows external light to be reflected back. These LCDs do not require any backlight. For this reason, they are used in low power systems. This also gives good contrast in display under high ambient light conditions. Figure 33. Reflective LCD Liquid Crystal + Electrode assembly Rear Polarizer Twisted Nematic (TN) 2. Super Twisted Nematic (STN) 3. Film Compensated STN (FSTN) Twisted Nematic (TN) This type of liquid crystal gives 90° twist to the incoming light. The two polarizers (rear and front) mounted on the LCD have direction of polarization perpendicular to the each other. The example shown in Figure 24 is Twisted Nematic type of display. This type of display suffers from lower contrast and smaller viewing angle. Also these displays are not suitable for LCDs with higher number of commons. Super Twisted Nematic (STN) This type of liquid crystal gives greater than 90° twist to the incoming light and gives a steeper change in transmission-voltage curve. With this feature, RMS voltage of ON LCD pixel can be very close to the RMS voltage of OFF LCD pixel, still providing acceptable contrast. Due to this reason, it is suitable for LCDs with higher number of commons. The typical twist angle is between 180° to 270°. This has better contrast and viewing angle as compared to TN displays. These displays are available in couple of colorations: Yellow/Green and Grey background with dark blue characters. Reflector Front Polarizer T r a n s f l e c t i ve L C D s Transflective LCDs are equipped with special semireflector which has the capability to reflect as well as pass fraction of light, thereby allowing both features of Transmissive and Reflective type LCDs. www.cypress.com 1. Film Compensated STN (FSTN) This type is a modification of STN displays. STN displays have color added that appears in display background due to birefringence effect. To compensate for this effect, additional film is introduced in the assembly which eliminates this coloration. These types of displays, thus, are available only in White/Grey Background with black characters. Along with the advantage in eliminating coloration, these displays also give good contrast and wide viewing angle. Document No. 001-52927 Rev. *H 20 PSoC® 3 - Segment LCD Direct Drive Classification (Based on Image Produced) 1. Positive 2. Negative 12:00 Clock view 6:00 Clock view These terms are with reference to a clock. If the bias line bends towards top portion of the LCD display then it is referred to as 12:00 Clock or Top view. If the bias angle bends towards bottom portion, then it is referred to as 6:00 Clock or Bottom view. P o s i t i ve This type of LCD displays dark characters on a bright background. This type of display is suitable for reflective type LCD with high ambient light conditions or for Transmissive type LCD with good backlight. Figure 34 shows the 12:00 view. α is the bias angle and β is the viewing angle. Figure 34. 12:00 or Top View N e g a t i ve LCD β α This type of LCD displays bright characters on a dark background. This type of display is suitable for Transmissive LCDs under good backlight conditions. LCD Viewing Angle Similarly, 6:00 view is shown in the following figure. Viewing angle of LCD depends on the type of liquid crystal used and the duty cycle. There are two terms associated with the viewing region - Bias angle and the Viewing angle. Figure 35. 6:00 or Bottom View Bias angle is the angle between the perpendicular axis of LCD and the line along which best possible view is obtained. Bias angle is set when the LCD is manufactured. LCD Viewing angle refers to angle spacing around the bias line where satisfactory view is obtained. α β Depending on where the bias line is located, LCD view positions are referred to as: www.cypress.com Document No. 001-52927 Rev. *H 21 PSoC® 3 - Segment LCD Direct Drive Document History ® Document Title: PSoC 3 and PSoC 5LP- Segment LCD Direct Drive – AN52927 Document Number: 001-52927 Revision ECN Orig. of Change Submission Date ** 2711107 GDN 05/26/2009 New application note *A 2765916 GDN 09/18/2009 Changed the figures to latest version of PSoC Creator (Beta 2 Nightly build 5307) and updated related text with respect to Figure 5. Description of Change Changed eight entries in Table 4. Updated C code for LCDExcercise1 (now display starts from right instead of left) and the same is updated in project goal. *B 2958667 RJVB 06/22/2010 Added one more project with Segment LCD Drive EBK CY8CKIT-029 Updated the project with PSoC Creator Beta 4.1 Updated content to include the PSoC 5 device Added images of test setup for all projects Added Summary *C 3010629 RJVB 08/17/2010 Updated the projects on Beta 5.0 Updated the customizer and top design screenshots in the document Changed the driver mode to low power to add more variety *D 3178537 RJVB 02/21/2011 Complete rewrite. The document and project are updated to suit PSoC 3 LCD Driver Hardware. *E 3296494 RJVB 06/29/2011 Title changed Moved LCD Basics to Appendix Updated introduction to include links for PSoC3 Learning Changed project to be based on CY8CKIT-029; deleted second project Added section: LCD component low power modes *F 3444949 NIDH/RJVB 11/22/2011 Updated for PSoC Creator 2.0 Updated template *G 3809482 VVSK 11/12/2012 Updated for PSoC 5LP *H 4454392 RKRM 07/24/2014 Updated Abstract Updated content to address few grammatical issues Updated the project to PSoC Creator 3.0 SP1 www.cypress.com Document No. 001-52927 Rev. *H 22 PSoC® 3 - Segment LCD Direct Drive Worldwide Sales and Design Support Cypress maintains a worldwide network of offices, solution centers, manufacturer’s representatives, and distributors. To find the office closest to you, visit us at Cypress Locations. PSoC® Solutions Products Automotive cypress.com/go/automotive psoc.cypress.com/solutions Clocks & Buffers cypress.com/go/clocks PSoC 1 | PSoC 3 | PSoC 5LP Interface cypress.com/go/interface Lighting & Power Control cypress.com/go/powerpsoc cypress.com/go/plc Memory cypress.com/go/memory PSoC cypress.com/go/psoc Touch Sensing cypress.com/go/touch USB Controllers cypress.com/go/usb Wireless/RF cypress.com/go/wireless Cypress Developer Community Community | Forums | Blogs | Video | Training Technical Support cypress.com/go/support PSoC is a registered trademark of Cypress Semiconductor Corp. All other trademarks or registered trademarks referenced herein are the property of their respective owners. Cypress Semiconductor 198 Champion Court San Jose, CA 95134-1709 Phone Fax Website : 408-943-2600 : 408-943-4730 : www.cypress.com © Cypress Semiconductor Corporation, 2009- 2014. The information contained herein is subject to change without notice. Cypress Semiconductor Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in a Cypress product. Nor does it convey or imply any license under patent or other rights. Cypress products are not warranted nor intended to be used for medical, life support, life saving, critical control or safety applications, unless pursuant to an express written agreement with Cypress. Furthermore, Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress products in life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. This Source Code (software and/or firmware) is owned by Cypress Semiconductor Corporation (Cypress) and is protected by and subject to worldwide patent protection (United States and foreign), United States copyright laws and international treaty provisions. Cypress hereby grants to licensee a personal, non-exclusive, non-transferable license to copy, use, modify, create derivative works of, and compile the Cypress Source Code and derivative works for the sole purpose of creating custom software and or firmware in support of licensee product to be used only in conjunction with a Cypress integrated circuit as specified in the applicable agreement. Any reproduction, modification, translation, compilation, or representation of this Source Code except as specified above is prohibited without the express written permission of Cypress. Disclaimer: CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS MATERIAL, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Cypress reserves the right to make changes without further notice to the materials described herein. Cypress does not assume any liability arising out of the application or use of any product or circuit described herein. Cypress does not authorize its products for use as critical components in life-support systems where a malfunction or failure may reasonably be expected to result in significant injury to the user. The inclusion of Cypress’ product in a life-support systems application implies that the manufacturer assumes all risk of such use and in doing so indemnifies Cypress against all charges. Use may be limited by and subject to the applicable Cypress software license agreement. www.cypress.com Document No. 001-52927 Rev. *H 23