AnsweredAssumed Answered

The ADuCM350 MCU UART problem

Question asked by Lg963147 on Feb 6, 2017
Latest reply on Feb 6, 2017 by Lg963147

In my project I use UART in blocking, non-interrupt mode. My program gets the master command and responses.

There is a UART initialization function.

 

#define UART0_TX_PORTP3_MUX  ((uint16_t) ((uint16_t) 2<<12))
#define UART0_RX_PORTP3_MUX  ((uint16_t) ((uint16_t) 2<<14))

 

ADI_UART_HANDLE     hUartDevice     = NULL;

 

ADI_UART_RESULT_TYPE UART_Init (void)
{
    ADI_UART_RESULT_TYPE    result = ADI_UART_SUCCESS;
    ADI_UART_GENERIC_SETTINGS_TYPE  Settings;
   
    /* Port Control MUX registers */
    *((volatile uint32_t *)REG_GPIO3_GPCON) |= (UART0_TX_PORTP3_MUX | UART0_RX_PORTP3_MUX);
   
    /* Open UART in blocking, non-intrrupt mode by supplying no internal buffs */
    if (ADI_UART_SUCCESS != (result = adi_UART_Init(ADI_UART_DEVID_0, &hUartDevice, NULL)))
    {
        return result;
    }
   
    Settings.BaudRate = ADI_UART_BAUD_115200;
    Settings.bBlockingMode = true;
    Settings.bInterruptMode = false;
    Settings.Parity = ADI_UART_PARITY_NONE;
    Settings.WordLength = ADI_UART_WLS_8;
    Settings.bDmaMode = false;

    /* config UART */
    if (ADI_UART_SUCCESS != (result = adi_UART_SetGenericSettings(hUartDevice, &Settings)))
    {
        return result;
    }
   
    /* Enable UART */
    if (ADI_UART_SUCCESS != (result = adi_UART_Enable(hUartDevice,true)))
    {
        return result;
    }
   
    return result;
}

 

This function returns ADI_UART_SUCCESS.

 

I send command from master and see it on the UART RX pin, but the adi_UART_GetNumRxBytes function returns 0

 

Please help me.

Thank you.

 

Leonid Gal,

 

SYSMOP Technologies Software Engineer,

3 Hatamar st.

  1. O. Box 35

2069201 Yoqneam Illit

Israel

Tel: 972-4-9090810

Mobile: 972-54-7564536

Fax: 972-4-9937059

 

Leonid_g@sysmop.com

Outcomes