DATA SERIALIZATION USING 8051 C

SECTION 7.6: DATA SERIALIZATION USING 8051 C
Serializing data is a way of sending a byte of data one bit at a time through a single pin of microcontroller. There are two ways to transfer a byte of data serially:
  1. Using the serial port. When using the serial port, the programmer has very
    limited control over the sequence of data transfer. The detail of serial port data
    transfer is discussed in Chapter 10.
  2. The second method of serializing data is to transfer data one bit a time and con
    trol the sequence of data and spaces in between them. In many new generations
    of devices such as LCD, ADC, and ROM the serial versions are becoming pop
    ular since they take less space on a printed circuit board.

Examine the next four examples to see how data serialization is done in 8051 C.



Example 7-34
Write a C program to send out the value 44H serially one bit at a time via Pl.O. The LSB should go out first.


Example 7-35
Write a C program to send out the value 44H serially one bit at a time via Pl.O. The
MSB should go out first.


Example 7-36
Write a C program to bring in a byte of data serially one bit at a time via PI .0. The LSB should come in first.


Example 7-37
Write a C program to bring in a byte of data serially one bit at a time via PI .0. The MSB should come in first.




SUMMARY
This chapter dealt with 8051 C programming, especially I/O programming and time delays in 8051 C. We also showed the logic operators AND, OR, XOR, and complement. In addition, some applications for these operators were discussed. This chapter also described BCD and ASCII formats and conversions in 8051 C. We also compared and contrasted the use of code space and RAM data space in 8051 C. The widely used technique of data serialization was also discussed.

Next post:

Previous post: