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
}