You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Set integer & fractional part of baud rate to 2400 Baud fixed. Divider = 3.000.000 / 2400
// Fractional part = 0. In contrary to the documentation, there is no additional divider by 16
// (RASPI 3). May be different at RASPI 1/2 ??
iowrite32(3000000 / 2400, UART_INT_BAUD);
iowrite32(0, UART_FRAC_BAUD);
This baud rate calculation is just working by accident for Raspi Pi 3+ as you wrongly assume that
"there is no additional divider by 16" (which is still there in fact).
For Pi 3 and upwards the default UART frequency is now 48MHz instead of 3MHz,
so while your result is right, your math is wrong (if you don't change the default value in config.txt).
Your calculation of 3000000 / 2400 returns the same result as 48000000 / (16 * 2400) (which is 1250).
To be honest, I have not found a way to read the current default value of the clock frequency. So I only adjusted the comment for now and it still works "by accident" (V1.8). Maybe someone can give me a hint so I can implement it correctly
This baud rate calculation is just working by accident for Raspi Pi 3+ as you wrongly assume that
"there is no additional divider by 16" (which is still there in fact).
For Pi 3 and upwards the default UART frequency is now 48MHz instead of 3MHz,
so while your result is right, your math is wrong (if you don't change the default value in config.txt).
Your calculation of
3000000 / 2400
returns the same result as48000000 / (16 * 2400)
(which is1250
).See the following commit:
Raspberry Pi Firmware Commit
The text was updated successfully, but these errors were encountered: