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.

AM2432: How do I set PRUSSn_UART_GFCLK Clock source to work on 12 MHz baud rate of UART ?

Part Number: AM2432
Other Parts Discussed in Thread: PROFIBUS, SYSCONFIG

hi Sir

    1. Which GPIO of UART can support PROFIBUS function?

   The PROFIBUS only work on UART0,don't it?

  2.How do I set PRUSSn_UART_GFCLK Clock source to work on 12 MHz baud rate of UART ?

    I want to test UART communation on frequence 12MHz?

 PRU-ICSSG UART and PROFITBUS.

  3.As below spec,Is the Error rate 12000000% when Baud rate on 12Mhz? 

 4.How to setup the configure to support 12-Mbps PROFIBUS?

BR

Sheng Yi

  • Hi Sheng,

    We're looking into this and will get back with you shortly.

    Regards,
    Frank

  • Hi Sheng,

    1. Which GPIO of UART can support PROFIBUS function?

    ICSSG only has a single UART instance, UART0.

    2.How do I set PRUSSn_UART_GFCLK Clock source to work on 12 MHz baud rate of UART ?

    This is described the AM263x TRM, 6.4.8.2.4 PRU_ICSSG UART Clock Generation and Control.

    ICSSG0_UART_CLK is 192 MHz (see Figure 6-154. PRU_ICSSG0 Integration).

    UART_MODE:OSM_SEL [0] = 0 selects 16x mode

    UART_DIVMSB:DLH = 0, UART_DIVLSB:DLL=1 selects DLH:DLL = 1

    192e6/16/1 = 12e6 (12 Mbaud)

    3.As below spec,Is the Error rate 12000000% when Baud rate on 12Mhz? 

    This is a mistake in the TRM. The error (%) should be 0% in this case.

    4.How to setup the configure to support 12-Mbps PROFIBUS?

    Supported industrial protocols described in MCU+SDK documentation here:

    I'm looping in a colleague for further comment on question 4 if needed.

    Regards,
    Frank

  • Hi Frank

         Thank you for your reply.

        As below reply,    How to use sysconfig_1.13.0 tool to set up this UART funtion?

     

    2.How do I set PRUSSn_UART_GFCLK Clock source to work on 12 MHz baud rate of UART ?

    This is described the AM263x TRM, 6.4.8.2.4 PRU_ICSSG UART Clock Generation and Control.

    ICSSG0_UART_CLK is 192 MHz (see Figure 6-154. PRU_ICSSG0 Integration).

    UART_MODE:OSM_SEL [0] = 0 selects 16x mode

    UART_DIVMSB:DLH = 0, UART_DIVLSB:DLL=1 selects DLH:DLL = 1

    192e6/16/1 = 12e6 (12 Mbaud)

    BR

    Sheng Yi

  • Hi Sheng,

    Sorry for the delayed response.

    I don't see any way to configure these registers from Syscfg. I also don't see any API functions for configuring ICSS UART baud rate. I'll discuss this with the SDK team.

    Generated Sysconfig code configures the UART CLK to 192 MHz (see ti_power_clock_config.c:Module_clockSetFrequency()).

    To configure UART_MODE:OSM_SEL and UART_DIVMSB:DLH / UART_DIVLSB:DLL like so:

    #include <drivers\hw_include\hw_types.h>
    #include <drivers\hw_include\cslr_soc.h>
    
    // ...
    
    uint8_t regVal;
    
    /* UART_MODE:OSM_SEL = 0, select 16x mode */
    regVal = HW_RD_REG8(CSL_PRU_ICSSG0_PR1_ICSS_UART_UART_SLV_BASE+CSL_ICSS_G_PR1_ICSS_UART_UART_SLV_MODE);
    regVal &= ~0x1;
    HW_WR_REG8(CSL_PRU_ICSSG0_PR1_ICSS_UART_UART_SLV_BASE+CSL_ICSS_G_PR1_ICSS_UART_UART_SLV_MODE, regVal);
    
    /* UART_DIVMSB:DLH = 0, UART_DIVLSB:DLL=1 selects DLH:DLL = 1 */
    HW_WR_REG8(CSL_PRU_ICSSG0_PR1_ICSS_UART_UART_SLV_BASE+CSL_ICSS_G_PR1_ICSS_UART_UART_SLV_DIVMSB, 0x00);
    HW_WR_REG8(CSL_PRU_ICSSG0_PR1_ICSS_UART_UART_SLV_BASE+CSL_ICSS_G_PR1_ICSS_UART_UART_SLV_DIVLSB, 0x01);
    

    Regards,
    Frank