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.

TI-RTOS TIVA-C Uartecho example

Other Parts Discussed in Thread: SYSBIOS

 Hi,

 How to change the Uart port on the Uartecho example?

I want to add to this project an ADC interrupt triggered by the PWM to control a buck converter. Is it possible to set a hardware interrupt with a higher priority than the sysbios interrupt?

Is it possible to use TivaWare peripheral drivers in a sysbios project?

Is ti possible to set a hardware interrupt directly on the NVIC as in a normal TivaWare project?

  

 

 

  • Hi Ari,

    Ari Mendes dos Santos said:
    How to change the Uart port on the Uartecho example?

    What do you mean? Change it how?

    Ari Mendes dos Santos said:

    I want to add to this project an ADC interrupt triggered by the PWM to control a buck converter. Is it possible to set a hardware interrupt with a higher priority than the sysbios interrupt?

    Is it possible to use TivaWare peripheral drivers in a sysbios project?

    You have two options here:

    1. As you are working with an NVIC, you can change the interrupt's priority so that your ADC interrupts can nest (preempt) other interrupts. See here. These interrupts will still be dispatched through the SYS/BIOS hardware interrupt dispatcher, so SYS/BIOS APIs can be used. The priority can be changed using Hwi_setPriority(); See the Hwi documentation for the ARM cortex devices (in particular to the arm cortex m3).
    2. The other option: you can use what SYS/BIOS's calls: "Zero latency interrupts" that execute ISRs without going through the SYS/BIOS hardware interrupt (Hwi) dispatcher. While its quicker to start execution, the tradeoff here is that you loose the ability to use any SYS/BIOS API calls within the ADC interrupt!

    Yes, you can use TivaWare peripheral driver APIs, but they are inherently not thread safe. You'll have to keep track of the hardware resources you manipulate using TivaWare.

    Ari Mendes dos Santos said:
    Is ti possible to set a hardware interrupt directly on the NVIC as in a normal TivaWare project?

    No. All interrupt routines must be installed via the Hwi module; using the Hwi APIs. (See options 1 and 2 above.)

    Hope this helps. Good luck!

  • Tom,

       TIVA-C Microcontrollers has 8 Uart ports, Uart0 to Uart7. The Uartecho example is tied to Uart0 and I couldn`t find any parameter to use other port. 

        Ari.

  • Ari,

    Are you using TI-RTOS 1.10.00.23? The definitions for the UART driver get defined in the "board.c" file. What device are you using?

    If you're not using TI-RTOS, what example are you referring to?

  • I am using TI-RTOS 1.01.00.25

    I changed UART_Open(BoardUART,@UartParams) to
    UART_Open(1,@UartParams), trying to open UART1 instead of UAR0.

    when I did that the function never returned. My question now is what values of BoardUART for UART1, UART2,...,UART7?

     

  • That's defined the board specific "board.c" file. For example. for the EKS_LM4F232 development board, there is a EKS_LM4F232.c and EKS_LM4F232.h. The "board.c" is based on the name of the development board.

    Check the Users Guide's "Driver Framework" section for details on how the driver's are configured.

    You need to add the extra EKS_LM4F232_UARTName enum entries and the hardware attributes in the uartHWAttrs[] array. Then update the EKS_LM4F232_initUART() to configure the needed UART pin muxing.

    The integer value that you are passing into UART_Open is the element index to the uartHWAttrs[] and uartObjects[] array. In other words,  you could use UART_open(1, &uartParams); to open UART2 if uartHWAttrs[1] is configured with the base address and interrupt vector number of UART2.

    /* UART configuration structure */
    const UART_HWAttrs uartHWAttrs[EKS_LM4F232_UARTCOUNT] = {
        {UART0_BASE, INT_UART0}, /* EKS_LM4F232_UART0 */
        {UART2_BASE, INT_UART2}, /* EKS_LM4F232_UART2 */
    <-- UART_open(1, &uartParams);
    };