This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lp2378 use all four uarts - extending nxp uart code

Using a keil mcb2300 with lpc2378.

Used the NXP example bundle uart code as the base and attempting to modify it to use all four uarts via interrupts. Couldn't find any examples that use all four uarts on lpc2300.

zip of base project www.alexthegeek.com/.../testUsarti.zip
code www.alexthegeek.com/.../

The uart init routines run and print out their message on uart0.
uart0 and uart1 work and echo back characters when initalised in order 0,1,2,3
but not uart2 and 3.

Most likely I'm doing something dumb or missing something simple.
Any hints or pointers appreciated.

Not sure on the pinsel settings as its been a while since I've used lpc2000's (mostly xilinx , avr and st32f lately)

Thank you

Alex

pinsel

/* PinSelect and Pinmode settings */
  /* UART0 = COM1 DB9 P4 on mcb2300 */
  /* UART1 = COM1 DB9 P3 on mcb2300 */
  /* UART2 = COM 2 is on IDC (TXD2=P2.8 (93), RXD2=P2.9 (92), GND=GND (103)   */
  /* UART3 = COM3 is on IDC (TXD3 = P0.0 (66), RXD3 = P0.1 (67), GND=GND (42) */


  PINSEL0 = 0x4000005A;      /* binary: 01000000_00000000_00000000_01011010 */
  PINMODE0 = 0x800000AA;     /* binary: 10000000_00000000_00000000_10101010 */
  //   IO0DIR = 0x00000000;       /* binary: 00000000_00000000_00000000_00000000 */

  PINSEL1 = 0x00000001;      /* binary: 00000000_00000000_00000000_00000001 */
  PINMODE1 = 0x0000000A;     /* binary: 00000000_00000000_00000000_00001010 */

  PINSEL2 = 0x00000000;      /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE2 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  //    IO1DIR = 0x00000000;       /* binary: 00000000_00000000_00000000_00000000 */

  PINSEL3 = 0x00000000;      /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE3 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */

  PINSEL4 = 0x000A0000;      /* binary: 00000000_00001010_00000000_00000000 */
  PINMODE4 = 0x000A0000;     /* binary: 00000000_00001010_00000000_00000000 */

  //  PINSEL4 = 0x000A000A;     // binary: 00000000_00001010_00000000_00001010

  FIO2DIR = 0x00000000;      /* binary: 00000000_00000000_00000000_00000000 */
  PINSEL6 = 0x00000000;      /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE6 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */

  FIO3DIR = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  PINSEL7 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE7 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */

  PINSEL8 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE8 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */

  FIO4DIR = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  PINSEL9 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */
  PINMODE9 = 0x00000000;     /* binary: 00000000_00000000_00000000_00000000 */

0