Download Embedded Multitasking with small - innovated
Transcript
316 Chapter 5 The only problem with this type of data-logging system is the time required to transmit the data from the microcontroller to the second system. Serial interfaces on PCs and workstations are limited to 56K bits per second or slower. Even the slew rate capability of the RS-232 transmitters and receivers will limit the upper speed of transmission and the distance between the microcontroller and the second system. So, while this system does have essentially an unlimited storage capacity, it does have a limited data bandwidth. Using this type of data logging will require a combination of the previous two systems. We will no longer be able to store every occurrence of every error. Instead, we will have to pick and choose which events are important enough to log every event, and only keep totals on error data that is not so important. We also may have to create a serial transmit function in software, if the microcontroller does not have an on-chip asynchronous serial interface peripheral. Fortunately, this type of serial interface is not difficult to generate. However, it does require specific timing to operate properly. This means that the general timing of the system could be affected. There are two options for dealing with this problem: one, a serial interface peripheral can be connected to the microcontroller using a faster synchronous serial interface; or two, the serial interface routine can provide an external signal indicating when it is active. In the first option, an asynchronous interface peripheral with a synchronous serial control interface can be connected to the microcontroller. There are a couple of devices available commercially to perform this function, or a separate microcontroller with the capability to receive asynchronous serial communication can be programmed to provide the translation function. In fact, building up just such a test fixture for a designer’s toolbox is good idea. While this method is not an economically attractive idea for the final design, using a simple translator for testing only costs the use of two to three input/output pins for the duration of the testing. And, by off-loading the overhead of generating the slower data stream to the external peripheral, the timing for the main microcontroller should