This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Correction of baudrate calculation for QUICC SMC uart
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Tord Andersson <Tord dot Andersson at combitechsystems dot com>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 08 Sep 2003 08:50:47 -0600
- Subject: Re: [ECOS] Correction of baudrate calculation for QUICC SMC uart
- Organization: MLB Associates
- References: <004B1D7A5257174C9044A1B7BD0E60EDA3DCEA@ratatosk.combitechsystems.com>
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