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.

PGA450Q1EVM: using UART

Part Number: PGA450Q1EVM
Other Parts Discussed in Thread: PGA460, PGA460PSM-EVM, PGA450-Q1

Hi Akeem,

I have the pga450q1EVM-S and i am wondering if it possible to get sensor readings without programming the chip, just by sending one of the eight commands?

  • Hi Basel,

    Yes, if you purchased the PGA450Q1EVM-S, the OTP memory of the device is already programmed with the eight example UART commands listed in the EVM-S User's Guide. You do not need reprogram the device. You will not be able to reprogram this device anyway since the OTP is already programmed for the EVM-S.

    Have you also considered using the PGA460PSM-EVM? This is our latest small form factor ultrasonic sensing module that does not require any programming whatsoever. You can use the example microcontroller code from the PGA460 software resources to customize the PGA460 operation.

  • Hi Akeem, 

    I already tried to send UART commands but unfortunately the sensor doesn't respond. Does the commands need to be send in a predefined intervals?  

    I am using STM32F4 microcontroller to send the UART signals, the setting of the UART is as follow: 

    // init with baud rate, 8 data bits, 1 stop bit, no parity, no RTS + CTS

    // USART_BAUDRATE = 19200

    USART_InitStructure.USART_BaudRate = USART_BAUDRATE;
    USART_InitStructure.USART_WordLength = USART_WordLength_8b;
    USART_InitStructure.USART_StopBits = USART_StopBits_1;
    USART_InitStructure.USART_Parity = USART_Parity_No;
    USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
    USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
    USART_Init(USART2, &USART_InitStructure);

    The following is the function used to send the command: 

    void send_command0()
    {
    USART_SendData(USART2,0x00);
    while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET); // this is flag to insure that the sending is done

    USART_SendData(USART2,0x55);
    while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);

    USART_SendData(USART2,0x01);
    while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);

    USART_SendData(USART2,0x00);
    while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET);}

    Thanks, 

    Basel 

     

  • Hi Basel,

    Is your STM32F4 a 5V logic level microcontroller, or are you using a level translator to achieve 5V logic level at the PGA450-Q1? The STM32F4 microcontroller family appears to be low-voltage operating between 1.71 to 3.6V. However, the PGA450-Q1's TXD and RXD pins are only 5V logic level compatible, not 3.3V or 1.8V.

  • Hi AKeem,

    I have used level translator to get a 5V logic level at the PGA450_Q1, But still no response, any other advices??

    Do I need to use USART transceiver.

  • Hi Basel,

    Have you physically probed the TXD and RXD pins to ensure there is master-transmit activity when you issue you Cmd0 example of 0x00,55,01,00? Also check to see if the device is physically responding; the micro may not be capturing the data.

    If possible, use a logic analyzer to check to master-transmit data as shown:

    You can also try adding a pull up resistor (i.e. 10kOhm) to the TXD pin of the PGA450-Q1.

  • Hi Akeem,

    Thanks a lot this solved my problem and I can now receive data from the sensor.

    but I faced a problem while reading from the UART, that is when I send command 0 according to the documnetation I must receive 0x12 0x23, which is not correct since the sensor will send 0x12 0x34 this took me a while to notice that the UART  working correctly, so i hope that you will change the documentation.