Debugging the Software

This chapter looks at selected log entries that are made while debugging the code. A brief explanation of how the programmer code works allows all this to make sense. The chapter shows the major routines used by the programmer software. The bar at the top is the background (or polling) loop. It consistsof three functions: Rx FIFO check looks for data in the receive FIFO, pushbutton check looks for and debounces the pushbutton, and device mode check does nothing if the programmer is not programming, blank checking, or verifying a PROM. The chapter discusses why the Tx process routine for transmitting data to the host was removed from original background loop. Various support routines are provided as well. The message output code, called from many locations, is called with a pointer to the message to be sent and just stuffs data into the transmit FIFO until an end-of-message is detected.The device table support routines return various parameters, such as the device size, blank value, programming pulse width, and program/ read voltages. The tables are indexed with the current device type. Testing modules is most effective on a simulator or using a debugger on the target. It is usually just too tedious to do this testing without some means of starting and stopping the program at will and looking at the results directly. This rules out action code outputs and memory dumps for most cases.