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.

TM4C1294XL Uart3/Uart4 Not Working

Other Parts Discussed in Thread: TM4C1294NCPDT, EK-TM4C1294XL

Hello,

In TM4C1294XL Board, Uart0 is working fine through the debug interface. But, if I try the same codes through UART3 or UART4, Transmission is fine but the Receive Interrupt Is not generated. Please help!!!

My Code is Shown Below:

#define PART_TM4C1294NCPDT
#define BaudRate 9600
#define GPSDataBufferSize 128


#include <stdint.h>
#include <stdbool.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"

uint32_t g_ui32SysClock;

uint8_t  receive_data[GPSDataBufferSize];
uint8_t data_pointer=0;

void UARTIntHandler(void)
{
    uint32_t ui32Status;
    uint8_t temp;

    // Get the interrrupt status.
    ui32Status = ROM_UARTIntStatus(UART3_BASE, true);

    // Clear the asserted interrupts.
    ROM_UARTIntClear(UART3_BASE, ui32Status);

    // Loop while there are characters in the receive FIFO.
    while (ROM_UARTCharsAvail(UART3_BASE))
    {
    	temp=ROM_UARTCharGet(UART3_BASE);
        receive_data[ data_pointer]=temp;
        data_pointer++;
    }
    //End of UART Handler -------------------------
}

void Uart3_send(char *send_string)
{
    uint8_t temp;

    for(temp=0;send_string[temp] !=0;temp++)
    {
        UARTCharPut(UART3_BASE,send_string[temp]);
    }
}

int main(void)
{
     // Set the clocking to run directly from the crystal at 120MHz.
     g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                              SYSCTL_OSC_MAIN |
                                              SYSCTL_USE_PLL |
                                              SYSCTL_CFG_VCO_480), 120000000);

    // Enable the peripherals used by this example.
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
    // Configure the UART for baudrate, 8-N-1 operation.
    UARTConfigSetExpClk(UART3_BASE, g_ui32SysClock, BaudRate,
	               (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
	                UART_CONFIG_PAR_NONE));
    UARTEnable(UART3_BASE);
    // Enable the UART interrupt.
    IntEnable(INT_UART3);
    UARTFIFOLevelSet(UART3_BASE, UART_FIFO_TX7_8, UART_FIFO_RX1_8);
    UARTFIFOEnable(UART3_BASE);
    UARTIntEnable(UART3_BASE,UART_INT_RX);
    IntPrioritySet(INT_UART3,0X80);
    

    Uart3_send("Test String....\r\n");
    // Loop forever
    for( ; ; )
    {
        Sleep();
    }
}

void Sleep(void)
{
   SysCtlSleep();
}

My startup_ccs.c file is also attached herewith:

#include <stdint.h>
#include "inc/hw_nvic.h"
#include "inc/hw_types.h"

//*****************************************************************************
//
// Forward declaration of the default fault handlers.
//
//*****************************************************************************
void ResetISR(void);
static void NmiSR(void);
static void FaultISR(void);
static void IntDefaultHandler(void);

//*****************************************************************************
//
// External declaration for the reset handler that is to be called when the
// processor is started
//
//*****************************************************************************
extern void _c_int00(void);

//*****************************************************************************
//
// Linker variable that marks the top of the stack.
//
//*****************************************************************************
extern uint32_t __STACK_TOP;

//
// External declaration for the interrupt handler used by the application.
//
//*****************************************************************************
extern void WatchdogIntHandler(void);
//Add other interrupts here...
extern void UARTIntHandler(void);

