Thread (15 messages) 15 messages, 4 authors, 2009-01-27

Re: [PATCH] cpm2: Round the baud-rate clock divider to the nearest integer.

From: Laurent Pinchart <hidden>
Date: 2008-11-21 16:04:51

Hi Scott,

On Thursday 20 November 2008, Scott Wood wrote:
On Thu, Nov 20, 2008 at 01:32:23PM +0100, Laurent Pinchart wrote:
quoted
Instead of rounding the divider down, improve the baud-rate generators
accuracy by rounding to the nearest integer.

Signed-off-by: Laurent Pinchart <redacted>
This makes things worse on mpc8272ads -- the result of the division is
13.56, but I only get error-free serial output when rounding down.  I
don't think the remote end has timing problems, as I don't see this with
any other board.
I get exactly the opposite here with an mpc8248 base board. Rounding down 
makes 115200bds completely unreliable :-/

Could you measure the serial baudrate with and without the patch using an 
oscilloscope ?
Possibly the crystal is a little off,
That's always possible.
or maybe it's just better to be a little too fast than a little too slow for
some reason? 

Maybe we should change CPM_CLK to be MAIN_CLK/4 rather than MAIN_CLK/16
when the BRG clock is below a certain frequency.
Isn't that the job of the boot loader ? Accuracy would be improved, but power 
consumption will raise as well :-/

Best regards,

Laurent Pinchart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help