How to get UART working on RA6M5?

Hello,
I'm trying to get UART working in our project. I'm working on RA6M5 MCU.
I looked at the example "ra-fsp-examples-master\ra-fsp-examples-master\example_projects\ek_ra6m5\sci_uart\sci_uart_ek_ra6m5_ep\iar" in IAR 9.10. I noticed that the TX is P101, RX is P100. For us, the TX is P409; the RX is P408. How can I change the PIN configuration to make it work for our design?
Actually I also created my project. I added the UART stack(r_sci_uart). When I tried to configure the RX and TX, I can't configure it for P408 and P409. How can I setup the PIN for RX and TX?
Is there any document about how to get UART working?
Thanks!

  • Hi Jeremy,

    Please see the clock configuration from my project. I didn't change the clock. 

    What could be the problem for this issue?

    Thanks.

  • Hi,

    Sorry for the delayed reply, life is just hectic at the moment.

    In the FSP the interrupt was set like..

    The int looks like:

    ......

    #include "projectZone.h"

    void comms485Int(uart_callback_args_t *p_args)
    {
    if (p_args -> event == UART_EVENT_RX_CHAR)
    {
    //R_SCI_UART_Read(&g_uart0_ctrl, &rx485Char, 1);

    rx485Char = (uint8_t)(p_args -> data);

    handle485Serial();
    comms485Received = 1; // turn the comms LED on
    }

    /*
    if (p_args -> event == UART_EVENT_TX_COMPLETE)
    {
    RX485EN;
    }
    */

    }

    ......

    FSP 3.6 now has RS485 Tx enable built in, which is why the TX section is commented out.

    The system is strictly poll, and response.

    The handle485Serial routine is very short and handles the message byte by byte, and constructs a transmit array on the fly, and executes the following when ready, and then goes back into listening mode.

    //TX485EN;
    status = R_SCI_UART_Write(&g_uart0_ctrl, &tx485Buff[0], num485TxChars);

  • Hi Pilot-

    Here are some additional points to consider fixing:

    bsp_clock_init() is not called. 

    System clocks are not setup properly.

    BOARD_ClockInit() calls hal_entry(). 

  • Hi Warren,

    I checked. bsp_clock_init() is called by SystemInit() which is called by Reset_Handler(). We don't call BOARD_ClockInit().

    Speaking of "System clocks are not setup properly", we don't setup system clock. Can you tell me where to find the "system clocks setup"?

    Thanks!

  • H Pilot-

    I me3an configuring the clocks in the clock tab as you show above. Just check to see if they are set properly for your application. You might compare it to the example project to see if yours is similar.

  • Hi Warren,

    Thanks. I compared the clock configuration between mine and the sample project's. They are the same.