# Forum: ARM programming with GCC/GNU tools Clock/Baudrate

 Author: Horst Dieter (seikusa) Posted on: 2008-12-27 21:53

Rate this post
 0 ▲ useful ▼ not useful
Hi
my problem is that i dont understand the calculation of CD

19200 Baud, 8 Bit, 1 Stopbit, no parity and asynchronous
CPU clocked with 10 mhz

this is the circuit im talking about
http://img187.imageshack.us/img187/2028/mckitr8.jpg

CD= MCKI / (16 * Baud Rate) = 10* 10^6 Hz / (16 * 192Baud) = 8,13 => 8
CD= MCKI / (16 * Baud Rate) = (10* 10^6 Hz / 8) / (16 * 192Baud) = 1,017
=> 1

this an example calculation given by the professor.
and now if i enter 10* 10^6 Hz / (16 * 19200) in my calculator it gives
me 32,55
which is like 4 times the value of the professor.
now there must be some sort of "divisionfactor", which is supposably 4
in this case, but how do i calculate this "divisionfactor"?
or is it always the same?

and what is meant by 192baud is this the same as 19200 Baud? if not how
does it differ?
well thanks in advance

 Author: Clifford Slocombe (clifford) Posted on: 2008-12-28 12:46

Rate this post
 0 ▲ useful ▼ not useful
Horst Dieter wrote:
> CD= MCKI / (16 * Baud Rate) = 10* 10^6 Hz / (16 * 192Baud) = 8,13 => 8
> CD= MCKI / (16 * Baud Rate) = (10* 10^6 Hz / 8) / (16 * 192Baud) = 1,017
> => 1

From that and the diagram I have to agree with you rather than your
professor, however there are some ambiguities:

Where does the divide by eight the second example come from? It is not
indicated in the illustration you posted. Which one of those are you
actually using?

You said the CPU is clocked at 10MHz, but the example indicates an MCKI
of 100MHz. Is 10MHz rather he crystal frequency and 10 the clock
multiplier? 10MHz is rather low for an ARM part.

Note that the USART is a vendor defined peripheral component and not a
standard ARM core component, it would be useful if you could specify the
part so we could simply take a look at the data sheet or user manual and
get a definitive answer. (or you could do that).

Horst Dieter wrote:
> and what is meant by 192baud is this the same as 19200 Baud? if not how
> does it differ?
It seems we are both confused by that. As I said refer to the data sheet
for the part, or let us know what the part is. If Baud merely refers to
the units (as in Hz earlier in the equation), 192 is a rather odd and
very low rate (and does not match the answer given), shouldn't that be
"19200 Baud" I wonder? It still does not make much sense however.

Don't assume that your prof is correct, it would not be the first time
inaccurate information was provided (especially if this is the forst
presentation of the material). That said be diplomatic and discrete is
pointing out any error - your marks may depend upon it! ;-)

Clifford

 Author: Clifford Slocombe (clifford) Posted on: 2008-12-28 14:50

Rate this post
 0 ▲ useful ▼ not useful
Clifford Slocombe wrote:
> Where does the divide by eight the second example come from?
Ok, I am blind, it see now that is an alternative USCKLS input.

Clifford Slocombe wrote:
>  it would be useful if you could specify the part

Ok, with a bit of lateral thinking, Google'ing MCKI, and comparing the
data sheet diagram with your diagram, I have determined that you are
probably using an Atmel AT91 device. But which one?

Clifford

 Author: Clifford Slocombe (clifford) Posted on: 2008-12-29 12:12

Rate this post
 0 ▲ useful ▼ not useful
Clifford Slocombe wrote:
> You said the CPU is clocked at 10MHz, but the
> example indicates an MCKI of 100MHz.

I am being very foggy brained - that's what a month of not working does
to you! Of course 10*10^6 is 10MHz, not 100MHz.

I agree with your calculation, your prof is either wrong or you have
transcribed the information incorrectly.

• $formula (LaTeX syntax)$