//*****************************************************************************
//
// The vector table.  Note that the proper constructs must be placed on this to
// ensure that it ends up at physical address 0x0000.0000 or at the start of
// the program if located at a start address other than 0.
//
//*****************************************************************************
#pragma DATA_SECTION(g_pfnVectors, ".intvecs")
void (* const g_pfnVectors[])(void) =
{
    (void (*)(void))((uint32_t)&__STACK_TOP),
                                            // The initial stack pointer
    ResetISR,                               // The reset handler
    NmiSR,                                  // The NMI handler
    FaultISR,                               // The hard fault handler
    IntDefaultHandler,                      // The MPU fault handler
    IntDefaultHandler,                      // The bus fault handler
    IntDefaultHandler,                      // The usage fault handler
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // SVCall handler
    IntDefaultHandler,                      // Debug monitor handler
    0,                                      // Reserved
    IntDefaultHandler,                      // The PendSV handler
    IntDefaultHandler,                      // The SysTick handler
    IntDefaultHandler,                      // GPIO Port A
    IntDefaultHandler,                      // GPIO Port B
    IntDefaultHandler,                      // GPIO Port C
    IntDefaultHandler,                      // GPIO Port D
    IntDefaultHandler,                      // GPIO Port E
    IntDefaultHandler,                      // UART0 Rx and Tx
    IntDefaultHandler,                      // UART1 Rx and Tx
    IntDefaultHandler,                      // SSI0 Rx and Tx
    IntDefaultHandler,                      // I2C0 Master and Slave
    IntDefaultHandler,                      // PWM Fault
    IntDefaultHandler,                      // PWM Generator 0
    IntDefaultHandler,                      // PWM Generator 1
    IntDefaultHandler,                      // PWM Generator 2
    IntDefaultHandler,                      // Quadrature Encoder 0
    IntDefaultHandler,                      // ADC Sequence 0
    IntDefaultHandler,                      // ADC Sequence 1
    IntDefaultHandler,                      // ADC Sequence 2
    IntDefaultHandler,                      // ADC Sequence 3
    WatchdogIntHandler,                      // Watchdog timer
    IntDefaultHandler,                      // Timer 0 subtimer A
    IntDefaultHandler,                      // Timer 0 subtimer B
    IntDefaultHandler,                      // Timer 1 subtimer A
    IntDefaultHandler,                      // Timer 1 subtimer B
    IntDefaultHandler,                      // Timer 2 subtimer A
    IntDefaultHandler,                      // Timer 2 subtimer B
    IntDefaultHandler,                      // Analog Comparator 0
    IntDefaultHandler,                      // Analog Comparator 1
    IntDefaultHandler,                      // Analog Comparator 2
    IntDefaultHandler,                      // System Control (PLL, OSC, BO)
    IntDefaultHandler,                      // FLASH Control
    IntDefaultHandler,                      // GPIO Port F
    IntDefaultHandler,                      // GPIO Port G
    IntDefaultHandler,                      // GPIO Port H
    IntDefaultHandler,                      // UART2 Rx and Tx
    IntDefaultHandler,                      // SSI1 Rx and Tx
    IntDefaultHandler,                      // Timer 3 subtimer A
    IntDefaultHandler,                      // Timer 3 subtimer B
    IntDefaultHandler,                      // I2C1 Master and Slave
    IntDefaultHandler,                      // Quadrature Encoder 1
    IntDefaultHandler,                      // CAN0
    IntDefaultHandler,                      // CAN1
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // Hibernate
    IntDefaultHandler,                      // USB0
    IntDefaultHandler,                      // PWM Generator 3
    IntDefaultHandler,                      // uDMA Software Transfer
    IntDefaultHandler,                      // uDMA Error
    IntDefaultHandler,                      // ADC1 Sequence 0
    IntDefaultHandler,                      // ADC1 Sequence 1
    IntDefaultHandler,                      // ADC1 Sequence 2
    IntDefaultHandler,                      // ADC1 Sequence 3
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // GPIO Port J
    IntDefaultHandler,                      // GPIO Port K
    IntDefaultHandler,                      // GPIO Port L
    IntDefaultHandler,                      // SSI2 Rx and Tx
    IntDefaultHandler,                      // SSI3 Rx and Tx
    UARTIntHandler,                         // UART3 Rx and Tx
    IntDefaultHandler,                      // UART4 Rx and Tx
    IntDefaultHandler,                      // UART5 Rx and Tx
    IntDefaultHandler,                      // UART6 Rx and Tx
    IntDefaultHandler,                      // UART7 Rx and Tx
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // I2C2 Master and Slave
    IntDefaultHandler,                      // I2C3 Master and Slave
    IntDefaultHandler,                      // Timer 4 subtimer A
    IntDefaultHandler,                      // Timer 4 subtimer B
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    0,                                      // Reserved
    IntDefaultHandler,                      // Timer 5 subtimer A
    IntDefaultHandler,                      // Timer 5 subtimer B
    IntDefaultHandler,                      // Wide Timer 0 subtimer A
    IntDefaultHandler,                      // Wide Timer 0 subtimer B
    IntDefaultHandler,                      // Wide Timer 1 subtimer A
    IntDefaultHandler,                      // Wide Timer 1 subtimer B
    IntDefaultHandler,                      // Wide Timer 2 subtimer A
    IntDefaultHandler,                      // Wide Timer 2 subtimer B
    IntDefaultHandler,                      // Wide Timer 3 subtimer A
    IntDefaultHandler,                      // Wide Timer 3 subtimer B
    IntDefaultHandler,                      // Wide Timer 4 subtimer A
    IntDefaultHandler,                      // Wide Timer 4 subtimer B
    IntDefaultHandler,                      // Wide Timer 5 subtimer A
    IntDefaultHandler,                      // Wide Timer 5 subtimer B
    IntDefaultHandler,                      // FPU
    IntDefaultHandler,                      // PECI 0
    IntDefaultHandler,                      // LPC 0
    IntDefaultHandler,                      // I2C4 Master and Slave
    IntDefaultHandler,                      // I2C5 Master and Slave
    IntDefaultHandler,                      // GPIO Port M
    IntDefaultHandler,                      // GPIO Port N
    IntDefaultHandler,                      // Quadrature Encoder 2
    IntDefaultHandler,                      // Fan 0
    0,                                      // Reserved
    IntDefaultHandler,                      // GPIO Port P (Summary or P0)
    IntDefaultHandler,                      // GPIO Port P1
    IntDefaultHandler,                      // GPIO Port P2
    IntDefaultHandler,                      // GPIO Port P3
    IntDefaultHandler,                      // GPIO Port P4
    IntDefaultHandler,                      // GPIO Port P5
    IntDefaultHandler,                      // GPIO Port P6
    IntDefaultHandler,                      // GPIO Port P7
    IntDefaultHandler,                      // GPIO Port Q (Summary or Q0)
    IntDefaultHandler,                      // GPIO Port Q1
    IntDefaultHandler,                      // GPIO Port Q2
    IntDefaultHandler,                      // GPIO Port Q3
    IntDefaultHandler,                      // GPIO Port Q4
    IntDefaultHandler,                      // GPIO Port Q5
    IntDefaultHandler,                      // GPIO Port Q6
    IntDefaultHandler,                      // GPIO Port Q7
    IntDefaultHandler,                      // GPIO Port R
    IntDefaultHandler,                      // GPIO Port S
    IntDefaultHandler,                      // PWM 1 Generator 0
    IntDefaultHandler,                      // PWM 1 Generator 1
    IntDefaultHandler,                      // PWM 1 Generator 2
    IntDefaultHandler,                      // PWM 1 Generator 3
    IntDefaultHandler                       // PWM 1 Fault
};

