Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware Baud Rate Detection for ESP32 S3 (IDFGH-13876) #14721

Open
3 tasks done
LYNHQQ opened this issue Oct 14, 2024 · 0 comments
Open
3 tasks done

Hardware Baud Rate Detection for ESP32 S3 (IDFGH-13876) #14721

LYNHQQ opened this issue Oct 14, 2024 · 0 comments
Labels
Status: Opened Issue is new

Comments

@LYNHQQ
Copy link

LYNHQQ commented Oct 14, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

I used the following code for baud rate detection:
uint32_t uart_baud_detect()
{
// static uint16_t delay_cnt = 0;
if(REG_GET_BIT(UART_CONF0_REG(1), UART_AUTOBAUD_EN) == 0) // Enable auto baud rate detection
{
REG_WRITE(UART_RX_FILT_REG(1), (2 << UART_GLITCH_FILT_S) | UART_GLITCH_FILT_EN);
REG_WRITE(UART_LOWPULSE_REG(1), 4095); // Reset register to max value
REG_WRITE(UART_HIGHPULSE_REG(1), 4095); // Reset register to max value
REG_SET_BIT(UART_CONF0_REG(1), UART_AUTOBAUD_EN); // Enable autobaud
}
while(REG_GET_BIT(UART_CONF0_REG(1), UART_AUTOBAUD_EN) && REG_READ(UART_RXD_CNT_REG(1)) < 300)
{

}
uint32_t low_period  = REG_READ(UART_LOWPULSE_REG(1));
uint32_t high_period = REG_READ(UART_HIGHPULSE_REG(1));
REG_CLR_BIT(UART_CONF0_REG(1), UART_AUTOBAUD_EN); // Disable autobaud
REG_CLR_BIT(UART_RX_FILT_REG(1), UART_GLITCH_FILT_EN); // Disable glitch filtering
printf("high_period:%ld\n", high_period);
printf("low_period:%ld\n", low_period);
return 80000000 / low_period;

}

However, I found that during use, it is only effective the first time. When I change the baud rate on the sending end, it still gives the value detected during the first power-up and does not change."

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 14, 2024
@github-actions github-actions bot changed the title Hardware Baud Rate Detection for ESP32 S3 Hardware Baud Rate Detection for ESP32 S3 (IDFGH-13876) Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

2 participants