AN205404 FM3 MB9AA30N Series Bluemoon-EVB_LCD Associated Part Family: MB9AA30N Series This application note describes LCD sample codes, designed to operate the 8 COM segment LCD driver modules in bluemoon EVB and also gives descriptions of how to use these sample codes. Contents 1 2 3 Introduction .................................................................. 1 1.1 Purpose .............................................................. 1 1.2 Document Overview ............................................ 1 LCD Introduction.......................................................... 2 2.1 LCD Driver Principle ........................................... 2 2.2 Configuration of LCD Controller .......................... 3 Hardware Introduction ................................................. 4 3.1 LCD Controller Overview .................................... 4 1 Introduction 1.1 Purpose 3.2 Bluemoon EV Board Hardware ........................... 5 Firmware Introduction .................................................. 5 4.1 Firmware Overview ............................................. 5 4.2 Application Interface ........................................... 6 5 Usage Notice ............................................................... 8 6 Additional Information .................................................. 9 Document History............................................................ 10 4 This application note describes LCD sample codes, designed to operate the 8 COM segment LCD driver modules in bluemoon EVB which is build up in MB9AA30N series MCU. Added to that is the descriptions of how to use this sample code and some notices. Certainly, user can use it for other type LCD. 1.2 Document Overview The rest of document is organized as the following: Chapter 2 explains LCD Introduction. Chapter 3 explains Hardware Introduction. Chapter 4 explains Firmware Introduction. www.cypress.com Document No. 002-05404 Rev. *A 1 FM3 MB9AA30N Series Bluemoon-EVB_LCD 2 LCD Introduction LCD working principles 2.1 LCD Driver Principle 2.1.1 LCD Principle Figure 1. COM and SEG Signal Layout Example in a LCD Symbol Each symbol on LCD is controlled by no less than 1 common signal and 1 segment signals. The ON or OFF status of which symbol is determined by both common and segment outputs. 2.1.2 Terms Used For LCD controller LCD clock drives the LCD controller, Cycle of AC waveform which drives LCD. By its nature, LCD causes deterioration to its LCD elements if DC driver because the LCD elements are affected by chemical changes. To avoid this situation, the LCD controller incorporates AC waveform generator to generate AC waveform consisting of 2 frames: an odd frame and an even frame(inverted odd frame), allowing driving the LCD. Figure 2. Terms Used for LCD Controller www.cypress.com Document No. 002-05404 Rev.*A 2 FM3 MB9AA30N Series Bluemoon-EVB_LCD 2.2 Configuration of LCD Controller The LCD controller consists of the following blocks, which are divided functionally into a controller section that generates the segment and common signals based on the content of display RAM and a driver section that drives the LCD. Figure 3. LCD Controller Block Diagram www.cypress.com Document No. 002-05404 Rev.*A 3 FM3 MB9AA30N Series Bluemoon-EVB_LCD 3 Hardware Introduction LCD hardware connection introduction 3.1 LCD Controller Overview The LCD drive voltage is generated by divider resistors, includes internal or external divider resistors, as Figure 4 shows. Figure 4. Divider Resistor Connection Internal resistor External resistor The internal divider resistor consists of 10 K and 100 K resistors. The value of these divider resistors we should base on the detail LCD parameters. VR is an external variable resistor, connect it to adjust the voltage at pin VV4. www.cypress.com Document No. 002-05404 Rev.*A 4 FM3 MB9AA30N Series Bluemoon-EVB_LCD 3.2 Bluemoon EV Board Hardware The VR and divider resistors effect to adjust LCD brightness base on VCC. Bluemoon EV board used 3.3 V or 5 V power supply, so uses internal divider resistors to generate LCD drive voltage, as Figure 5 shows: When power supply is 5 V, we used internal 10 K resistors. When power supply is 3.3 V, we used internal 100 K resistors. We can get the power supply voltage via MCU LVD function. Figure 5. Bluemoon EVB Divider Resistor Connection 4 Firmware Introduction LCD firmware introduction 4.1 Firmware Overview All the parameters and functions are introduced as follow. Table 1. Parameters List Name Description Remarks ComMap[] LCD comx actual connect to which MCU comx N/A SegMap[] LCD segx actual connect to which MCU segx N/A LCD_DigitBitMap[][] Display content map base on LCD which is used bluemoon evb N/A LcdDisplayBuffer LCD display buffer N/A PowerSupply Current EV Board power supply N/A Table 2. Functions List Prototype Function Description Remarks void LcdComPin_Int(uint8_t) Base on actual hardware connect init the com pin N/A void LcdSegPin_Int(void) Base on actual hardware connect init the segment pin N/A void LCD_Init(void) Init LCD controller N/A void LcdDisp(void) Display the buffer data to LCD N/A void LcdWriteData(uint8_t, uint8_t, uint8_t) Write data to LCD display buffer N/A void LcdWriteColon(uint8_t) Write colon to LCD display buffer N/A void ShowWhichPlaceBlink(uint8_t, uint8_t, uint8_t) Appoint a place, the display is blink N/A void Lvd_Init(void) Init MCU LVD N/A www.cypress.com Document No. 002-05404 Rev.*A 5 FM3 MB9AA30N Series Bluemoon-EVB_LCD 4.2 Application Interface All the functions about LCD will be introduced as below, include the function prototype, input parameter(s), return value(s), and the function description. 4.2.1 LcdComPin_Int(uint8_t) Prototype void LcdComPin_Int(uint8_t mode) mode: 4 – 4 com mode Parameter 8 – 8 com mode other is invalid 4.2.2 4.2.3 4.2.4 Return void Description Base on actual hardware connect init the com pin Remark N/A LcdSegPin_Int() Prototype void LcdSegPin_Int(void) Parameter void Return void Description Base on actual hardware connect init the segment pin Remark N/A LCD_Init() Prototype void LCD_Init(void) Parameter void Return void Description Init LCD controller Remark N/A LcdDisp() Prototype void LcdDisp(void) Parameter void Return void Description Display the buffer data to LCD Remark N/A www.cypress.com Document No. 002-05404 Rev.*A 6 FM3 MB9AA30N Series Bluemoon-EVB_LCD 4.2.5 LcdWriteData(uint8_t, uint8_t, uint8_t) Prototype void LcdWriteData(uint8_t dat, uint8_t place, uint8_t point) dat: needs display data Parameter: Place: place of display Point: if display radix point 1:yes other: no 4.2.6 4.2.7 Return void Description Write data to LCD display buffer Remark N/A LcdWriteColon(uint8_t) Prototype void LcdWriteColon(uint8_t place) Parameter: place: display place Return void Description Write colon to LCD display buffer Remark N/A ShowWichPlaceBlink(uint8_t, uint8_t, uint8_t) Prototype void ShowWhichPlaceBlink(uint8_t WhichPlace, uint8_t ReplaceDate1, uint8_t ReplaceDate2) Place: place of blink display Parameter: ReplceDate1: need replace data in place ReplceDate2: need replace data in place+1 4.2.8 Return void Description A point a place, the display is blink Remark Spread Function L vd _ I n i t ( ) Prototype void Lvd_Init(void) Parameter: void Return void Description LVD initialization, detected voltage fall 4V, LVD interrupt Remark Spread Function www.cypress.com Document No. 002-05404 Rev.*A 7 FM3 MB9AA30N Series Bluemoon-EVB_LCD 5 Usage Notice The usage notice LCD Initialization Sometime the LCD segment pin is not connected corresponding to MCU segment pin (for example: LCD seg11 is used MCU seg19 pin in bluemoon EV Board). So before initialization LCD controller, user should check array ComMap[] and SegMap[][] to insure its accuracy. Driver Resistors The LCD controller has an LCD drive voltage divider resistor whose resistor value can be selected from 10kΩ or 100 kΩ through software. An external divider resistor can also be used instead. LVD Function The bluemoon EV Board allows 3.3 V or 5 V voltage power supply and the LCD controller auto- adapt power, so should used LVD function. www.cypress.com Document No. 002-05404 Rev.*A 8 FM3 MB9AA30N Series Bluemoon-EVB_LCD 6 Additional Information For more information on Cypress products, please visit the following website: http://www.cypress.com/cypress-microcontrollers www.cypress.com Document No. 002-05404 Rev.*A 9 FM3 MB9AA30N Series Bluemoon-EVB_LCD Document History Document Title: AN205404 – FM3 MB9AA30N Series Bluemoon-EVB_LCD Document Number: 002-05404 Revision ECN Orig. of Change Submission Date ** - CHMA 10/30/2012 Initial release *A 5281405 CHMA 05/26/2016 Migrated Spansion Application Note MCU-AN-510120-E-10 to Cypress format. www.cypress.com Description of Change Document No. 002-05404 Rev.*A 10 FM3 MB9AA30N Series Bluemoon-EVB_LCD 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 ARM® Cortex® Microcontrollers cypress.com/arm PSoC 1 | PSoC 3 | PSoC 4 | PSoC 5LP Automotive cypress.com/automotive Cypress Developer Community Clocks & Buffers cypress.com/clocks Interface cypress.com/interface Lighting & Power Control cypress.com/powerpsoc Memory cypress.com/memory PSoC cypress.com/psoc Touch Sensing cypress.com/touch USB Controllers cypress.com/usb Wireless/RF cypress.com/wireless Forums | Projects | Videos | Blogs | Training | Components Technical Support cypress.com/support PSoC is a registered trademark and PSoC Creator is a trademark of Cypress Semiconductor Corporation. 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, 2012-2016. This document is the property of Cypress Semiconductor Corporation and its subsidiaries, including Spansion LLC (“Cypress”). This document, including any software or firmware included or referenced in this document (“Software”), is owned by Cypress under the intellectual property laws and treaties of the United States and other countries worldwide. Cypress reserves all rights under such laws and treaties and does not, except as specifically stated in this paragraph, grant any license under its patents, copyrights, trademarks, or other intellectual property rights. If the Software is not accompanied by a license agreement and you do not otherwise have a written agreement with Cypress governing the use of the Software, then Cypress hereby grants you a personal, non-exclusive, nontransferable license (without the right to sublicense) (1) under its copyright rights in the Software (a) for Software provided in source code form, to modify and reproduce the Software solely for use with Cypress hardware products, only internally within your organization, and (b) to distribute the Software in binary code form externally to end users (either directly or indirectly through resellers and distributors), solely for use on Cypress hardware product units, and (2) under those claims of Cypress’s patents that are infringed by the Software (as provided by Cypress, unmodified) to make, use, distribute, and import the Software solely for use with Cypress hardware products. Any other use, reproduction, modification, translation, or compilation of the Software is prohibited. TO THE EXTENT PERMITTED BY APPLICABLE LAW, CYPRESS MAKES NO WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, WITH REGARD TO THIS DOCUMENT OR ANY SOFTWARE OR ACCOMPANYING HARDWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. To the extent permitted by applicable law, Cypress reserves the right to make changes to this document without further notice. Cypress does not assume any liability arising out of the application or use of any product or circuit described in this document. Any information provided in this document, including any sample design information or programming code, is provided only for reference purposes. It is the responsibility of the user of this document to properly design, program, and test the functionality and safety of any application made of this information and any resulting product. Cypress products are not designed, intended, or authorized for use as critical components in systems designed or intended for the operation of weapons, weapons systems, nuclear installations, life-support devices or systems, other medical devices or systems (including resuscitation equipment and surgical implants), pollution control or hazardous substances management, or other uses where the failure of the device or system could cause personal injury, death, or property damage (“Unintended Uses”). A critical component is any component of a device or system whose failure to perform can be reasonably expected to cause the failure of the device or system, or to affect its safety or effectiveness. Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products. You shall indemnify and hold Cypress harmless from and against all claims, costs, damages, and other liabilities, including claims for personal injury or death, arising from or related to any Unintended Uses of Cypress products. Cypress, the Cypress logo, Spansion, the Spansion logo, and combinations thereof, PSoC, CapSense, EZ-USB, F-RAM, and Traveo are trademarks or registered trademarks of Cypress in the United States and other countries. For a more complete list of Cypress trademarks, visit cypress.com. Other names and brands may be claimed as property of their respective owners. www.cypress.com Document No. 002-05404 Rev.*A 11