//*****************************************************************************
//
// This is the code that gets called when the processor first starts execution
// following a reset event.  Only the absolutely necessary set is performed,
// after which the application supplied entry() routine is called.  Any fancy
// actions (such as making decisions based on the reset cause register, and
// resetting the bits in that register) are left solely in the hands of the
// application.
//
//*****************************************************************************
void
ResetISR(void)
{
    //
    // Jump to the CCS C initialization routine.  This will enable the
    // floating-point unit as well, so that does not need to be done here.
    //
    __asm("    .global _c_int00\n"
          "    b.w     _c_int00");
}

//*****************************************************************************
//
// This is the code that gets called when the processor receives a NMI.  This
// simply enters an infinite loop, preserving the system state for examination
// by a debugger.
//
//*****************************************************************************
static void
NmiSR(void)
{
    //
    // Enter an infinite loop.
    //
    while(1)
    {
    }
}

//*****************************************************************************
//
// This is the code that gets called when the processor receives a fault
// interrupt.  This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//
//*****************************************************************************
static void
FaultISR(void)
{
    //
    // Enter an infinite loop.
    //
    while(1)
    {
    }
}

//*****************************************************************************
//
// This is the code that gets called when the processor receives an unexpected
// interrupt.  This simply enters an infinite loop, preserving the system state
// for examination by a debugger.
//
//*****************************************************************************
static void
IntDefaultHandler(void)
{
    //
    // Go into an infinite loop.
    //
    while(1)
    {
    }
}

