MEMORY

The PIC16F84 has five areas of memory:

1. Program Memory (EEPROM - 1024 bytes), in which are stored the commands that form the program, and where the program of TUTA2 is loaded.

2. Data Memory (SRAM - 68 bytes), in which you can temporarily store the results of any action that the program performs.

3. Data Memory (EEPROM - 64 bytes), in which you can indefinitely store any data that you wish to retain after power has been switched off (it is discussed in Tutorial 33).

4. Special Function Memory (SRAM - 15 bytes), whose attributes determine what actions the PICmicro takes in respect of program commands.

5. Working Memory (SRAM - 1 byte), through which many operations have to pass during program performance (in other processors the Working memory/register may be called the Accumulator).

FILES AND REGISTERS

The results (data) of any program action can be directed to be stored at any of the memory areas numbered 2 to 5 above. With items 2, 3 and 4 the destination is known as a File destination. With item 5, the Working Memory or Register, the destination is known as, not surprisingly, the Working destination.

Strictly speaking, files should be known by their full name of File Registers. It would be tedious, though, to keep using the full name, and so the term file will be used to mean File Register.

For those of you who are familiar with programming in Basic, files can be regarded as the equivalent of variables. There is no direct Basic equivalent of the Working register, although in a sense it can be regarded as a special variable.

The PICmicro program commands reflect the file and working destinations by the use of F and W, respectively, in the command itself. For example, in the command CLRF (to be met later), the F indicates that the value in a particular file (memory data byte) is to be CLeaRed (reset to zero) and the result is to be retained in the file. The file to be cleared is indicated by the number or name which follows CLRF.

On the other hand, in the command MOVLW (MOVe Literal into W - also to be met later), the W stands for Working and it is the Working file which is then affected by the command.

The use of both F and W at the same time in other commands (e.g. MOVWF) will become evident in due course.

Now use the contents tree to navigate to Tutorial 2.3.