emWin Mirrored LCD problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

emWin Mirrored LCD problem

1,441 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by e135193 on Fri Sep 14 12:22:36 MST 2012
Hello

     I have a problem on my LCD. I'm using emWin 5.14. It displays the graph as mirrored like on the attached picture file. Is there a way to fix it ?
    
     On the file "LCD_ConfDefaults.h", there are lines like below. I tried to change and compile but nothing has changed.

  #define LCD_MIRROR_X 0
  #define LCD_MIRROR_Y 0


    I need some help guys.


engin
Labels (1)
0 Kudos
5 Replies

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Karl on Sat Sep 15 02:51:51 MST 2012
As GUIDRV_LIN_OX_16 didn't do the job, try one of the other available options for the 16-bit linear framebuffer driver.
These definitions are from GUIDRV_Lin.h:

<code>
  #define GUIDRV_LIN_16      &GUIDRV_Lin_16_API
  #define GUIDRV_LIN_OY_16   &GUIDRV_Lin_OY_16_API
  #define GUIDRV_LIN_OX_16   &GUIDRV_Lin_OX_16_API
  #define GUIDRV_LIN_OXY_16  &GUIDRV_Lin_OXY_16_API
  #define GUIDRV_LIN_OS_16   &GUIDRV_Lin_OS_16_API
  #define GUIDRV_LIN_OSY_16  &GUIDRV_Lin_OSY_16_API
  #define GUIDRV_LIN_OSX_16  &GUIDRV_Lin_OSX_16_API
  #define GUIDRV_LIN_OSXY_16 &GUIDRV_Lin_OSXY_16_API
</code>


0 Kudos

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by e135193 on Sat Sep 15 01:20:19 MST 2012
Hello 

     I'm using 7" Display and it is not the EA's LCD. Below code is my settings.

     I tired to change IHS and IVS bits and did 4 combination but nothing changed.


#define HBP_TRULY_3_2   40       // Horizontal back porch in clocks
#define HFP_TRULY_3_2   40       // Horizontal front porch in clocks
#define HSW_TRULY_3_2   48       // HSYNC pulse width in clocks
#define PPL_TRULY_3_2   800      // Pixels per line
#define VBP_TRULY_3_2   29       // Vertical back porch in clocks
#define VFP_TRULY_3_2   13       // Vertical front porch in clocks
#define VSW_TRULY_3_2   3        // VSYNC pulse width in clocks
#define LPP_TRULY_3_2   480      // Lines per panel
#define IOE_TRULY_3_2   1        // Invert output enable, 1 = invert
#define IPC_TRULY_3_2   1        // Invert panel clock, 1 = invert
#define IHS_TRULY_3_2   1        // Invert HSYNC, 1 = invert
#define IVS_TRULY_3_2   1        // Invert VSYNC, 1 = invert
#define ACB_TRULY_3_2   1        // AC bias frequency in clocks (not used)
#define BPP_TRULY_3_2   16       // Bits per pixel b110 = 16 bpp 5:6:5 mode
#define CLK_TRULY_3_2   33500000 // Optimal clock rate (Hz) between 1-8.22 MHz according to SSD1289 datasheet
#define LCD_TRULY_3_2   0        // Panel type; 0: LCD TFT panel
#define DUAL_TRULY_3_2  0        // No dual panel



        I also tried the below code but it just changed my orientation. no mirror effect.


/* Default orientation */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_16, GUICC_M565, 0, 0);

/* Mirror the X axis */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_OX_16, GUICC_M565, 0, 0);
0 Kudos

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Fri Sep 14 14:27:01 MST 2012
Hi engin,
Could you please post your H/W details
0 Kudos

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Karl on Fri Sep 14 13:09:09 MST 2012
Hi Engin,

Assuming you are using the linear framebuffer driver, this is pretty easy to accomplish in emWin. The first parameter passed to GUI_DEVICE_CreateAndLink() determines the orientation. You have the option of mirroring an axis, or swapping X and Y. Look for that call in the LCD_X_Config() function in LCDConf.c.

<code>
/* Default orientation */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_16, GUICC_M565, 0, 0);

/* Mirror the X axis */
GUI_DEVICE_CreateAndLink(GUIDRV_Lin_OX_16, GUICC_M565, 0, 0);
</code>

All available options are listed in the emWin documentation (Display Driver chapter).

Depending on what display you have, there may be another option. If your display has a programmable driver on board, typically with an SPI interface, it is very likely that you can select a scan order there. Embedded Artists have a 3.5" display with an SSD1289 controller, which allows you to mirror each axis as required.

If your display supports it, this is the preferred place to mirror the output. Letting emWin do the job comes at the cost of extra CPU activity. It is better to use the default emWin driver, and let the display controller do the job in hardware.

Regards,
Karl

0 Kudos

940 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dave on Fri Sep 14 12:55:43 MST 2012
Have a look at bit 12 in the LCD_POL register...  When you setup your LCD, did you set this bit?  If so, try resetting it ( or vice-versa if you didn't set it )...

This might help your problem...

0 Kudos