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.

Lm4F232 UART 7 receive interrupt

Hi

Using LM4F232 eval kit i was trying to configure UART7 channel to transmit and receive data at 9600 baudrate. i am able to transmit and receive data however interrupt is not generating on data reception. tried several other ways without any success. can yopu please help me to find missing step in my initialization code.

here is the code

#define IPC_UART_PORT_BASE                          GPIO_PORTK_BASE

#define IPC_UART_BASE                               UART7_BASE

#define IPC_UART_RX_PIN                             GPIO_PIN_4

#define IPC_UART_TX_PIN                             GPIO_PIN_5

#define IPC_UART_INTERRUPT                          INT_UART7

#define IPC_UART_TX_INTERRUPT                       UART_INT_TX

#define IPC_UART_RX_INTERRUPT                       UART_INT_RX

#define IPC_UART_BAUDRATE                           9600

 

 

 

void InitializeIpcUartChannel(void)

{

   // Enable the UART peripherals

   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);

   MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOK);

 

 

   //Give some delay to allow the peripheral to start up

   MAP_SysCtlDelay(2);

 

   GPIOPinConfigure(GPIO_PK4_U7RX);

   GPIOPinConfigure(GPIO_PK5_U7TX);

 

   //Setup Port A0 and A1 as UARTs

   MAP_GPIOPinTypeUART(IPC_UART_PORT_BASE, (IPC_UART_RX_PIN | IPC_UART_TX_PIN));

 

   //Setup UART params

   MAP_UARTConfigSetExpClk(IPC_UART_BASE, SystemClockFreq, IPC_UART_BAUDRATE,

                           (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

 

   // Disable UART FIFO to use 1 byte FIFO

   MAP_UARTFIFODisable(IPC_UART_BASE);

 

   MAP_UARTRxErrorClear(IPC_UART_BASE);

 

   MAP_IntMasterEnable();

 

   //Enable UART interrupts

   MAP_IntEnable(IPC_UART_INTERRUPT);

 

   //HWREG(UART0_BASE + UART_O_ICR) = 0x0F;

   // MAP_UARTTxIntModeSet(IPC_UART_BASE, UART_TXINT_MODE_EOT);

    // Enable interrupts for Rx and Tx

   MAP_UARTIntEnable(IPC_UART_BASE, IPC_UART_RX_INTERRUPT);

}

  • A couple of issues...

    Where is your interrupt routine?

    Second how about showing your Startup.xx.yy file -- the exact name depends on tool set and compiler. Do you have your interrupt routine declared there? (An extern reference to the routine in your main file...

    Second does the correct interrupt slot have a reference to the routine declared as extern and present in your main program.

    I saw a setup routine -- but nothing else.

  • Thanks. I was including header file in startup.c in which I had declared my ISR function prototype as extern.

    It started working after I moved extern declaration to startup.c . Still I wonder why it was not working by including header file.

    I am using RedSuite (ver 4) and RedProbe+ .

    Thanks again :)