Thanks in Advance.

Regards,

Girish.

  • Hello Girish

    Where have you configured the GPIO for UART TX and RX for the respective UARTs?

    Regards
    Amit
  • Hello Amit,

    Sorry for the late response. I have used pin mux tool to configure the uart pins. Attached herewith is the piout.c file for your reference.

    #include <stdbool.h>
    #include <stdint.h>
    #include "UserDefines.h"
    #include "inc/hw_gpio.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_types.h"
    #include "driverlib/gpio.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/sysctl.h"
    #include "pinout.h"
    
    //*****************************************************************************
    //
    //! \addtogroup pinout_api
    //! @{
    //
    //*****************************************************************************
    
    //*****************************************************************************
    //
    //! Configures the device pins for the customer specific usage.
    //!
    //! \return None.
    //
    //*****************************************************************************
    void
    PinoutSet(void)
    {
        //
        // Enable Peripheral Clocks 
        //
    	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
    
        //
        // Configure the GPIO Pin Mux for PN0
    	// for GPIO_PN0
        //
    	MAP_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
    
        //
        // Configure the GPIO Pin Mux for PA4
    	// for U3RX
        //
    	MAP_GPIOPinConfigure(GPIO_PA4_U3RX);
    	MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_4);
    
        //
        // Configure the GPIO Pin Mux for PA5
    	// for U3TX
        //
    	MAP_GPIOPinConfigure(GPIO_PA5_U3TX);
    	MAP_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_5);
    
    }
    

    Regards,

    Girish.

  • Hello Girish

    So now include the function in the main function before UART configuration. Do make sure that the RX pin is high (i.e. it is connected to some device on the other side)

    Regards
    Amit
  • Here is my main code:

    #define PART_TM4C1294NCPDT
    #define BaudRate 9600
    #define GPSDataBufferSize 128
    #include <stdint.h>
    #include <stdbool.h>
    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "driverlib/debug.h"
    #include "driverlib/gpio.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/uart.h"
    #include "pinout.h"
    uint32_t g_ui32SysClock;
    uint8_t  receive_data[GPSDataBufferSize];
    uint8_t data_pointer=0;
    void UARTIntHandler(void)
    {
        uint32_t ui32Status;
        uint8_t temp;
        // Get the interrrupt status.
        ui32Status = ROM_UARTIntStatus(UART3_BASE, true);
        // Clear the asserted interrupts.
        ROM_UARTIntClear(UART3_BASE, ui32Status);
        // Loop while there are characters in the receive FIFO.
        while (ROM_UARTCharsAvail(UART3_BASE))
        {
            temp=ROM_UARTCharGet(UART3_BASE);
            receive_data[ data_pointer]=temp;
            data_pointer++;
        }
        //End of UART Handler -------------------------
    }
    void Uart3_send(char *send_string)
    {
        uint8_t temp;
        for(temp=0;send_string[temp] !=0;temp++)
        {
            UARTCharPut(UART3_BASE,send_string[temp]);
        }
    }
    int main(void)
    {
         // Set the clocking to run directly from the crystal at 120MHz.
         g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                                  SYSCTL_OSC_MAIN |
                                                  SYSCTL_USE_PLL |
                                                  SYSCTL_CFG_VCO_480), 120000000);
    PinoutSet();
        // Enable the peripherals used by this example.
        SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
        // Configure the UART for baudrate, 8-N-1 operation.
        UARTConfigSetExpClk(UART3_BASE, g_ui32SysClock, BaudRate,
                       (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                        UART_CONFIG_PAR_NONE));
        UARTEnable(UART3_BASE);
        // Enable the UART interrupt.
        IntEnable(INT_UART3);
        UARTFIFOLevelSet(UART3_BASE, UART_FIFO_TX7_8, UART_FIFO_RX1_8);
        UARTFIFOEnable(UART3_BASE);
        UARTIntEnable(UART3_BASE,UART_INT_RX);
        IntPrioritySet(INT_UART3,0X80);
        
        Uart3_send("Test String....\r\n");
        // Loop forever
        for( ; ; )
        {
            Sleep();
        }
    }
    void Sleep(void)
    {
       SysCtlSleep();
    }
  • Dear Amit,
    I have sent my new file and I have a CO2102 based USB Uart Converter connected at the other ends at X6.18 and X6.20 of Booster pack-2 interface. X6.4 is grounded . X6.18 is connected to TX and X6.20 to RX of USB Uart Interface.

    Girish.
  • Hello Girish

    And what is happening on the RX and TX line. Did you connect a scope/LA to check?

    Regards
    Amit
  • Hello Amit,
    As I said in the first mail itself, The Tx output is captured on the terminal window without any problem The data sent from the terminal window is coming till the output of USB/Uart converter but the Receive interrupt is not getting triggered.
    Regards,
    Girish.
  • Hello Girish,

    1. You do not need IntPrioritySet
    2. How many bytes are being sent to the UART module
    3. Have you made sure that the register window/memory window in the IDE is closed, else the debugger may read the bytes.
    4. Have you enabled the Receive TimeOut Interrupt if number of bytes being sent is less than 3

    Regards
    Amit
  • Dear Amit,
    Firstly I have set the Int Priority because, you may recall that yesterday, we discussed about software interrupt. That software interrupt needs to have a higher priority over serial interrupt. I mean the software interrupt handler has to execute with a greater priority to Uart. To accomplish this task, I have used int priority.
    The Uart Transmit string is generally minimum 15-20 bytes long.
    Yes, the regiter window and memory windows are closed in IDe at the time of testing.
    In the present application, This case does not occur.

    Regards,
    Girish.
  • Hello Girish,

    Yesterday we discussed about IntRegister. And a software interrupt on UART3 interrupt is no different from a hardware interrupt from UART3.

    Did you connect a scope probe to make sure that the UART RX pins are toggling with the correct baud rate?

    Regards
    Amit
  • Hello Amit,
    Yes ofcourse I did and also, I also shorted TX and Rx pins of the Uart/USB converter to ensure that the echo is received properly in the terminal screen.

    Girish.
  • Hello Girish,

    Please check with a scope and attach a snapshot of the RX pin on the device.

    Also it would be a good time to debug. Open the UART register space and see the status of the UART FIFO and check with the data sheet

    Regards
    Amit
  • Dear Amit,
    Could you please explain in greater detail...
    Girish.
  • Hello Girish

    Connect a scope probe on the RX line from the USB/UART converter to the TM4C129x RX pin. Send 3 bytes from the PC and check if they are being presented on the scope probe. Check the baud rate of the UART bytes being sent.

    If that is OK, then in the register window check the UART status registers to see what the UART RXFIFO status is showing. Read the data sheet especially register section to understand what is happening when certain bits are set or clear in the registers.

    Regards
    Amit
  • Dear Amit,
    I will check and come back...
    Girish.
  • Dear Amit,
    I tried scanning the whole 1890 pages of TM4CNCPDT datasheet several times to get the location of Uart3 fifo registers and the memory map, does not give any details about the address of this location. also I tried to extract some infrmation from uart.c and uart.h files in the driverlib. both I could not get the address of Uart3 Receiver Fifos, to do a data value check at these locations.

    Regards,
    Girish.
  • Hi,
    See in chapter "Universal Asynchronous Receivers/Transmitters" paragraph 16.5 Register
    Map for all UARTs base addresses and then at 16.6, each register page name, all
    registers are shown their particular addresses.

  • Hello,
    I went through those registers, There are no fifo registers in that list.

    Girish.
  • Hi,

    You will not find it - they are hidden, no explicit address, except the top, which is usually the receive or transmit register. If you use FIFO, then always read the same receive or write the same transmit register. Use blocking/non-blocking functions to manage them.

  • Hello Girish,

    Please look at the UARTFR register. That contains the status flag for the FIFO

    Regards
    Amit Ashara
  • Dear Amit,
    I checked and the Uart FR Buffer is getting Filled. Register value changing from 0X197 to 0X187 indicating 4 th bit change from 1to 0- indicating RX data is available and bit RXFF changing to zero indicating full. But as I see now, only, ROM_UARTIntStatus is not getting triggered.

    Regards,
    Girish.
  • Hi,

    Your vectors interrupt array shows up a watchdog interrupt - please remove it until your program runs correctly then you can enable it back.

    Your interrupt handler clears the interrupt immediately without checking what kind of interrupts you get - place a breakpoint at the clearing interrupts row and examine the status/content of your variable ui32status.

    Not clear what board you have - if LP then for UART3 you may need an level converter. 

  • Hello Girish,

    The Bit 4 changing from 1 to 0 means that there is data in the RXFIFO. However no interrupt coming means that the data in the RX FIFO is not sufficient to cause a RX interrupt. That is why you need the receive timeout interrupt bit also set.

    Regards
    Amit
  • hello,
    I observe that the receive interrupt mask is also set and RX Fifi bit is 0 meaning RX Fifo is full. My Receive string is 35 characters long.I enabled the receive timeout interrupt also. But still the uart interrupt is not generated.As suggested by Petri, I did disable the watchdog , but There also, the uart receive interrupt, still did nor trigger.

    Girish.
  • Hello Girish

    If the UARTFR register RXFF bit is 0, then it means that the FIFO is not FULL.

    Based on the information you have provided, I believe that IntEnable(INT_UART3) is setting the NVIC bit to enable the interrupt. Can you check in the debugger the value of the NVIC registers and paste them as an image when you reply?

    Regards
    Amit
  • Hello,

    One more thing, if I keep the string shown below, in my infinite loop, disabling the sleep,

    while (ROM_UARTCharsAvail(UART5_BASE))
    {
        temp=ROM_UARTCharGet(UART5_BASE);
        receive_data[ data_pointer]=temp;
        data_pointer++;
    }

    I am able to read the received data. This shows that only, the serial receive interrupt is not triggered...

    Girish.

  • It is uart 5 here, because I was trying the same code on uart 5, to see if there will be any change..
  • Hello Girish

    So change it to INT_UART3 and then check if NVIC EN bit corresponding to UART3 interrupt is getting set

    Regards
    Amit
  • Hello,
    Which is this bit? if is search for NVIC enable bit, in datasheet, do not get anything!!!
    Girish.
  • Hello Girish

    It is called ENx (where x is 0 to 3). The UART3 interrupt enable bit is 56, so it should be EN1 register bit 24

    Regards
    Amit
  • Hello,
    Where did this numbers come from?.. I am unable to understand?!!!
    Girish.
  • Hello Girish

    The Interrupt vector number is 56 as per the interrupt table 2-9 of the data sheet. Each NVIC register is 32 bits. So the math

    56-32 = 24

    Since one 32 has been deducted, it is EN1 register (and not EN0) and bit number is 24

    Regards
    Amit
  • Hello Amit,

    Sorry, Yesterday I was very tired and went to sleep early. NO.. the Receive Interrupt bit is not set in NVIC. What may be the problem?

    Girish.

  • Hello Girish,

    Can you please send a snapshot of the UART registers after the data has been sent to it from the PC/Host.

    Regards
    Amit
  • Dear Amit,

    This is the screenshot you had asked for:

    Regards,

    Girish.

  • Hello Girish

    The whole post has been about UART3/4 and now you seem to be using UART5? Please first ensure we all are on the same thread.

    If you wish to use UART5, check the Pins are configured for RX and TX of UART5. Also remove the statement which reads the data in a while loop, else it may interfere with the Interrupt Handler.

    Regards
    Amit
  • DEa Amit,

    I changed it to Uart5 because, while I was testing with scope for Uart3, the Pin got shorted and Tx pin stopped working. So, I had to change to Uart5. I ordered another Launchpad through mouser also, in anticipation of such events in future. Now RX and Tx are configured toPC6 and PC7 as per the pinout.c file attached herewith:

    void
    PinoutSet(void)
    {
        //
        // Enable Peripheral Clocks 
        //
    	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    	MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
    
        //
        // Configure the GPIO Pin Mux for PN0
    	// for GPIO_PN0
        //
    	MAP_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);
    
    	Map_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6 | GPIO_PIN_7);
    
        
    	MAP_GPIOPinConfigure(GPIO_PC6_U5RX);
    	
    	MAP_GPIOPinConfigure(GPIO_PC7_U5TX);
    	
    }
    Okay. I will remove that while loop contents as this was put there to check Received data.

    Regards,
    Girish.

  • Hello Girish

    Just make a simple UART5 project in CCS, test it to be not working on your side and attach it to the forum. I will see if I can reproduce the issue on my LaunchPad

    Regards
    Amit
  • Dear Amit,

    Here is the attached project for user consideration.Uart5.zip

    Regards,

    Girish.

  • Hello Girish,

    I tried importing the project in CCS and it seems that the compiler version is not defined in the CCS project. Can you please confirm what is the compiler version being used?

    Regards
    Amit
  • Dear Amit,
    My Code composer studio Version: 6.1.3.00033 and Tiva C Series ARM MCUs compiler version is 2.1.1.15071.

    Regards,
    Girish.
  • Hello Girish,

    I modified my EK-TM4C1294XL connected launchpad, to connect the UART5 pins to the ICDI com port by removing the resistors R6 and R7 and then wiring PC6 to RXD and PC7 to TXD (on X1 connector). Then  I used a COM port to write bytes and echo them back to the COM port under interrupt control. It works.

    Attached is the working project.

    UART5_RxInterrupt.zip

    Regards

    Amit

  • Hello Gitish

    The compiler version is not want you mentioned. The compiler would be ARM compiler 5.2.x or something. Also there never has been a TivaWare software release 2.1.1.15071. It has been 2.1.1.71 or 2.1.0.12573...

    Regards
    Amit
  • Dea Anit,

    Here are the screen shots for your reference:

  •  The reply accepted only the last two screen shots. Here are the first two:

  • Here is the first one:

  • Hello Girish,

    May be you are referring to the RTOS version. I do not use that at all rather using the TivaWare bare metal release.

    Regards
    Amit
  • Dear Amit,
    What do we do now?
    Girish.
  • Hello Girish

    I have sent you a sample project with UART5 in one of my previous posts with the modification I did to get it to work. Us that with TivaWare 2.1.2.111 and check if it works for you.

    Regards
    Amit
  • Dear Amit,
    If you dont mind can you please let me know the question title or paste the link.
    Regards,
    Girish.