THIS SPEC IS OBSOLETE Spec No: 002-05127 Spec Title: AN205127 -F2MC-8FX Family MB95410H/470H Series 8-Bit Microcontroller One Phase Power Meter (RN8209) Solution Display Operation Replaced by: NONE AN205127 F²MC-8FX Family MB95410H/470H Series 8-Bit Microcontroller One Phase Power Meter (RN8209) Solution Display Operation Associated Part Family: MB95410H/470H Series This application note describes how to use One Phase Power Meter (RN8209) solution’s display function. 1 Introduction This application note describes how to use One Phase Power Meter (RN8209) solution’s display function. Section 2 explains the Background. Section 3 explains the HW Diagram. Section 4 explains the HW Reference SCH. Section 5 explains the FW Diagram. Section 6 explains the FW Function List. 2 Background Background of display Function 2.1 Overview On the power meter box, there are 2 keys, display key and program key. The system’s default display mode is auto roll displaying, and each display page delay for 5 seconds. When you put down the display key, display mode will change to manual roll displaying. And if you don’t put down the display key for 30 seconds, display mode will change to auto roll displaying again. 3 HW Diagram Hardware diagram of display unit 3.1 HW Diagram of Display Unit Figure 1. Hardware diagram 8COM LCD www.cypress.com MB95F418 Document No. 002-05127 Rev. *A 1 One Phase Power Meter (RN8209) Solution Display Operation 4 HW Reference SCH Hardware reference SCH of display unit 1 2 3 4 5 6 7 8 9 10 11 12 13 BL+ BL27 COM0 COM1 COM2 COM3 COM4 COM5 COM6 COM7 SEG00 SEG01 SEG02 SEG03 SEG04 BL- LCD_COM0 LCD_COM1 LCD_COM2 LCD_COM3 LCD_COM4 LCD_COM5 LCD_COM6 LCD_COM7 LCD_SEG0 LCD_SEG1 LCD_SEG2 LCD_SEG3 LCD_SEG4 BL+ U10 28 Figure 2. 8COM LCD Interface SEG05 SEG06 SEG07 SEG08 SED09 SEG10 SEG11 SEG12 SEG13 SEG14 SEG15 SEG16 NC 14 15 16 17 18 19 20 21 22 23 24 25 26 LCD_SEG5 LCD_SEG6 LCD_SEG7 LCD_SEG8 LCD_SEG9 LCD_SEG10 LCD_SEG11 LCD_SEG12 LCD_SEG13 LCD_SEG14 LCD_SEG15 LCD_SEG16 SEGLCD_8COM Figure 3. 8COM LCD Module www.cypress.com Document No. 002-05127 Rev.*A 2 One Phase Power Meter (RN8209) Solution Display Operation 5 FW Diagram Firmware system diagram 5.1 Firmware System Diagram Figure 4. Firmware System Diagram Start Init LCDCC1 Init LCDCC2 Init LCDCE1 Init COM and SEG port Clear the LCD Build auto-roll display content Display the first page If put down the display key? Y Build manual-roll display content N N Update the display page 5s time out? Y Update the display page If put down the display key? Y N 30s time out? Y N www.cypress.com Document No. 002-05127 Rev.*A 3 One Phase Power Meter (RN8209) Solution Display Operation 6 FW Function List 6.1 API Table 1. FW API List Function Prototype Description void Lcd_Init(void) LCD module initialization void LoadLcdPara(INT8U* lcdPara) Load LCD display parameters from EEPROM void LcdPowerCtl(INT8U pwrNml) LCD power on/save control void LcdPageDisplay(void) Display various data page on LCD screen void LcdPageManual(INT8U pageSet) Manual change LCD page void LcdPageChange(INT8U pageSet) LCD screen page up/down control void* FindPageDispThread(INT8U* targetId) Find page display thread using data ID void BuildPowerUpLcdPage(void) Build Power-up LCD page content void BuildAutoRollLcdPage(void) Build auto-rolling LCD page content void BuildManlRollLcdPage(void) Build manual-rolling LCD page list void BuildPowerDnLcdPage(void) Build power-down LCD page content void LcdParaReloadEnable(void) Enable LCD parameter reload using system reset void DispSegmentEnergy(INT8U pageMode, INT8U monthId, INT8U dispSegId) Display segment energy void DispPrepayBalance(INT8U pageMode) Display prepay balance void DispCurrentTarrifRate(INT8U pageMode) Display current tariff rate void DispUserNumLow8b(INT8U pageMode) Display user number low 8 bit void DispUserNumHigh4b(INT8U pageMode) Display user number high 8 bit void DispMeterNumLow8b(INT8U pageMode) Display meter number low 8 bit void DispMeterNumHigh4b(INT8U pageMode) Display meter number high 8 bit void DispErrorNum(INT8U pageMode) Display error number void DispVoltage(INT8U pageMode) Display voltage void DispLoadCurrent(INT8U pageMode) Display load current void DispNeutralCurrent(INT8U pageMode) Display neutral current void DispPower(INT8U pageMode) Display power void DispPowerFactor(INT8U pageMode) Display power factor void DispCurrentDate(INT8U pageMode) Display current date void DispCurrentTime(INT8U pageMode) Display current time www.cypress.com Document No. 002-05127 Rev.*A 4 One Phase Power Meter (RN8209) Solution Display Operation 6.2 HAL Table 2. FW HAL List Function Prototype Description void LcdCardCommDisp(INT8U value) void LcdEnergyPurchaseDisp(INT8U onOff) void LcdEnergyPurchaseDisp(INT8U onOff) void BcdCount2LcdDigit(INT8U *bcdCount, INT8U *lcdDigit) Convert 4 bytes of BCD string to 8 digits of LCD display data string void LcdMainLineDisp(INT8U* dataStr) Display main line on LCD screen void LcdDigitDisp(INT8U digitId, INT8U digitCode) Display a digit on LCD screen void LcdColonDisp(INT8U colonTag) Display colon on LCD screen void LcdDotDisp(INT8U dpTag) Display dot-point on LCD screen void LcdLedTimeSegId(INT8U segId) Display tariff time-seg LED id void LcdTxtTimeSegId(INT8U segId) Display time-seg text id void LcdDateTimeDisp(INT8U dtState) Display date/time text void LcdLastMonthDisp(INT8U month) Display month void LcdBattDisp(INT8U battState) Set LCD battery Display On/Off void LcdCommDisp(INT8U ch, INT8U commState) Set LCD Comm Display On/Off void LcdProgramDisp(INT8U programState) Set LCD programmable sign Display On/Off void LcdLockDisp(INT8U lockState) Set LCD Lock Display On/Off void LcdKwhDisp(INT8U kwhState) Set LCD KWh Display On/Off void LcdKwDisp(INT8U kwState) Set LCD KW Display On/Off void LcdRmbDisp(INT8U rmbState) Set LCD RMB Display On/Off void LcdEnergyDirDisp(void) Display Energy direction INT8U LcdRemoveHeading0(INT8U *buff, INT8U ptPos) Remove useless heading zero for main display line void LcdNegativeSignDisp(INT8U onOff) Set negative sign Display On/Off void LcdCosineSignDisp(INT8U onOff) Set cosine sign Display On/Off void LcdDatSend(INT8U* dispDat, INT8U size)c Send a string of display data to LCD controller module www.cypress.com Document No. 002-05127 Rev.*A 5 One Phase Power Meter (RN8209) Solution Display Operation 7 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-05127 Rev.*A 6 One Phase Power Meter (RN8209) Solution Display Operation Document History Document Title: AN205127 – F²MC-8FX Family MB95410H/470H Series 8-Bit Microcontroller One Phase Power Meter (RN8209) Solution Display Operation Document Number: 002-05127 Revision ECN Orig. of Change Submission Date Description of Change ** - HUAL 06/01/2011 Initial release *A 5257281 HUAL 05/20/2016 Migrated Spansion Application Note MCU-AN-500111-E-10 to Cypress format. Document obsoleted. www.cypress.com Document No. 002-05127 Rev.*A 7 One Phase Power Meter (RN8209) Solution Display Operation 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, 2011-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-05127 Rev.*A 8