Yahoo Groups archive

Lpc2000

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

Thread

Uart Interrup routines

Uart Interrup routines

2004-05-27 by Owen Mooney

Hi,

I am struggling with serial interrupt routines at the moment can anyone 
help?

I started with simple polled UART andf that works fine - I modified code 
to look like that below. If I set U0IER to 1 the whole UART seems to go 
to a bag of worms. It wont send data any more!

Any ideas anyone

void UART0Initialize(unsigned int baud) {
  unsigned int divisor = PERIPHERAL_CLOCK_FREQUENCY / (16 * baud);
  // setup interrupt vectors

  VICIntSelect &= ~0x40; 
  VICIntEnable = 0x40;
  VICVectCntl0 = 0x26;
  VICVectAddr0 = (unsigned int)UART0ISR;

  PINSEL0 = PINSEL0 | 0x5;
  //U0FCR = 1;
  U0FCR = 7;           // enable and reset buffers
  U0LCR = 0x83;        // 8 bit, 1 stop bit, no parity, enable DLAB */
  U0DLL = divisor & 0xFF;
  U0DLM = (divisor >> 8) & 0xFF;
//  U0IER = 1;           // Interrupt on rx data available
  U0LCR &= ~0x80;      // Disable DLAB
}

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.