I'm writing an UART handler for the OMAP-L137 from the DSP side. And the code i wrote is as fallows
/* uart.c */
#include "uart.h"
#define DEV_BOARD
//#define CUSTOM_BOARD
void Uart_init()
{
#ifdef DEV_BOARD
UART1.DLL |= 0x64; //setting Baud Rate 115200
UART1.DLH |= 0x00;
UART1.FCR |= 0x0F; //FIFO enabling & receiver FIFO tigger level
UART1.LCR |= 0x03; //word length 8-bit
UART1.IER |= 0x07; //Enabling receiver interrupts
// UART1.IIR |= 0x00; // disabling FIFO Mode
UART1.MCR |= 0x00; //No auto control
UART1.MDR |= 0x1; //13x over sampling
UART1.PWREMU_MGMT |= 0x4001;
#endif
#ifdef CUSTOM_BOARD
UART1.DLL |= 0x2A; //setting Baud Rate 115200
UART1.DLH |= 0x00;
// UART1.DLH |= 0x09; //setting Baud Rate 9600
// UART1.DLL |= 0x64;
UART1.LCR |= 0x03; //word length 8-bit
UART1.IIR |= 0x00; // disabling FIFO Mode
UART1.MCR |= 0x00; //No auto control
UART1.MDR |= 0x1; //13x over sampling
//UART1.PWREMU_MGMT |= 0x4001;
UART1.PWREMU_MGMT |= 0x2001;
#endif
void send_data(char data)
{
while(UART1.IIR == 0x02)
{
if(UART1.LSR !=0x06)
UART1.RBR = data;
}
}
The project was build with no errors. but i am not getting anything in hyper terminal, so plz anyone tell me what i am doing wrong.