public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Correction of baudrate calculation for QUICC SMC uart
@ 2003-09-08  6:58 Tord Andersson
  2003-09-08 14:50 ` Gary Thomas
  0 siblings, 1 reply; 2+ messages in thread
From: Tord Andersson @ 2003-09-08  6:58 UTC (permalink / raw)
  To: ecos-discuss

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

--------------------------------------

Kind regards,

Tord Andersson
Combitech Systems AB


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] Correction of baudrate calculation for QUICC SMC uart
  2003-09-08  6:58 [ECOS] Correction of baudrate calculation for QUICC SMC uart Tord Andersson
@ 2003-09-08 14:50 ` Gary Thomas
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Thomas @ 2003-09-08 14:50 UTC (permalink / raw)
  To: Tord Andersson; +Cc: eCos Discussion

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-08 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-08  6:58 [ECOS] Correction of baudrate calculation for QUICC SMC uart Tord Andersson
2003-09-08 14:50 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).