8051 Book's Errata

Mr. Javad Rasti from Esfahan University pointed out a major problem in Chapter 7. The programs are written for the simulator. If we want to run them on the hardware trainer only once, then we need to place a "while(1);" or "for(;;);" as the last statement in main(). This is like "HERE: SJMP HERE" in Assembly language.

8051 I/O Reset Question

From the Intel Datasheet on I/O ports of 8051 upon Reset:

All the port latches in the 8051 have 1s written to them by the reset function. If a 0 is subsequently written to a port latch, it can be reconfigured as an input by writing a 1 to it.

In the 8051 book by Mazidi, the only reason we write 1s to the port upon reset is to emphasize the above point. It is always a good idea to write 0 to a given port to make it an output and 1 to make it an input before using it. Several readers have written to me to point to the confusion about this issue in Chapter 4. It will be clarified further in the next edition.

Prof. Mazidi