lpcware

LPC1343 UART DTR, RST etc how to work

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by xsimon on Thu May 12 02:46:30 MST 2011
[SIZE=2]Dear Sir,

I'm facing a problem on LPC1343 UART function, I tested LPC1343 CDC com port sample code from NXP and using flashmagic to verify if possible can output TXD, RXD, DTR, RTS, but only TXD can be output by scope measurement, below is my modification need any one can help me.

void ser_OpenPort (void) {

  NVIC_DisableIRQ(UART_IRQn);

  LPC_IOCON->PIO1_6 &= ~0x07;    /*  UART I/O config */
  LPC_IOCON->PIO1_6 |= 0x01;     /* UART RXD */
  LPC_IOCON->PIO1_7 &= ~0x07;   
  LPC_IOCON->PIO1_7 |= 0x01;     /* UART TXD */
  /* Enable UART clock */
  LPC_SYSCON->SYSAHBCLKCTRL |= (1<<12);
  LPC_SYSCON->UARTCLKDIV = 0x1;     /* divided by 1 */
// Below is copy from void ModemInit( void )
  LPC_IOCON->PIO2_0 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO2_0 |= 0x01;     /* UART DTR */
  LPC_IOCON->PIO0_7 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO0_7 |= 0x01;     /* UART CTS */
  LPC_IOCON->PIO1_5 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO1_5 |= 0x01;     /* UART RTS */

  LPC_IOCON->PIO2_1 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO2_1 |= 0x01;     /* UART DSR */
  LPC_IOCON->PIO2_2 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO2_2 |= 0x01;     /* UART DCD */
  LPC_IOCON->PIO2_3 &= ~0x07;    /* UART I/O config */
  LPC_IOCON->PIO2_3 |= 0x01;     /* UART RI */

  LPC_UART->MCR = 0xC0;          /* Enable Auto RTS and Auto CTS. */   
  return;
}

Thanks!
Ethan
[/SIZE]

Outcomes