Hello,
I have configured UART1 to send and transmit data but it is not working.
I have physically verified that it has no problems but still does not transmit or receive information.
anu suggestion?
void uart1_init(void) //9600 BAUD pclock 48MHZ
{
PCONP |= 0x00000010;
PINSEL0 |= 0x00050000; /* Enable RxD1 and TxD1*/
U1FCR = 0x07;
U1LCR=0X83; //8-data bits, 1 Stop bit, Disable Parity and Enable DLAB
U1DLL=0x38; // MULVAL = 0x5 and DIVADDVAL = 14
U1DLM=1;
U1LCR=0X03; //cleared DLAB
U1IER= 0x00000001;
}
void UART1_Interrupt_EN(void)
{
// VICIntSelect = 0x00000000;
VICVectAddr7 = (unsigned) UART1Handler; //Vector 7
VICVectCntl7 = 0x00000020 | 7; //select UART1 interrupt as IRQ i.e vector 7
VICIntEnable |=(1UL<<7);
}
void SendstreamUART1 (char *str){
while(*str)
{
U1THR = (char )*str++;
while( (U1LSR & 0x40) == 0 ); /* Wait till THRE bit becomes 1 which tells that transmission is completed */
}
}
void SendCharUART1 (char str){
U1THR = str;
while( (U1LSR & 0x40) == 0 ); /* Wait till THRE bit becomes 1 which tells that transmission is completed */
}