|
III.5 The BLINK Program
When BOOT-51 is customized and blown into an EPROM, and the
target board is connected to the host PC, it would be nice to verify,
whether the whole configuration is working together correctly.
This can be done with a short test program that performs a well-defined
action when started. For this purpose the tiny assembly program
blink.a51 has been provided.
It simply toggles the logic level of a port pin (roughly) once a second
(great if connected to a LED) to verify, whether all the components in
the chain
assembly --» serial interface
--» target system
«--» bootstrap program
are working together correctly.
It can be adapted to your requirements with little efforts:
- If your target system carries a LED that can be switched with a
bit-addressable port pin, please change the BIT symbol LEDPIN
accordingly. Then the program will make the LED blink.
If your LED can only be switched with a non-bit-addressable
port pin (say bit 2 of a port P6), simply replace the
statement
CPL LEDPIN
by
XRL P6,#00000100B
or something like that.
- Change the program start address START to the location, where
user programs are usually loaded on your target system.
The program code itself is position-independent!
If there is no LED on your target system, connect the port pin to
a volt-meter. This may also do. Aside of P0 and P2 you
may use every port with LEDs or spare outputs. Now the command
boot blink
should reset the MCS-51 board, assemble the test program,
upload it to the target system, and finally start it.
If the LED is blinking, everything is now perfectly installed and ready
for daily work. If not, you should read the next chapter!
|