[Menu]>[Guide to use the PIC]


Software making procedure

Flow chart

It is an old technique but to make software using the flow chart is simple. The flow of the processing can be made clear. When the step of the software increases, there is possibility to get not to understand the whole.
More than two kinds of flow charts are sometimes made.

General flow chart

General flow chart is used to decide the build of the software with the whole functional block shown.

Detaile flow chart

Detaile flow chart is the flow chart which was written to each instruction level.
It is written in the details to the level that it is possible to make a source code.
It is possible to be freely created the processing flow of the software. As for the software to make PIC work for the purpose, the various ways are thought of. It depends on the sense of the making person. The author sometimes forgets the meaning of the processing step when the time passes. When writing the point of the processing at the flow chart, it is useful when reorganizing from behind.

The point to consider in case of software making is shown below.
Think of the processing step
This is the main part of the software making.
Decide labels in the processing block

Attache a label to the part which is jumped from the other processing. There are character strings which are defined as the reserved word by the assembler. They can not be used as the label.
Decide the purpose and the labels of the register files

68 bytes can be used as the register file. Decide the structure and the labels of the register files to use.



Construction of the software
    You make software with the following structure.
(1) The definition part of the hardware

Specifie the kind of PIC to use. It is changed based on this specification when changing the source code into the machine code.
LIST of the assembler direction is used.
The directions are not the instructions to use in actual PIC. They are the direction which is used to specify the processing of an assembler.


(2) The definition part of the register files

In case of PIC16F84A, the file register of 68 bytes can be used. When attaching a label to each register, the understanding of processing becomes easy. When changing a register in the arrangement, it is OK if changing the definition of the label. It makes a label and an actual address correspond. EQU of the assembler direction is used.


(3) The initialization processing part

From this part, the processing to do actually in PIC is written. The initialization processing is the processing to do first when PIC works. It sets the environment of the processing which is done after that such as the setting of an input/output port, the initialization of the STATUS register, the initialization of the register file contents so on.
When specifying the address which stores a program in the memory, ORG is used as the direction.


(4) The main processing part

Write the processing to have operation for the purpose.
It is sometimes divided into the main part and the subroutine part in the construction of the program.
In the case as it uses the same processing repeatedly, it makes common processing as the subroutine. Generally, it writes a subroutine group behind the main part but even if it is opposite, there is no problem.


(6) The source ending

The ending of the source code is written.
END of the assembler direction is used.