PROGRAMMING STAGES

Five stages are involved in creating a program that will successfully run on a PICmicro:

* Write the instructions as a text file, using commands that have been allocated by the PICmicro manufacturers to represent specific actions that the PICmicro will ultimately take. It is these commands and their order of use that we principally discuss in these tutorials. The text file created is variously known as the Source Code or Assembler Code and which has a .ASM extension added to its file name.

* The completed assembler code then has to be translated by an Assembly program into numerical values that are the actual codes (also known as the Machine Code) which are to be loaded into the PICmicro as its program 'commands'. They are stored as hexadecimal values in a file having the same basic file name but having a .HEX extension. (Note that other proprietary assemblers and downloading programs may create or require different file name extensions.)

* The assembled Hex file is downloaded (sent) to the PICmicro on the development (or other dedicated hardware) printed circuit board, using a separate Send or Load program. This automatically places the hexadecimal code commands as binary values into the program memory area of the PICmicro, doing so according to minimum timing protocols dictated by the PICmicro manufacturer and set within the Send program. The commands are usually placed in consecutive order, although it is possible to place blocks of code at other memory locations. Such matters are only of significance to more advanced software designers.

* The PICmicro is now ready to run the program that has been sent to it. You, the programmer, now examine the results of what your program is actually doing and assess whether or not it is doing what you intended. The testing can be done in variety of ways, depending on the application that you are trying to create. On the development board supplied with this CD ROM, test monitoring is variously done via individual LEDs, a 7-segment LED module, an "intelligent" alphanumeric LCD module, and an audio output facility for which you provide your own high-impedance personal headphones.

* If the program does not perform as you expected - you may have given the wrong instruction(s) somewhere within your source code text - you return to the text editor, make the necessary corrections, and then repeat the assembly, send and test routines.