Hello. I'm STemWin v5.44 user.
My TFT: lcdwiki.com/3.97inch_16BIT_Module_NT35510_SKU:MRB3973
TFT connection: STM32F103VET6, FSMC 16bit.
The problem is this TFTs Novatek NT35510 based and it currently not supported by emWin. However, it command set is very similar to ILI9486 TFT controller, so we could try to add this "support" on the fly if two routines have been rewritten in LCDConf_FlexColor.c file:
Display All
Also I use this version of LCD_X_Config func:
Display All
I test this routines with most of my project objects (buttons, windows, text fields and so on). It all working well! There are only TWO things do not work: text output with GUI_TM_NORMAL and GUI_TM_REV modes.
It can be subject of NT35510 low level init problem or the emWin lib problem, but I not so awesome to find a point of this problem....
For example, the user manual test code produce the following pic on my TFT:
Display All
So, where the NORMAL and REV text mode output used the output is wrong. Next example have the text '123' inside the Edit field:
My project currently is totally frozen without NORMAL mode text output. Could you please help?
My TFT: lcdwiki.com/3.97inch_16BIT_Module_NT35510_SKU:MRB3973
TFT connection: STM32F103VET6, FSMC 16bit.
The problem is this TFTs Novatek NT35510 based and it currently not supported by emWin. However, it command set is very similar to ILI9486 TFT controller, so we could try to add this "support" on the fly if two routines have been rewritten in LCDConf_FlexColor.c file:
Source Code
- /********************************************************************
- *
- * LcdWriteReg
- *
- * Function description:
- * Sets display register
- */
- uint16_t cmd; // current NT35510 cmd
- uint8_t i; // current cmd parameter
- static void LcdWriteReg(U16 Data) {
- // ... TBD by user
- Data <<= 8;cmd = Data;i=0;
- *(uint16_t *)ADR_CMD = Data;
- }
- /********************************************************************
- *
- * LcdWriteData
- *
- * Function description:
- * Writes a value to a display register
- */
- static void LcdWriteData(U16 Data) {
- // ... TBD by user
- switch(cmd){
- case 0x2A00:case 0x2B00:// cmd id incremented commands
- if (i == 0){// first cmd parametr
- *(uint16_t *)ADR_DAT = Data;
- }else{// next cmd/par in NT35510 format
- *(uint16_t *)ADR_CMD = cmd+i;*(uint16_t *)ADR_DAT = Data;
- }
- i++;
- break;
- case 0x2C00:case 0x2E00:case 0x3600:// common cmds
- *(uint16_t *)ADR_DAT = Data;
- break;
- default:// currently "unknown" cmds
- while(1);// cmd format need to be attended before execution
- break;
- }
- }
- /********************************************************************
Source Code
- void LCD_X_Config(void) {
- GUI_DEVICE * pDevice;
- CONFIG_FLEXCOLOR Config = {0};
- GUI_PORT_API PortAPI = {0};
- // Set display driver and color conversion
- pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR,GUICC_M565,0,0);
- // Display driver configuration
- LCD_SetSizeEx(0,YSIZE_PHYS,XSIZE_PHYS);
- LCD_SetVSizeEx(0,VYSIZE_PHYS,VXSIZE_PHYS);
- // Orientation
- Config.Orientation = GUI_ROTATION_CW;// STemWin v5.44 only
- //Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_X;// STemWin v5.32 only
- //Config.Orientation = GUI_SWAP_XY;
- GUIDRV_FlexColor_Config(pDevice,&Config);
- // Set controller and operation mode
- PortAPI.pfWrite16_A0 = LcdWriteReg;
- PortAPI.pfWrite16_A1 = LcdWriteData;
- PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
- PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
- GUIDRV_FlexColor_SetFunc(pDevice,&PortAPI,GUIDRV_FLEXCOLOR_F66709,GUIDRV_FLEXCOLOR_M16C0B16);
- }
It can be subject of NT35510 low level init problem or the emWin lib problem, but I not so awesome to find a point of this problem....
For example, the user manual test code produce the following pic on my TFT:
Source Code
- // UM03001_v6.18.pdf page215 text output snippet
- GUI_SetFont(&GUI_Font8x16);
- GUI_SetBkColor(GUI_BLUE);
- GUI_Clear();
- GUI_SetPenSize(10);
- GUI_SetColor(GUI_RED);
- GUI_DrawLine(80, 10, 240, 90);
- GUI_DrawLine(80, 90, 240, 10);
- GUI_SetBkColor(GUI_BLACK);
- GUI_SetColor(GUI_WHITE);
- GUI_SetTextMode(GUI_TM_NORMAL);
- GUI_DispStringHCenterAt("GUI_TM_NORMAL", 160, 20);
- GUI_SetTextMode(GUI_TM_REV);
- GUI_DispStringHCenterAt("GUI_TM_REV", 160, 36);
- GUI_SetTextMode(GUI_TM_TRANS);
- GUI_DispStringHCenterAt("GUI_TM_TRANS", 160, 52);
- GUI_SetTextMode(GUI_TM_XOR);
- GUI_DispStringHCenterAt("GUI_TM_XOR", 160, 68);
- GUI_SetTextMode(GUI_TM_TRANS | GUI_TM_REV);
- GUI_DispStringHCenterAt("GUI_TM_TRANS | GUI_TM_REV", 160, 84);
So, where the NORMAL and REV text mode output used the output is wrong. Next example have the text '123' inside the Edit field:
My project currently is totally frozen without NORMAL mode text output. Could you please help?