Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

UART1 for LPC2148

2006-02-24 by dodge1955

I'm having a problem with getting UART1 to work on my Embedded Artists
prototype board.  I have a serial display that has only 1 serial line.
 In other words, you can only transmit to the display.  I can't get
P0.8 (UART1 TX) to send any data.  Here is my setup at 9600.  And,
another question is 'Do I really need an interrupt just to transmit? 
It seems like throwing a char out to U1THR should suffice.  It's
probably something simple I'm missing.  Thanks.

Sutton - dodge55


VICIntSelect = 0;
VICVectAddr2 = (unsigned int) uart1_out;
VICVectCntl2 = 0x20 | 7;  // enables the UART1 interrupt, slot 7
U1FDR = 0x00000010;   // MULVAL = 1, DIVVAL = 0
U1DLM = 0;
U1DLL = 0x48;	 // 9600 baud
U1LCR = 0x03;     // 8 bits, 1 stop, no parity, DLAB = 0
U1FCR = 1;
VICIntEnable |= 0x00000080;

void display_write(char text[])
{
   unsigned char i;

   sprintf(display_output, "%s", text);
   for (i = 0; i < strlen(display_output); i++)
   {
      my_putchar(display_output[i]);
   }
}

void my_putchar(char c)
{
   U1THR = c;
}

void uart1_out(void) __irq
{
   VICVectAddr = 0;
}

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.