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.

SYSCTL_RCGC1_UART3~7?

Other Parts Discussed in Thread: TM4C123GH6PM

Hello,

I have a TM4C123GXL board. For UART0 initialization, I follow the usual steps :

   SYSCTL_RCGC1_R |= SYSCTL_RCGC1_UART0;          // activate UART0
   SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOA;          // activate port A

... and so on.

For UART1 intialization, the first line would become :

SYSCTL_RCGC1_R |= SYSCTL_RCGC1_UART1;          // activate UART1

SYSCTL_RCGC1_UART0 (=0x01), SYSCTL_RCGC1_UART1 (=0x02) and SYSCTL_RCGC1_UART2 (=0x04) are all defined in the tm4c123gh6pm.h file.
However, the versions of similar constants for UART 3 to 7 do not seem to be included in this file (with SYSCTL_RCGC1_UART3 =0x08...). Is it that the initialization should be different for UART 3 to 7,
and that therefore SYSCTL_RCGC1_UART3 to 7 are not needed? Or maybe that I am not using the right .h file? Or maybe something else?

Thanks for helping,
Jean

  • Hello Ja,

    The SYSCTL registers RCGC1-3 have been deprecated from TM4C123 onwards. They are now replaced by SYSCTL RCGCUART register where bit positions in the register are for each instance of the peripheral.

    Regards
    Amit
  • ... sorry I got formatting wrong. Here is the end of the question (and I do not know how to edit my post) :

    SYSCTL_RCGC1_UART0 (=0x01), SYSCTL_RCGC1_UART1 (=0x02) and SYSCTL_RCGC1_UART2 (=0x04) are all defined in the tm4c123gh6pm.h file.However, the versions of similar constants for UART 3 to 7 do not seem to be included in this file (with SYSCTL_RCGC1_UART3 =0x08...). Is it that the initialization should be different for UART 3 to 7, and that therefore SYSCTL_RCGC1_UART3 to 7 are not needed? Or maybe that I am not using the right .h file? Or maybe something else?

    Thanks for helping,Jean
  • Hi Amit
    Thanks for quick reply.
    Do you mean I should use the constants : SYSCTL_RCGCUART_R0 to SYSCTL_RCGCUART_R7?
    Jean
  • Hello Ja,

    Yes, that is correct. Or better use the SysCtlPeripheralEnable API as that will take care of mapping the bits correctly.

    Regards
    Amit
  • Thanks Amit
    You are right for the API, but I am just following the lower-level procedure for the moment, only for my own educational purposes.
    Jean
  • Hello Jean

    That is fine using the Lower level API. But do not use it as you build your application.
    Reason
    1. Learning is fine but code management will be tougher
    2. Debugging the code even tougher

    Regards
    Amit