Do you have a question about the N9H26 emWin and is the answer not in the manual?
Questions and answers
Summary of Contents for Nuvoton N9H26 emWin
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 and microprocessor based system design. Nuvoton assumes no responsibility for errors or omissions.
GUI for any application that operates with a graphical display. Nuvoton provides emWin GUI library for free with the N9H26 series microprocessor (MPU) supporting up to 800x480 (24 bpp) resolution (depending on frame rate). The emWin platform can be implemented on HMI for industrial, machines, appliances, etc.
2.4 BSP\ThirdParty\emWin\Doc AN03002_Custom_ emWin custom widget type creation guide. Widget_Type.pdf UM03001_emWin.pdf emWin user guide and reference manual. Nuvoton font tool “FontArchitect.exe” user guide and reference UM_Font_Architect_ EN_Rev1.03.pdf manual in English. Nuvoton font tool “FontArchitect.exe” user guide and reference UM_Font_Architect_ TC_Rev1.03.pdf manual in Chinese.
This tool can show the previously created emWin Movie File (EMF) on a Computer with a Windows operating system. FontArchitect.exe A Nuvoton tool for creating emWin bitmap font format. GUIBuilder.exe A tool for creating dialogs by drag and drop operation.
N9H26 emWin 3 emWin Sample Code There are three emWin sample codes in the N9H26 “BSP\SampleCode\emWin\” directory: GUIDemo: Utilizes emWin library to demonstrate widgets feature; SimpleDemo: Utilizes emWin library to demonstrate interactive feature. SimpleDemoAppWizard: Utilizes AppWizard to demonstrate interactive feature.
Page 7
N9H26 emWin the number shown in the text field by clicking four buttons shown on the display panel. Figure 3-3 emWin SimpleDemo on NuMaker Board The project structure is shown in Figure 3-4. The project contains a default target: ...
N9H26 emWin Figure 3-4 emWIn SImpleDemo Project Tree on Keil MDK 3.3 System Initialization The system initialization code is located in main function, including peripheral clock preparation, cache, LCD interface, touch screen interface and UART debug port setting. Also, a 1000Hz timer is configured to keep track of time elapsed.
BSP/SampleCode/emWin/SimpleDemo/Bin directory to DDR by TurboWriter, or download the newly built image by ICE. Nuvoton provides TurboWriter tool for downloading firmware to DDR, SPI Flash, NAND Flash, or SD card. To download images by TurboWriter, connect the N9H26 NuDesign board with PC via an USB cable and the execute TurboWriter. Further information can be found in the TurboWriter Tool User Guide under N9H26_emWin_NonOS- master/Tools/PC_Tools directory.
Page 11
0x0, and then click the Download button. For more information, please refer to N9H26 TurboWriter User Manual under BSP’s Documents/ directory. Figure 3-7 Nuvoton Windows Tool TruboWriter Main Page The N9H26 JTAG interface configuration is shown as Figure 3-8: Mar.
Page 12
N9H26 emWin Figure 3-8 JLink Setting on Keil MDK Press Ctrl + F5 to download the application and start a debug session or click Start/stop debug session icon shown as Figure 3-9. Figure 3-9 Shortcut Icon to Download Binary to Device and Start/Stop Debug Session After entering debug session, press F5 to start code execution.
N9H26 emWin 3.7 Touch Screen To support resistive touch screen, use ADC to convert the voltage of X axis and Y axis, and then 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 in SD card.
Page 14
N9H26 emWin #ifdef __480x272__ #define XSIZE_PHYS #define YSIZE_PHYS #else #define XSIZE_PHYS #define YSIZE_PHYS #endif #endif #define LCD_XSIZE XSIZE_PHYS #define LCD_YSIZE YSIZE_PHYS #endif If a SD card is used to store calibration parameters, main function will load the parameter file ts_calib from the SD card root directory. If the parameter doesn’t exist, main function will call ts_calibrate() to generate a copy.
N9H26 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 “BSP\ThirdParty\emWin\Tool\” directory. This tool can generate a file named FramewinDLG.c for the widget of target application. Please refer to GUI Builder chapter of UM03001_emWin.pdf for the usage of GUIBuilder.
Page 17
N9H26 emWin switch(Id) { case ID_BUTTON_0: // Notifications sent by 'NVT_Button_+1' switch(NCode) { case WM_NOTIFICATION_CLICKED: // USER START (Optionally insert code for reacting on notification message) // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) value += 1;...
Page 18
N9H26 emWin // USER END break; case WM_NOTIFICATION_RELEASED: // USER START (Optionally insert code for reacting on notification message) value -= 1; sprintf(sBuf,"%d ", value); hItem = WM_GetDialogItem(pMsg->hWin, ID_EDIT_0); EDIT_SetText(hItem, sBuf); // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END break;...
Page 19
N9H26 emWin break; case WM_NOTIFICATION_VALUE_CHANGED: // USER START (Optionally insert code for reacting on notification message) // USER END break; // USER START (Optionally insert additional code for further notification handling) // USER END break; // USER START (Optionally insert additional code for further Ids) // USER END break;...
N9H26 emWin 5 Change Display Panel 5.1 emWin Display Configuration emWin declares its display panel resolution in LCDConf.h and color depth in LCDConf.c. Both files can be found at BSP\ThirdParty\emWin\Config directory. // Example for RGB565 in LCDConf.c // Color conversion...
N9H26 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 N9H26 system related issues can be posted in Nuvoton’s Arm7/9 forum at: http://forum.nuvoton.com/viewforum.php?f=12. HMI/GUI forum at: http://forum.nuvoton.com/viewforum.php?f=31. Mar. 28, 2023 Page 21 of 23 Rev 1.02...
Page 22
N9H26 emWin Revision History Date Revision Description 2020.10.7 1.00 Initial version. Added emWin installation and modified touch 2022.02.24 1.01 screen chapter. 2023.03.28 1.02 Updated emWin files. Mar. 28, 2023 Page 22 of 23 Rev 1.02...
Page 23
N9H26 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”.
Need help?
Do you have a question about the N9H26 emWin and is the answer not in the manual?
Questions and answers