E22-900T22D STM32 Transmit Receive

259 Views Asked by At

I’m trying to make a rc robot with LoRa Ebyte E22-900T22D module. I’m using STM32F3 series.

When Aux pin as external interrupt when rising edge triggers I transmit data to module If last transmit data is receive command receive uart data. I have a 1 second timer that writes receive command to transmit buffer and send it.

void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
    if(GPIO_Pin == AUX_Pin)
    {
        if(TxData[5] == 0x61)
        {
            if(batArr[2] == 0){
                HAL_UART_Receive_DMA(&huart3, batArr, 6);
            }
            else{
                rbattery = batArr[5];
                batArr[2] = 0;
                TxData[5] = 0;
                HAL_UART_Transmit_DMA(&huart3, TxData, 24);
            }
        }
 //     HAL_UART_Transmit_DMA(&huart3, TxData, 24); //LoRa Transmit
    }
}

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
    if (htim->Instance == TIM16)
    {
        TxData[5] = 0x61;
        HAL_UART_Transmit_DMA(&huart3, TxData, 24);
    }
}

When I run this code i have 700 ms timeout. It's too much for robot control.

If anyone used Ebyte UART LoRa modules can help me ?

How can i reduce the timeout?

Thank you for your time.

I tried to communicate both way transmission (transmit and receive). When send data without checking aux pin data corrupted i can't read it. When I'm checking AUX pin data send correctly but timeout too much.

LoRa settings

0

There are 0 best solutions below