South Manchester Radio Club

010101 PIC Tutorial 1010101

     

  Index
Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Back to Projects

 

                                               

 

 

 

 

 

 

 

 

......

 

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:-

  • Program Memory

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.

  • Program Counter (PC)

This keeps a track of where code is running from. "Counts" each instruction as it is executed (carried out) by the PIC.

  • Instruction Register

Used to hold the current instruction as pointed to by the program counter.

  • Stack

This is used as temporary storage for the program counter while a subroutine is active.

  • Instruction Decode and Arithmetic Logic Unit (ALU)

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.

  • The Working (W) register

This  is used as temporary store by some instructions.

  • Digital Ports, Analogue Ports, Serial Ports, Comparators

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 (Random Access Memory)

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 (Electrically Erasable Programmable Read Only Memory)

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 Quiz

1. How much program memory does the 16F877 have ?

14 Bytes

14K Bytes

14 GigaBytes

2. RAM is used to:-

Store working data for use by the program

Store the Program Instructions

Store parameters that need to be remembered while power is removed

3. EEPROM is used to:-

Store data for use by the program

Store the Program Instructions

Store parameters that need to be remembered while power is removed

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"