Download Embedded C Tutorial - (8051)

Transcript
8322 Chapter 9 p217-254
21/2/02
10:04 am
Page 237
Using the serial interface
237
-*------------------------------------------------------------*/
void sEOS_Go_To_Sleep(void)
{
PCON |= 0x01;
// Enter idle mode (generic 8051 version)
}
/*------------------------------------------------------------*---- END OF FILE -------------------------------------------*------------------------------------------------------------*/
9.11 The Serial-Menu architecture
In Chapter 4, we discussed the fact that mechanical switches are a very common
part of the user interface for embedded applications. Another common interface
feature is the Serial Menu.
The Serial Menu architecture involves the use of a desktop PC (or similar) on
which a list of menu options will be displayed. This menu will allow the user to
execute code on an embedded system, which may be located some distance away.
The embedded menu architecture is particularly common in data acquisition
and control applications. We give an example of both types of application in the
sections that follow.
9.12 Example: Data acquisition
In this section, we give an example of a simple data-acquisition system with a
Serial Menu architecture.
In this case, using the menu, the user can determine the state of the input pins
on Port 1 or Port 2, as required (Figure 9.4).
The code required to generate this behaviour is given in Listing 9.7 to
Listing 9.11.