This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

In TMS320C6748 UART_Loop Back Interrupt not coming to ISR

Other Parts Discussed in Thread: OMAPL138

Hai,

Actually polling method i have done know i am trying to interrupt method it is not going to ISR routine?

Main Code:-

int main(void)
{
uint8_t data=0;
volatile uint16_t i=0,j=0,k;
EVMC6748_init();
// Initialization of Modules
PINMUX_init();
// EMIFA_init(); //Chip Select

gpio_regs_t *GP10 = (gpio_regs_t*)BANK_base_addr01;
gpio_regs_t *GP32 = (gpio_regs_t*)BANK_base_addr23;
gpio_regs_t *GP76 = (gpio_regs_t*)BANK_base_addr67;
gpio_regs_t *GP08 = (gpio_regs_t*)BANK_base_addr80;

//UART_init(DEBUG_PORT,115200);

CLRBIT(GP10->DIR ,GPIO_OUTPUT3); // configuring EX1 pin as output
CLRBIT(GP10->DIR ,GPIO_OUTPUT4); // configuring EX2 pin as output
CLRBIT(GP32->DIR ,GPIO_OUTPUT5); // configuring EX3 pin as output
CLRBIT(GP08->DIR ,GPIO_OUTPUT6); // configuring EX4 pin as output
CLRBIT(GP10->DIR ,GPIO_OUTPUT7); // configuring EX5 pin as output
CLRBIT(GP76->DIR ,GPIO_OUTPUT8); // configuring EX6 pin as output
SETBIT(GP32->DIR ,GPIO_INPUT1); // configuring EX7 pin as input
SETBIT(GP08->DIR ,GPIO_INPUT2); // configuring EX8 pin as input
CLRBIT(GP08->DIR ,GPIO_OUTPUT9); // configuring LED pin as output
CLRBIT(GP76->DIR ,GPIO_OUTPUT3); // configuring NANDC pin as output
SETBIT(GP76->SET_DATA ,GPIO_OUTPUT3);
/*--------------------------------------------------------------------------------------------------*/
flag=1;
ISTP = (unsigned int)intcVectorTable;
uint16_t *src = (uint16_t*) UART1_REG_BASE;
uint16_t *src3 = (uint16_t*)0x01800104;
*src = 0x9;
*src3 = 0x0000004; //selecting interrupt 4 in intmux reg

SETBIT(CSR ,0x14000010); //Disable Global Interrupt
UART_init(DEBUG_PORT,115200);
SETBIT(IER,0x00000013) ; // enable INT4 as CPU interrupt

while(1)
{
if(flag==1)
{
SETBIT(CSR ,0x00000003); //Global Interrupt enable
flag=0;
}
}
}

interrupt void uart1_isr(void)
{
uint8_t data=0;
SETBIT(CSR ,0x14000010); //Disable Global Interrupt
UART_txString(DEBUG_PORT,"\n\rEnter the character\n\r");
UART_rxByte(DEBUG_PORT, &data);
flag=1;
}

UART_init code:-

uint32_t UART_init(uart_regs_t *uart, uint32_t baud_rate)
{
uint32_t divisor;

// put xmtr/rcvr in reset.
uart->PWREMU_MGMT = 0;

// set baud rate...assumes default 16x oversampling.
divisor = SYSCLOCK2_HZ / (baud_rate * 16);
uart->DLH = (divisor & 0x0000FF00) >> 8;
uart->DLL = divisor & 0x000000FF;

// enable xmtr/rcvr fifos.
uart->FCR = 0;
SETBIT(uart->FCR, FIFOEN);
SETBIT(uart->FCR, RXCLR | TXCLR | DMAMODE1);

// disable interrupts, flow control, and loop back.
// uart->IER = 0;
SETBIT(uart->IER, 0x00000005); // Enable UART1 Interrupts (Receive & Transmit)
uart->MCR = 0;
uart->MDR = 0;

// config LCR for no parity, one stop bit, 8 data bits, no flow control.
uart->LCR = 0;
SETBIT(uart->LCR, WLS_8);

// take xmtr/rcvr out of reset.
SETBIT(uart->PWREMU_MGMT, UTRST | URRST | FREE);

return(ERR_NO_ERROR);

}

  • Could you please specify the hardware that you are using and the software you are using ??

    You have tagged your post with Starterware. Can you confirm that you have looked at the UART example in the starterware package that enables the UART interrupts. Please look for this example under StarterWare_1_xx_xx_xx\examples\lcdkOMAPL138\uart. The function UARTisr enables the UART interrupts.

    Regards,
    Rahul
  • Where is intcVectorTable defined and does intcVectorTable contain the address of uart1_isr()?
  • Hi Rama chandra,

    if you look at the OMAPL138 starterware, in the file,  intvecs.asm, the actual Interrupt vector table can be found. And the mapping of the uart interrupt can be seen in one of the example file such as uartEcho.c , in ConfigureIntUART() function. You can take any of theuart example as reference

    intvecs.asm

    ;**********************************************************

    ; Interrupt Vector Table

    ;**********************************************************

    .align 1024

    _intcVectorTable:

    VEC_ENTRY _c_int00

    VEC_ENTRY _c674x_nmi_isr

    VEC_ENTRY _c674x_rsvd_int2_isr

    VEC_ENTRY _c674x_rsvd_int3_isr

    VEC_ENTRY _c674x_mask_int4_isr

    VEC_ENTRY _c674x_mask_int5_isr

    VEC_ENTRY _c674x_mask_int6_isr

    VEC_ENTRY _c674x_mask_int7_isr

    VEC_ENTRY _c674x_mask_int8_isr

    VEC_ENTRY _c674x_mask_int9_isr

    VEC_ENTRY _c674x_mask_int10_isr

    VEC_ENTRY _c674x_mask_int11_isr

    VEC_ENTRY _c674x_mask_int12_isr

    VEC_ENTRY _c674x_mask_int13_isr

    VEC_ENTRY _c674x_mask_int14_isr

    VEC_ENTRY _c674x_mask_int15_isr

    ==========================================

    uartEcho.c

    static void ConfigureIntUART(void)

    {

    #ifdef _TMS320C6X

    IntRegister(C674X_MASK_INT4, UARTIsr);

    IntEventMap(C674X_MASK_INT4, SYS_INT_UART2_INT);

    IntEnable(C674X_MASK_INT4);

    #else

       /* Registers the UARTIsr in the Interrupt Vector Table of AINTC. */

       IntRegister(SYS_INT_UARTINT2, UARTIsr);

       /* Map the channel number 2 of AINTC to UART2 system interrupt. */

       IntChannelSet(SYS_INT_UARTINT2, 2);

       IntSystemEnable(SYS_INT_UARTINT2);

    #endif

    }