South Manchester Radio Club 010101 PIC Tutorial 1010101 |
...... |
Before we can start we need to know a little about the structure of a "PIC" chip. All "16F" series chips have the same basic structure, a simplified view of which we can see below:- The key components are as follows:-
This is used to store the PIC program. That is the instructions which control how the PIC works. The amount of memory varies from type to type. The 16F877 on the 44-pin demo board has 14K of program memory.
This keeps a track of where code is running from. "Counts" each instruction as it is executed (carried out) by the PIC.
Used to hold the current instruction as pointed to by the program counter.
This is used as temporary storage for the program counter while a subroutine is active.
Is the heart of the PIC chip. It decodes the Instruction stored in the Instructions Register and sends signals to the other components to perform the required functions. When the current instruction has completed the ALU increments the Program Counter. The next instruction is then read from the program memory into Instruction Register to be decoded.
This is used as temporary store by some instructions.
These are the chips interfaces to the outside world. Because there are not enough pins some of these need to be configured before they can be used.
RAM is used to contain variable or working data needed to run the program. Its contents are lost when the PIC is turned off.
EEPROM is used to store information that can be changed by the program but needs to be remembered when the power is removed from the chip. Typically it is used to store settings that need to be remembered. Quick Quiz1. How much program memory does the 16F877 have ? 2. RAM is used to:- 3. EEPROM is used to:- |
South Manchester Radio & Computer Club PIC Tutorial If you need support and help visit the SMRCC PIC Support Group on Yahoo For more information about SMRCC visit the main web site or e-mail "chairman <at> smrcc.org.uk"
|