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.

Help with UARTDR

Hello everibody..
I need your help me, I want to read a bites of register UARTDR, but I don't know, If somebody could show me an example to see how it's done

Sorry for mi english....

  • Hi, Oscar,


    I suspect what you want to do is programatically read the register rather than view it in a debugger? If so, there are a couple of ways to do it.

    First way is to make use of the TivaWare UART library. Just call UARTCharGetNonBlocking(), passing it the base address of the UART you want to read. It returns the contents of the DR, or -1 if there is no character available.

    Second way is to directly access the register. You can do this by the following code:

    U32 reg = HWREG(ui32Base + UART_O_DR);  // where ui32Base is the base address of the UART you want to read

    Hope that helps.

    Regards,

    Dave

  • Hello Oscar,

    When looking for API's I would suggest the TivaWare DriverLib User Guide as a good place to start. It has description of the API's and some code examples as well.

    Regards
    Amit