Keil RTX51 Manual page 62

Table of Contents

Advertisement

62
*line = 0;
*/
}
Compiling and Linking TRAFFIC
Enter the following commands at the DOS prompt to compile and link TRAFFIC.
C51 TRAFFIC.C DEBUG OBJECTEXTEND RF (TRAFFIC.REG)
C51 SERIAL.C DEBUG OBJECTEXTEND RF (TRAFFIC.REG)
C51 GETLINE.C DEBUG OBJECTEXTEND RF (TRAFFIC.REG)
BL51 @TRAFFIC.LIN
Alternatively, there is a batch file called
link, and automatically run DS51.
Testing and Debugging TRAFFIC
Once you have compiled and linked TRAFFIC, you can test it using DS51. Type
DS51 TRAFFIC
to run DS51 and load including the
cally load the IOF driver, load the traffic program, load an include file for displaying task
status, active watchpoints for the traffic lights, define a function for the pedestrian button
(which is activated using
ing of
load ..\..\ds51\8052.iof
include dbg_tiny.inc
/* define watch variables */
ws red
ws yellow
ws green
6
ws stop
ws walk
/* set P1.5 to zero:
PORT1 &= ~0x20;
/* define a debug function for the pedestrian push button */
signal void button (void)
PORT1 |= 0x20;
twatch (50000);
PORT1 &= ~0x20;
}
/* define F4 key as call to button () */
set F4="button ()"
You can start the execution of the application TRAFFIC with the GO command:
g
), and start the TRAFFIC application. Following is the list-
F4
.
DS51.INI
/* load debug function for RTX51 Tiny */
Key Input */
that you can use to compile,
TRAFFIC.BAT
initialization file. This file will automati-
DS51.INI
/* load 8052 CPU driver*/
{
/* set Port1.5
/* wait 50 ms
/* reset Port1.5 */
Application Examples
/* mark end of string
*/
*/

Advertisement

Table of Contents
loading

Table of Contents