Page 210 - Embedded Microprocessor Systems Real World Design
P. 210
After the software is completed, the interrupt processing time and overall
throughput are verified. This is done by setting a spare port bit at the start of inter-
rupt processing and resetting the bit when interrupt processing was completed. An
oscilloscope is used to verify the timing. Note that each of the hardware tests
requires special software. In this case, the software is simple, but that will not always
be true. At some point, writing special test software becomes less of an effort than
just plugging in the real software and trying it out.
If an emulator is used for software debug, it can simpllfy hardware debug as well.
Checkout of the pool timer hardware can be accomplished by plugging in the emu-
lator, then verifylng that the correct port bit changes when a key is pressed. The
motor relay can be checked out by manually setting and resetting the correspond-
ing port bit. A UART could be checked by wrapping input to output, programming
the baud rate and other parameters, and checking that characters written to the
transmit register are echoed in the receive register.
Deciding what to test and what software is needed can be part of a compre-
hensive test plan or it can be a list made up by the hardware engineer over lunch
on a simple design. Most designs have no comprehensive list of what specific
hardware will be tested unless software engineering support is required for the
special code.
Software Debug
Keeping with the divide-andconquer strategy of debugging, we look at the process
used to debug the software in the protocol converter described in Chapter 4.
Connect the serial side to a PC. Send a continuous string of characters when
activated by grounding a spare port bit. This verifies that the setup code for
baud rate, parity, and other settings works correctly.
Add code that handles serial I/O.
Add special code that echoes serial input to output. Verify, using the PC
communication program, that echo works correctly for all baud rates and
parity selections.
Add proprietary processing code and verify that the echoed data are correct.
Load special code to send a test string to an output device using the final
output driver.
Finally, integrate the setup code, serial 1/0 code, processing code, and output
code. Verify correct functionality and XON/XOFF operation.
This a somewhat extreme breakdown for a simple task, but the final code worked
the first time. It illustrates the advantage of testing only portions of the code
System Integration and Debug 191