202/317
7 - Debugger and PROM Programmer Tutorial for ST72251
The first line of the above display, which is red, shows the current source line.
The second line, which is blue, shows on the right the absolute code corresponding to the
source line. For example, the identifier
cpudiv2
in the source text has zero value. The begin-
ning of the line shows the address of the instruction and the corresponding machine code.
This line actually shows the Fetch cycle of the instruction, that is, the cycle where the instruc-
tion code is read. For example, the instruction
ld a, #0
is coded as
A6
. The next byte,
00
, is actually read on the following line. The letter
R
tells that
this is a read cycle.
There may be several following lines if the instruction takes more than two memory cycles al-
together. For example, the instruction
ld 0x20, a
does a dummy read to address
20
, that is actually not used by the core, and then a true write
to that address to store the value of the accumulator, that is zero.
With all these tools, we can now debug the next application.
7.3.3.8 More features to come later
The Windows Debugger offer more options than those described here. These other options
are specifically designed for working with C language, and we shall discuss them when we
have introduced C-language programming in the next chapter.
7.4 PURPOSE OF THE TUTORIAL
This chapter has as its sole purpose to help you build an application using the ST7 from
scratch. This includes designing the test board, writing the program and debugging it.
The subject of this application is the demonstration of a simple multitasking kernel. This will
show that multitasking is not necessarily a feature only for top-range microprocessors, and
that programming in such an environment can improve the program structure.
The kernel will provide for four distinct tasks to be run. All of these tasks are exactly the same:
they take the voltage at the wiper of a potentiometer as an input, and switch a LED on or off at
the output. The LED will blink at a frequency is proportional to the position of the wiper of the
potentiometer. W e shall thus get four potentiometers whose position sets the blinking fre-
quency of four LEDs, and we shall see that each channel is completely independent of the
others, that is, varying the position of one potentiometer does not change the blinking rate of
any of the other three LEDs.
We have arbitrarily set the function that relates the frequency to the position of the wiper as
shown in the diagram below. The potentiometer is wired so that if it is set at the lowest posi-
tion, it produces a zero voltage that will be converted to a zero by the Analog to Digital Con-
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...