11 years, 1 month ago.

emWin and mbed

Is it possible to use emWin in mbed environment?

3 Answers

11 years, 1 month ago.

This one is also interesting : http://www.lpcware.com/content/forum/does-emwin-support-lpc17681769#comment-1959

Links to http://coineltech.com/index.php?main_page=product_info&cPath=8&products_id=14

The CodeBundle download contains EmWin (ported to LPC1768) used with their ILI9325 based 3.2" SPI TFT (http://coineltech.com/index.php?main_page=product_info&cPath=21&products_id=29)

Accepted Answer

Using codebundle by coineltech the problem is the same of MCB1700

posted by Davide Luongo 20 Mar 2013
11 years, 1 month ago.

Hi thank you very much for the answer I've downloaded the BSP for MCB1700 I can using this software on my Mini-DK but a need to reconfigure active SPI pins. This is the function of pins initialization. I'm not good to use KEIL uVision4 how change the pins?

SPI init

pins are:
   - CS     = P0.6 (GPIO pin)
   - SCK    = P0.7 (SCK1)
   - SDO    = P0.8 (MISO1)
   - SDI    = P0.9 (MOSI1)  

my pins are:
   - CS     = P0.18 (GPIO pin)
   - SCK    = P0.17 (SCK1)
   - SDO    = P0.19 (MISO1)
   - SDI    = P0.20 (MOSI1)  
/*******************************************************************************
* Initialize SPI (SSP) peripheral at 8 databit with a bitrate of 12.5Mbps      *
*   Parameter:                                                                 *
*   Return:                                                                    *
*******************************************************************************/
void LCD_X_SPI_Init(void)
{
  uint8_t Dummy;

  /* Enable clock for SSP1, clock = CCLK / 2 */
  LPC_SC->PCONP       |= 0x00000400;
  LPC_SC->PCLKSEL0    |= 0x00200000;	/* PCLK = CCLK / 2 = 50MHz */

  /* Configure the LCD Control pins */
  LPC_PINCON->PINSEL9 &= 0xF0FFFFFF;
  LPC_GPIO4->FIODIR   |= 0x30000000;
  LPC_GPIO4->FIOSET    = 0x20000000;

  /* SSEL1 is GPIO output set to high */
  LPC_GPIO0->FIODIR   |= 0x00000040;
  LPC_GPIO0->FIOSET    = 0x00000040;
  LPC_PINCON->PINSEL0 &= 0xFFF03FFF;
  LPC_PINCON->PINSEL0 |= 0x000A8000;

  /* Enable SPI in Master Mode, CPOL=1, CPHA=1 */
  /* 12.5 MBit used for Data Transfer @ 100MHz */
  LPC_SSP1->CR0        = 0x1C7;		/* SCR = 1 */
  LPC_SSP1->CPSR       = 0x02;		/* CPSDVSR  = 2. Bit frequency = PCLK / (CPSDVSR × [SCR+1]) = 50 / (2 × [1+1]) = 12.5Mbps */
  LPC_SSP1->CR1        = 0x02;

  while(LPC_SSP1->SR & (1<<2))
    Dummy = LPC_SSP1->DR;			/* Clear the Rx FIFO */

  LPC_GPIO4->FIOSET = 0x10000000;	/* Activate LCD backlight */
}

You should either post another question or start a forum discussion. Also, please use <<code>> tags.

posted by Igor Skochinsky 20 Mar 2013

solved

posted by Davide Luongo 20 Mar 2013

uVision 4 project for the Mini-DK is available at http://mbed.org/users/frankvnk/notebook/lpc1768-mini-dk---nxp-segger-emwin/

posted by Frank Vannieuwkerke 01 Apr 2013