This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Schultz' 8051 Programming and Multitasking Baud Rate Timer Anomaly

Schultz claims compiler error in his 0-13-753-815-4 re tl1, th1 for setting up baud rate.

He gives example:
tl1 = ~( 1000/ 256) = 0xfd
)

where the value should be 0xfc.

However, he is calculating the value incorrectly.

He should be doing:

tl1 = (~1000)/xx.

In other words, take the 2's complement first, then mod 256 to get the lower value.

In his example, 1000/256 is 3 and the two's complement is 0xdd.

However, the latter method gives FC, the correct value.

(By the way, his follow-up book repeats the same anomaly.)

0