AnsweredAssumed Answered

UART (BDH, BDL) of a MK10

Question asked by nikivendola on Mar 17, 2016
Latest reply on Mar 21, 2016 by Hui_Ma

Hello,
I have to set the registers of the UART (BDH, BDL) of a MK10 to receive a UP501 GPS module.
The GPS baud rate is 9600 (I think the UART baud rate in the formula below).
the UART module clock is 96 MHz (UART module clock in the formula below).

Using the datasheet formula is shown below:


I have a much larger value of the size of the registers that I have at our disposal.
How does it work?
In a program I've found is handled as follows.

 

// compute baud-rate generation values

uint32_t tmp = 2 * *uart_clocks[dev] / baud_rate;  // this equals 32 * (SBR + BRFD)

uart->BDH = tmp >> 13;

uart->BDL = (tmp >> 5) & 0xFF;

 

I think, that the shift operation is performed because the data is too big but as I understand how shiftare? And then the value does not change?

Thanks for any help

Outcomes