<hi every one. i got struck here in uart0 interrupt configuration. My code is to send AT command to GSM and received response should make uart0 interrupt, and that response ll be displying on hyper terminal connected to UART1. I'm not getting any response on hyper terminal. Please suggest me if anyone knows about it...please.>
int main() {
Uart0_InitializatioN(); uart1_Ini(); Uart0_string_tx("AT"); Uart0_tx(0x0d); delay1(5999);
}
void delay1(unsigned int s) { unsigned int i; for(i=0;i<s;i++) ;
void Uart0_InitializatioN(void) { //PINSEL0 = (PINSEL0 & ~(3 << 0)) | (1 << 0); //PINSEL0 = (PINSEL0 & ~(3 << 2)) | (1 << 2); PINSEL0 = 0x00000005; /* P0.0 AND P0.1 AS TXD AND RXD OF U0 */ U0LCR = 0x83; U0DLL = 96; //0x62; U0DLM = 0; //0x00; // U0FDR = 0x00000010; U0LCR = 0x03;
//=========== vic initializ =============================================================//
VICIntSelect = 0x00000000; // IRQ Selected VICIntEnable = 0x00000040; // UART0 interrupt enabled VICVectAddr0 = (unsigned long)uart0_ISR; VICVectCntl0 = 0x00000029; U0IER = 0x00000001; /* Enable uart0 rx interrupt */ }
void uart1_Ini() { // PINSEL0 = (PINSEL0 & (1 << 16) | (1 << 18));
PINSEL0 |= 0x00050000; /* P0.8 AND P0.9 AS TXD AND RXD OF U1 */ U1LCR = 0x83; // DLAB =1, AND 8 BIT CHAR IS SELECTED U1DLL = 96; U1DLM = 0; U1FDR = 0x00000010; // DIVADDVAL=0, MULVAL=1 for 9600 BR U1LCR = 0x03; }
void uart0_ISR(void)__irq {
unsigned char val;
U0IER = 0x00000000; while(!(U0LSR & 0x01)); val = U0RBR;
/* send rvd data to hyper terminal */ while(!(U1LSR & 0x40)); U1THR = val; U0IER = 0x00000001; // VICVectAddr0 = 0x00;
void Uart0_tx(unsigned char tx_data) {
while(!(U0LSR & 0x40)); U0THR = tx_data;
void Uart0_string_tx(unsigned char *tx_buffer) { while(*tx_buffer) { Uart0_tx(*tx_buffer++); delay1(100); } }