27.3.2 Bus capture information and FIFO operationThe usual way to use the FIFO is to setup the trigger mode and other control options, thenarm the debugger. When the FIFO has filled or the debugger has stopped storing data intothe FIFO, you would read the information out of it in the order it was stored into theFIFO. Status bits indicate the number of words of valid information that are in the FIFOas data is stored into it. If a trace run is manually halted by writing 0 to ARM before theFIFO is full (CNT = 1:0:0:0), the information is shifted by one position and the host mustperform ((8 - CNT) - 1) dummy reads of the FIFO to advance it to the first significantentry in the FIFO.In most trigger modes, the information stored in the FIFO consists of 16-bit change-of-flow addresses. In these cases, read DBGFH then DBGFL to get one coherent word ofinformation out of the FIFO. Reading DBGFL (the low-order byte of the FIFO data port)causes the FIFO to shift so the next word of information is available at the FIFO dataport. In the event-only trigger modes (see Trigger modes), 8-bit data information is storedinto the FIFO. In these cases, the high-order half of the FIFO (DBGFH) is not used anddata is read out of the FIFO by simply reading DBGFL. Each time DBGFL is read, theFIFO is shifted so the next data value is available through the FIFO data port at DBGFL.In trigger modes where the FIFO is storing change-of-flow addresses, there is a delaybetween CPU addresses and the input side of the FIFO. Because of this delay, if thetrigger event itself is a change-of-flow address or a change-of-flow address appearsduring the next two bus cycles after a trigger event starts the FIFO, it will not be savedinto the FIFO. In the case of an end-trace, if the trigger event is a change-of-flow, it willbe saved as the last change-of-flow entry for that debug run.The FIFO can also be used to generate a profile of executed instruction addresses whenthe debugger is not armed. When ARM = 0, reading DBGFL causes the address of themost-recently fetched opcode to be saved in the FIFO. To use the profiling feature, a hostdebugger would read addresses out of the FIFO by reading DBGFH then DBGFL atregular periodic intervals. The first eight values would be discarded because theycorrespond to the eight DBGFL reads needed to initially fill the FIFO. Additionalperiodic reads of DBGFH and DBGFL return delayed information about executedinstructions so the host debugger can develop a profile of executed instruction addresses.Chapter 27 Development supportMC9S08SU16 Reference Manual, Rev. 5, 4/2017NXP Semiconductors 539