Question About A UART

Thread Starter

Fnordgasm5

Joined Mar 2, 2013
15
1658841232300.png

Regarding the above question, I have to calculate the divisor value for the DLM and DLL registers. These are 8-bit registers used to store a 16-bit value. According to my calculations (and a table in the datasheet which I missed until after I calculated it) the divisor should be 576. To equates to a hex value of 240.

My questions are these:

Am I right in assuming that the DLM represents the most significant bit of the 16-bit value and DLL is the significant bit? Which would mean the answer 0x240 would be incorrect. Am I right in assuming that I have to calculate 576 in 16-bit binary, divide it into two 8-bit chunks, and then calculate the hex values for each chunk? If so, how would I represent that?
 

Attachments

MrChips

Joined Oct 2, 2009
30,714
View attachment 272245

Regarding the above question, I have to calculate the divisor value for the DLM and DLL registers. These are 8-bit registers used to store a 16-bit value. According to my calculations (and a table in the datasheet which I missed until after I calculated it) the divisor should be 576. To equates to a hex value of 240.

My questions are these:

Am I right in assuming that the DLM represents the most significant bit of the 16-bit value and DLL is the significant bit? Which would mean the answer 0x240 would be incorrect. Am I right in assuming that I have to calculate 576 in 16-bit binary, divide it into two 8-bit chunks, and then calculate the hex values for each chunk? If so, how would I represent that?
What you said is correct.
18432000/2000/16 = 576
576 in binary is 0000 0010 0100 0000 which is 0240 in hexadecimal.
Either way, the result is the same.
Your two bytes are 02 and 40 in hexadecimal or 0000 0010 and 0100 0000 in 8-bit binary.
In other words 0x0240 is 0x02 and 0x40. You just need to split the 16-bit hex value into two 8-bit hex values.
 

Thread Starter

Fnordgasm5

Joined Mar 2, 2013
15
What you said is correct.
18432000/2000/16 = 576
576 in binary is 0000 0010 0100 0000 which is 0240 in hexadecimal.
Either way, the result is the same.
Your two bytes are 02 and 40 in hexadecimal or 0000 0010 and 0100 0000 in 8-bit binary.
In other words 0x0240 is 0x02 and 0x40. You just need to split the 16-bit hex value into two 8-bit hex values.

Well, that's a miracle. I'm sure the people who write datasheets only do so for people who write datasheets. So DLM would be 0x02 and DLL would be 0x40.

Thank you for your help. It's much appreciated.
 
Top