This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

baud rate change when usb plugin computer

Hi, 

We have just almost finished develop a product which used nrf52840 as a data hub, a wifi module connect to nrf52840 through uart, and baudrate set to 460800, and also optionally USBCDC connect to PC,  we found there is a difference of baudrate about 0.5% to 2% between plugin and plugout usb, this will cause uart baudrate error, please kindly recommend a solution about this issue.

Brian Qin

Parents
  • Hi Brian

    To get stable baudrate when using the UART it is important to use the external HF crystal. The internal HF source can deviate by as much as 8%, and the internal source is the default unless the external one is requested by software. 

    Most likely the USB driver will request this when the USB is running, which is why the USB connection affects the accuracy. 

    Can you try to request external HF clock manually and see if it improves the accuracy?

    If you need advice on how to do this please let me know if you use a Bluetooth SoftDevice or not, as the method for requesting external HF clock differs when using it. 

    Best regards
    Torbjørn

Reply
  • Hi Brian

    To get stable baudrate when using the UART it is important to use the external HF crystal. The internal HF source can deviate by as much as 8%, and the internal source is the default unless the external one is requested by software. 

    Most likely the USB driver will request this when the USB is running, which is why the USB connection affects the accuracy. 

    Can you try to request external HF clock manually and see if it improves the accuracy?

    If you need advice on how to do this please let me know if you use a Bluetooth SoftDevice or not, as the method for requesting external HF clock differs when using it. 

    Best regards
    Torbjørn

Children
Related