[ECOS] Correction of baudrate calculation for QUICC SMC uart
Gary Thomas
gary@mlbassoc.com
Mon Sep 8 14:50:00 GMT 2003
On Mon, 2003-09-08 at 00:58, Tord Andersson wrote:
> Hi,
>
> When using higher baudrates in an MPC823e based system using eCos and
> the SMC UART, I found that the baudrate was slightly wrong. I checked
> the baudrate calculation and believe that it could be somewhat altered.
> The change has solved our problem.
> Below is the result of "diff -u -5 -b -p" between the original and the
> patched file for review.
> The file is located in
> .../packages/devs/serial/powerpc/quicc/current/src
>
> ---------------------------------------
>
> --- quicc_smc_serial.h Thu Sep 4 08:50:14 2003
> +++ patched_quicc_smc_serial.h Thu Sep 4 09:04:26 2003
> @@ -130,8 +130,8 @@
> 0, // 230400
> };
>
> -#define UART_BITRATE(n)
> (((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/n)
> -#define UART_SLOW_BITRATE(n)
> ((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/n))
> +#define UART_BITRATE(n)
> ((((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/16)/n)-1)
> +#define UART_SLOW_BITRATE(n)
> (((CYGHWR_HAL_POWERPC_BOARD_SPEED*1000000)/n))-1)
>
> // Channel type select
> #define _SCC_CHAN 0
>
> --------------------------------------
Yes, it does look like you are correct. I'll make these changes.
Thanks.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss
More information about the Ecos-discuss
mailing list