Example: An output-only library for the 8051/8052 (generic)

Example: An output-only library for the 8051/8052 (generic)

This example again illustrates how to link a Standard 8051 device to a PC.

Unlike the first example, the software is ‘write only’: data are transferred from the microcontroller to the PC but not vice versa. To illustrate this, the software displays elapsed time on the PC via a terminal emulator program.

In Figure 18.6, we illustrate this software running on the Keil hardware simulator. Of course, it may equally well display its outputs using Hyperterminal (or equivalent), as in Figure 18.3: however, the use of the hardware simulator is useful during the early stages of program development.

The hardware shown in Figure 18.2 can again be used here to run this program. The source code for this example is included on the CD.

image

Further reading

In a very readable book, Axelson (1998) considers the use of RS-232 communications. Although she discusses 8051 microcontrollers, the main focus is on the PC end of the communication link. Axelson provides some useful code examples that can be adapted for use in many PC-based data acquisition and monitoring systems.

Leave a comment

Your email address will not be published. Required fields are marked *