This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

USCI_A UART prescale value



Hi Champs,

I think the User's Guides (for example, slau208f, page 492) state an incorrect prescale value (UCBRx) computation.  Should it actually be UCAxBR0 + (UCAxBR1 * 256)?  Sure this may be petty, but it caused customer confusion.  If this is a misunderstanding on my part, please forgive me!

Cheers,

Clark

Clock prescaler setting of the baud-rate generator. The 16-bit value of (UCAxBR0 + UCAxBR1 × 256) forms the prescaler

value UCBRx.

  • Clark Molster said:

    Clock prescaler setting of the baud-rate generator. The 16-bit value of (UCAxBR0 + UCAxBR1 × 256) forms the prescaler

    value UCBRx.

    Actually both of those equations are functionally the same. In the following equation, order of operations dictate that the multiplication of UCAxBR1 and 256 comes prior to the addition of UCAxBR0, so (UCAxBR0 + UCAxBR1 × 256) = UCAxBR0 + (UCAxBR1 * 256)

  • (UCAxBR0 + UCAxBR1 × 256)

    tells exactly what is meant. Remember that '*' is computed before '+', so the above formula is computed as (UCAxBR0 + (UCAxBR1 × 256)). There's nothing wrong with it. The inner brackets are superfluous by any means of mathematical and (C-) programming rules. The outer brackets are just to tell that this is a mathematical expression inside the normal text flow.

    Additionally, the register description clearly states 'UCAxBR0 - UCBRx low byte' and 'UCAxBR1 - UCBRx high byte'. So there is no room for doubt. :)

  • Thanks guys.  I should've caught that.  Maybe I need a vacation :)

  • Clark Molster said:
    Maybe I need a vacation

    We all need one, preferrably a paid one :)

    (two months to go...)

**Attention** This is a public forum