Object Interaction Diagrams
A building architect does not show a closeup of every footing and every joint in the building. Instead she shows the overall floorplan and appearance, and one of each kind of footing, joint, or railing.
A key to good design is to focus on the overview and on significant detail.
Whatever the embedded system does, it is best to start design work with its drive train. This is the object interaction path that produces the primary motivated activity of the system. It may also be necessary to produce separate interaction diagrams for initialization, shutdown, and for individual use cases.

The above diagram shows the drive train in steady state operation. The numbering is the sequence in which things happen. It is useful to explain the diagram by listing the message number and describing what is going on.
|
Number |
Message |
Activity |
|
1. |
DMAIn() |
The DMA has completed a buffer of input from the codec input serial port. It stops whatever the processor is doing, and calls this input interrupt routine. |
|
2. |
PutBuf() |
DMAIn() calls PutBuf() to notify the Buffer Manager that the buffer it has been filling is ready for whomever wishes to see it. |
|
3. |
AllocBuf() |
Then DMAIn() calls this buffer manager routine to obtain a pointer to a new buffer to receive DMA incoming data. It sets up the input DMA channel to begin receiving data into this new buffer. |
|
4. |
main() |
There is a loop in the main program which calls the Process() method of the Procman object. |
|
5. |
Process() |
If Process() has finished with the last buffer, it starts checking for the availability of a new buffer by calling Buffer Manager's ReceiveBuf() routine. |
|
6. |
ReceiveBuf() |
ReceiveBuf checks for an available buffer in its process list. If there is one, it returns its address to Process(). If not, it returns NULL to Process(). |
|
7. |
Calc() |
Once it has a buffer, Process() calls the voice substitution device's Calc() routine, which performs all of the computation for voice and pitch detection, as well as placing the synthesized voice into the buffer for output. (See the calculation detail diagram for more information) |
|
8. |
OutputBuf() |
When it has finished the voice substitution calculation, the Process() routine calls the Buffer Manager's OutputBuf() routine with the modified buffer. This routine queues the indicated buffer for output the next time the output DMA requests a buffer. |
|
9. |
DMAOut() |
When the output DMA channel finishes the latest output buffer passed to it, it interrupts whatever else is happening and calls this output channel interrupt routine. |
|
10. |
FreeBuf() |
DMAOut() calls the buffer manager's FreeBuf() routine to make the old buffer available to the next input interrupt routine. |
|
11. |
GetBuf() |
Next DMAOut() calls the buffer manager's GetBuf() routine to get a pointer to the next output buffer to be sent. It sets up the DMA to use this buffer to feed the output serial port. |