8/317
Table of Contents
317
6.4.3.5 The CATERPIL.BAT file ..........................................179
6.4.4 Using WinEdit to change and compile the files ...............................180
7DEBUGGERANDPROMPROGRAMMERTUTORIALFORST72251 ............183
7.1 STMICROELECTRONICS HARDWARE TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . 183
7.1.1 EPROMProgrammingBoards ...........................................183
7.1.2 StarterKits ..........................................................184
7.1.3 DevelopmentKits .....................................................184
7.1.4 Emulators ...........................................................184
7.2 EPROMPROGRAMMERBOARDS ...................................184
7.2.1 EPROMprogrammerInstallation .........................................185
7.2.2 UsingtheEPROMERsoftware...........................................185
7.3 EMULATORANDDEBUGGER ......................................189
7.3.1 Introducing the emulator and the debugger .................................189
7.3.2 Installing the emulator and the debugger ...................................189
7.3.3 Using the debugger ...................................................193
7.3.3.1 Loading the application ............................................193
7.3.3.2 Running the application ............................................195
7.3.3.3 Watchingtheregistersandvariables..................................195
7.3.3.4 UsingInspectandWatch...........................................197
7.3.3.5 Usingbreakpoints ................................................199
7.3.3.6 Watchingthecontentsofthestack ...................................200
7.3.3.7 Watchingtheexecutiontrace .......................................201
7.3.3.8 Morefeaturestocomelater.........................................202
7.4 PURPOSEOFTHETUTORIAL ......................................202
7.5 SCHEMATICDRAWINGOFTHEPRINTEDCIRCUITBOARD .............204
7.6 DEVELOPING THE PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204
7.6.1 Peripherals used to implement the solution .................................204
7.6.2 Thealgorithmofeachtask ..............................................205
7.6.3 AsimplemultitaskingkernelfortheST7 ...................................206
7.6.3.1 StartTasks routine ...............................................206
7.6.3.2 The
Yield routine.................................................208
7.6.4 Thesourcecodeoftheapplication........................................211
7.6.4.1 Main file (
Multitsk.asm) ...........................................212
7.6.4.2 ADC source file(
Acana.asm) .......................................216
7.6.4.3 Kernel source file (
Littlk.asm)..................................217
7.7 RUNNING THE APPLICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .219
1