AnsweredAssumed Answered

using emWin with LCD with three controllers

Question asked by ashraf.salahuddin on Dec 28, 2014
Hi everyone

I'm trying to display on LM19264k LCD which is controlled by 3 controllers of type S6B0108
I'm using three instances of  GUIDRV_SPage display driver of emWin and a GUIDRV_DIST driver of emWin.
I'm able to display on the LCD, the problem is that when I tried to display my name "Salahuddin" on the LCD using 
GUI_DispStringAt("Salahuddin Ashraf", 0, 0);
my name was displayed 4 times vertically and 3 times horizontally .. and it was overlapped like this "Ashrafdin"

here's my code 
         
//
// Physical display size (128 x 64)
//
#define XSIZE_PHYS 192
#define YSIZE_PHYS 64
//
// color conversion
//
#define COLOR_CONVERSION GUICC_1

//
// Display driver 
//
#define DISPLAY_DRIVER GUIDRV_SPAGE_1C0

//
// Buffers / VScreens
//
#define NUM_BUFFERS  1 // Number of multiple buffers to be used
#define NUM_VSCREENS 1 // Number of virtual screens to be used

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_X_Config
*
* Purpose:
*   Called during the initialization process in order to set up the
*   display driver configuration.
*   
*/
void LCD_X_Config(void) {
  
  CONFIG_SPAGE Config = {0};
  GUI_DEVICE *pDevice, *pDevice0, *pDevice1, *pDevice2; 
  GUI_PORT_API PortAPI = {0};
  GUI_RECT Rect0, Rect1, Rect2;
  
  //
  // At first initialize use of multiple buffers on demand
  //
  #if (NUM_BUFFERS > 1)
    GUI_MULTIBUF_Config(NUM_BUFFERS);
  #endif
  //
  // Set display driver and color conversion for 1st layer
  // On success the function returns a pointer to the created device object,
  // otherwise it returns NULL
  //
  pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_DIST, COLOR_CONVERSION, 0, 0);
  //
  // Display driver configuration, required for Lin-driver
  //
  if (LCD_GetSwapXY()) {
    LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
    LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
  } else {
    LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
    LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
  }
  LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
  
  //
  // Create first display driver
  //
  pDevice0 = GUI_DEVICE_Create(DISPLAY_DRIVER, COLOR_CONVERSION, 0, -1);
  //
  // Configuration of first driver
  //
  //
  //  Driver configuration
  //
  Config.FirstSEG = 0;
  Config.FirstCOM = 0;
  GUIDRV_SPage_Config(pDevice0, &Config);
  //
  //  Configure hardware routines
  //
  PortAPI.pfWrite8_A0 = vWriteCommand;
  PortAPI.pfWrite8_A1 = vWriteData;
  PortAPI.pfWriteM8_A1 = vWriteDataM;
  PortAPI.pfRead8_A1 = u8ReadData;
  PortAPI.pfRead8_A0 = u8ReadStatus;
  GUIDRV_SPage_SetBus8(pDevice0, &PortAPI);
  //
  //  Controller configuration
  //
  GUIDRV_SPage_Set1510(pDevice0);
  
  
  //
  // Create second display driver
  //
  pDevice1 = GUI_DEVICE_Create(DISPLAY_DRIVER, COLOR_CONVERSION, 0, -1);
  //
  // Configuration of second driver
  //
  //
  //  Driver configuration
  //
  Config.FirstSEG = 0;
  Config.FirstCOM = 0;
  GUIDRV_SPage_Config(pDevice1, &Config);
  //
  //  Configure hardware routines
  //
  PortAPI.pfWrite8_A0 = vWriteCommand;
  PortAPI.pfWrite8_A1 = vWriteData;
  PortAPI.pfWriteM8_A1 = vWriteDataM;
  PortAPI.pfRead8_A1 = u8ReadData;
  PortAPI.pfRead8_A0 = u8ReadStatus;
  GUIDRV_SPage_SetBus8(pDevice1, &PortAPI);
  //
  //  Controller configuration
  //
  GUIDRV_SPage_Set1510(pDevice1);
  
  //
  // Create third display driver
  //
  pDevice2 = GUI_DEVICE_Create(DISPLAY_DRIVER, COLOR_CONVERSION, 0, -1);
  //
  // Configuration of second driver
  //
  //
  //  Driver configuration
  //
  Config.FirstSEG = 0;
  Config.FirstCOM = 0;
  GUIDRV_SPage_Config(pDevice2, &Config);
  //
  //  Configure hardware routines
  //
  PortAPI.pfWrite8_A0 = vWriteCommand;
  PortAPI.pfWrite8_A1 = vWriteData;
  PortAPI.pfWriteM8_A1 = vWriteDataM;
  PortAPI.pfRead8_A1 = u8ReadData;
  PortAPI.pfRead8_A0 = u8ReadStatus;
  GUIDRV_SPage_SetBus8(pDevice2, &PortAPI);
  //
  //  Controller configuration
  //
  GUIDRV_SPage_Set1510(pDevice2);
  
  
  //
  // Add display drivers to distribution driver
  //
  Rect0.x0 = 0;
  Rect0.y0 = 0;
  Rect0.x1 = 63;
  Rect0.y1 = 63;
  GUIDRV_Dist_AddDriver(pDevice, pDevice0, &Rect0);
  
  Rect1.x0 = 64;
  Rect1.y0 = 0;
  Rect1.x1 = 127;
  Rect1.y1 = 63;
  GUIDRV_Dist_AddDriver(pDevice, pDevice1, &Rect1);
  
  Rect2.x0 = 128;
  Rect2.y0 = 0;
  Rect2.x1 = 191;
  Rect2.y1 = 63;
  GUIDRV_Dist_AddDriver(pDevice, pDevice2, &Rect2);

  //
  // Set user palette data (only required if no fixed palette is used)
  //
  #if defined(PALETTE)
    LCD_SetLUTEx(0, PALETTE);
  #endif
}

Can anyone tell me how to fix this and how to write on the LCD like just one LCD not three similar LCDs ?

Thanks in advance 

Outcomes