EasyManua.ls Logo

ST ST7 - Conclusion

ST ST7
317 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
314/317
10 - Second Application: a Sailing Computer
which both forces the linker to put any variables declared after this line into the _ZEROPAGE
segment. It also specifies that all accesses to the corresponding variables must be done using
direct short addressing. The fact that a variable is in the
_ZEROPAGE section does not imply that
short addressing must be used, so it is necessary to specify
SHORT as well.
This fine tuning can be done by studying the resulting map file, then calculating the free room
in the
_ZEROPAGE segment, then moving those variables that are both freqently used and have
a total size that fits the available space.
10.7 CONCLUSION
This application demonstrates a system where two contradictory needs are combined to-
gether:
Data collection and display refresh that have real-time requirements.
Data processing that requires a lot of computing power, but with no particular requirement
regarding speed.
Each of these requirements could be satisfied by means of a proper balance between the in-
terrupts and the main program. The interrupt service functions have been designed so that
they had as little computation as possible to perform, just moving data between memory and
peripherals. The main program then retrieves the data from memory, processes it, and puts
the results in yet another memory storage, so that it can be displayed or sent through the serial
line. The correct functioning relies on appropriate handshaking (for the serial transmission)
and the enforcement of the rules on atomicity (for data transfer from the sensors to the calcu-
lation block).
Although the ST7 is a medium-range 8-bit product, it benefits from the full use of the C lan-
guage, that allowed us to write both the byte-level actions and the floating-point calculations
with the same ease. The only points where building a microcontroller application is trickier
than a PC-based application are the peripheral initializations (for there is no DOS to take it
over) and the memory mapping with the associated compiling options that require some
thought and some trial and error before actually working on the emulator and then on the pro-
totype.

Table of Contents

Related product manuals