Nuvoton M032 Quick Start Manual
Hide thumbs Also See for M032:

Advertisement

Quick Links

Document Information
Abstract
Apply to
The information described in this document is the exclusive intellectual property of
Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton.
Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system design.
For additional information or questions, please contact: Nuvoton Technology Corporation.
Oct. 03, 2019
M032 emWin Quick Start Guide
Introduce the steps to build and launch emWin for the M032 series
microcontroller (MCU).
®
NuMicro
M032 series
Nuvoton assumes no responsibility for errors or omissions.
All data and specifications are subject to change without notice.
www.nuvoton.com
Page 1 of 17
M032 emWin
Rev 1.00

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the M032 and is the answer not in the manual?

Questions and answers

Summary of Contents for Nuvoton M032

  • Page 1 The information described in this document is the exclusive intellectual property of Nuvoton Technology Corporation and shall not be reproduced without permission from Nuvoton. Nuvoton is providing this document only for reference purposes of NuMicro microcontroller based system design. Nuvoton assumes no responsibility for errors or omissions.
  • Page 2: Table Of Contents

    M032 emWin Table of Contents INTRODUCTION ........................3 EMWIN BSP DIRECTORY STRUCTURE..............4 2.1 Sample Codes (SampleCode\NuMaker) ................... 4 2.2 Configuration Files (ThirdParty\emWin\Config) ..............4 2.3 Documents (ThirdParty\emWin\Doc) ..................4 2.4 Include Files (ThirdParty\emWin\Include) ................4 2.5 Library (ThirdParty\emWin\Lib) ....................5 2.6 Tools (ThirdParty\emWin\Tool) ....................
  • Page 3: Introduction

    GUI for any application that operates with a graphical display. Nuvoton provides emWin GUI library for free with the M032 series microcontroller (MCU) supporting up to 320x240 (16 bpp) resolution. The emWin platform can be implemented on HMI for industrial, machines, appliances, etc.
  • Page 4: Emwin Bsp Directory Structure

    M032 emWin 2 emWin BSP Directory Structure This chapter introduces emWin related files and directories in the M032 BSP. 2.1 Sample Codes (SampleCode\NuMaker) emWin_GUIDemo Utilize emWin library to demonstrate widgets feature. emWin_SimpleDemo Utilize emWin library to demonstrate interactive feature. 2.2 Configuration Files (ThirdParty\emWin\Config) GUI_X.c...
  • Page 5: Library (Thirdparty\Emwin\Lib)

    M032 emWin 2.5 Library (ThirdParty\emWin\Lib) NUemWin_CM0_Keil.lib emWin library Keil for M032 series MCU. libNUemWin_CM0_GNU.a emWin library GNU for M032 series MCU. NUemWin_CM0_IAR.a emWin library IAR for M032 series MCU. 2.6 Tools (ThirdParty\emWin\Tool) BmpCvtNuvoton.exe The Bitmap Converter is designed for converting common image file formats like BMP, PNG or GIF into the desired emWin bitmap format.
  • Page 6: Emwin Sample Code

    M032 emWin 3 emWin Sample Code There are two emWin sample codes in the M032 BSP SampleCode\NuMaker directory:  emWin_GUIDemo: utilizes the emWin library to demonstrate widgets feature;  emWin_SimpleDemo: utilizes the emWin library to demonstrate interactive feature. 3.1 Project Structure The following uses emWin_SimpleDemo as a sample to explain the emWin project structure in BSP.
  • Page 7: System Initialization

    M032 emWin 3.2 System Initialization The system initialization code is located in main function, including peripheral clock preparation, multi-function pin configuration, and UART debug port setting. Also, a 1000Hz timer is configured to keep track of time elapsed. int main(void) // Init System, IP clock and multi-function I/O _SYS_Init();...
  • Page 8: Emwin Initialization

    M032 emWin UART_Open(UART0, 115200); // Enable Timer0 clock and select Timer0 clock source CLK_EnableModuleClock(TMR0_MODULE); CLK_SetModuleClock(TMR0_MODULE, CLK_CLKSEL1_TMR0SEL_HXT, 0); // Initial Timer0 to periodic mode with 1000Hz TIMER_Open(TIMER0, TIMER_PERIODIC_MODE, 1000); // Enable Timer0 interrupt TIMER_EnableInt(TIMER0); NVIC_EnableIRQ(TMR0_IRQn); // Start Timer0 TIMER_Start(TIMER0); printf("\n\nCPU @ %d Hz\n", SystemCoreClock);...
  • Page 9: Build Emwin Project

    M032 emWin while (1) GUI_Delay(1000); 3.4 Build emWin Project To build the emWin project in Keil MDK, click the rebuild icon as shown below or press F7 function key. 3.5 Download and Run Press Ctrl + F5 to download the application and start a debug session or click start/stop debug session icon as shown below.
  • Page 10: Touch Screen

    M032 emWin 3.6 Touch Screen To support resistive touch screen, use ADC to convert the voltage of X axis and Y axis, and then use the open source tslib to map the ADC conversion result into the coordination. The conversion result can be affected by power noise, mechanical misalignment, etc. To overcome this issue, the tslib supports calibration function, and the calibration parameter is stored ether in APROM.
  • Page 11 M032 emWin FMC_DISABLE_AP_UPDATE(); else ts_readfile(); /* Disable FMC ISP function */ FMC_Close(); /* Lock protected registers */ SYS_LockReg(); Oct. 03, 2019 Page 11 of 17 Rev 1.00...
  • Page 12: Emwin Guibuilder

    M032 emWin 4 emWin GUIBuilder 4.1 Create Widget Segger provides a Windows tool GUIBuilder to create application with drag and drop interface. The tool is located under the ThirdParty\emWin\Tool\ directory. This tool can generate a file named FramewinDLG.c for the widget of target application. Please refer to chapter 20 of UM03001_emWin5.pdf for the usage of GUIBuilder.
  • Page 13 M032 emWin sprintf(sBuf,"%d ", value); hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, sBuf); // USER START (Optionally insert additional code for further widget initialization) // USER END break; case WM_NOTIFY_PARENT: = WM_GetId(pMsg->hWinSrc); NCode = pMsg->Data.v; switch(Id) case ID_BUTTON_0: // Notifications sent by '+ 1'...
  • Page 14: Change Display Panel

    M032 emWin 5 Change Display Panel 5.1 emWin Display Configuration emWin declares its display panel resolution in LCDConf.c under the ThirdParty\emWin\Config\ directory. The resolution is different from the touch panel resolution defined in the TouchPanel.h. This is because the panel is a portrait display and data is swapped before output for a landscape view by LCD driver IC.
  • Page 15: Supporting Resources

    M032 emWin 6 Supporting Resources Segger provides an emWin supporting forum. Questions regarding emWin usage are discussed at: https://forum.segger.com/index.php/Board/12-emWin-related/. The M032 system related issues can be posted in Nuvoton’s HMI/GUI forum at: http://forum.nuvoton.com/viewforum.php?f=31. Oct. 03, 2019 Page 15 of 17...
  • Page 16 M032 emWin Revision History Date Revision Description 2019.10.03 1.00 Initially issued. Oct. 03, 2019 Page 16 of 17 Rev 1.00...
  • Page 17 M032 emWin Important Notice Nuvoton Products are neither intended nor warranted for usage in systems or equipment, any malfunction or failure of which may cause loss of human life, bodily injury or severe property damage. Such applications are deemed, “Insecure Usage”.

Table of Contents