Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Nano Pi Duo 2 - UART baud rate and clock

Featured Replies

Hi all,

 

Firstly, I want to say that I'm new to Armbian and embedded Linux. I have tried searching the solution for my problem on various sites but I haven't had any luck. 

 

I am using a Nano Pi Duo 2 (H3) board with Armbian Buster to communicate with another device through UART1 (TX1, RX1). I am able to communicate at 115200 bps with no problem.  However, I need the baud rate to be at least 230400 bps (ideally 921600) for my application. I'm using WiringNP library. When I changed to those baud rates and performed a simple feedback test (shorting TX/RX), I can receive the data. But when I connect it to another device, the communication does not function correctly. I read from this thread that the UART baud depends on the UART clock frequency because of <2.5% error.  I believe that the current UART clock is 24 MHz. After checking this table out, I think I need my UART clock to be at least 30 MHz to get the baud rates above.  I successfully change the I2C clock from 100 kHz to 400 kHz by following this thread. Can I do the same thing for my UART clock? Could anyone please help me with this problem?

 

Thank you so much in advance. I've been struggling with this problem.

Edited by td1191

  • Author

Could anyone please point me to a thread either in this forum or other resource that dealt with APB2 and PLL_PERIPHER0 clock for UART speed in the past? I have tried finding many sites since I posted this thread but couldn't find a right way to make it to work. I'm very new to this and I really appreciate your help.  Thank you!

Do you need those exact baudrates? I don't remember where I saw it, but somewhere I read that the UART speed should be close to an even divisor of 1.5MHz. At least that's what I remember, and it seems to work for e.g. 115200.

 

In any case, I'm currently running the UART on a Duo 2 at 500kbps with no problems. If you have control of the other end of the link you might try that.

 

That said, I would also be interested in tweaking the clocks a bit because I would really like to be able to run at 400kbps and 420kbps if possible.

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.