In the 1980s an American IC manufacturer called Arizona Microchip Inc. produced simple microcontrollers which they called Peripheral Interface Controllers, or PICs. They had a small following, but their big break came in the early 1990s when they released the 16C5X series. Compared with other microcontrollers at the time, these new devices were astonishingly fast, efficient and easy for engineers to understand and program. Moreover, they were also inexpensive, readily available and obtainable in a wide range of different varieties. PICs are now among the most widely used microcontrollers in the world, with hundreds of millions being sold. Despite their popularity, they have never suffered the severe shortages which have plagued other manufacturers in recent times. In addition, PIC actually stands for several names as shown below:
· Peripheral Interface Controller
· Parallel Interface Controller
· Peripheral Interface Computer
· Parallel Interface Computer
· Peripheral Interface Controller
· Parallel Interface Controller
· Peripheral Interface Computer
· Parallel Interface Computer
2. PIC Microcontroller Basic Elements
As one type of microcontroller, PIC Microcontroller has built-in internal element as being discussed earlier. In addition, some PIC come with Pulse Width Modulation (PWM) module to generate modulate signal. The next chapter will discuss in detail about PWM. In this chapter, PIC Architecture, Instruction Set, clock/instruction cycle and PIC program memory will be explained.
3. PIC Architecture
The architecture of a microcontroller defines the way the internal components are connected. It sets the standard for all devices that connect to it and all the software that runs on it. It specifies how much memory is needed and how it is managed. It specifies register size, bus width and how data is processed. Most microcontrollers use one of two basic architectures, von Neumann or Harvard. Their major characteristics are described below.
· Von Neumann Architecture
Devices using von Neumann architecture have a single area of memory which is used to store instructions as well as data.
· Harvard ArchitectureHarvard architecture devices are divided into two distinct sections. One is used to store instructions (program memory) and the other is used to store data (data memory).
· Von Neumann Architecture
Devices using von Neumann architecture have a single area of memory which is used to store instructions as well as data.
· Harvard ArchitectureHarvard architecture devices are divided into two distinct sections. One is used to store instructions (program memory) and the other is used to store data (data memory).

4. Instruction Set
Similar to spoken language which is divided into a number of recognizable words, the language used by the microcontroller is divided into a number of instructions. The list of instructions which the microcontroller understands is called the instruction set. The instruction set stipulates what functions the microcontroller can perform and how instructions need to be written to activate them. The architectures of microcontrollers may be further classified into the type of instruction sets they use.
· CISC (Complex Instruction Set Computer)
Microcontrollers using CISC systems have a large quantity of very detailed commands.
· RISC (Reduced Instruction Set Computer)
A reduced instruction set is made up of a number of key instructions.
To illustrate the difference between the two systems, the example of a 'divide' command can be used. A CISC system would have a dedicated 'divide' command. A RISC system may not contain the command 'divide', but will contain all the lower level instructions needed to perform a divide operation. The comparisons for the commands used to perform a divide operation between CISC and RISC are shown in the table below.
· CISC (Complex Instruction Set Computer)
Microcontrollers using CISC systems have a large quantity of very detailed commands.
· RISC (Reduced Instruction Set Computer)
A reduced instruction set is made up of a number of key instructions.
To illustrate the difference between the two systems, the example of a 'divide' command can be used. A CISC system would have a dedicated 'divide' command. A RISC system may not contain the command 'divide', but will contain all the lower level instructions needed to perform a divide operation. The comparisons for the commands used to perform a divide operation between CISC and RISC are shown in the table below.
RISC computer architecture has reduced chip complexity by using simpler instructions which are also of more constant size. The RISC chip is faster than its CISC counterpart, and is designed and built more economically.5. Clock / instruction cycle
Clock is microcontroller's main starter, and is obtained from an external component called an "oscillator". Clock from the oscillator enters a microcontroller via OSC1 pin where internal circuit of a microcontroller divides the clock into four even clocks Q1, Q2, Q3, and Q4 which do not overlap. These four clocks make up one instruction cycle (also called machine cycle) during which one instruction is executed.
Execution of instruction starts by calling an instruction that is next in string. Instruction is called from program memory on every Q1 and is written in instruction register on Q4. Decoding and execution of instruction are done between the next Q1 and Q4 cycles. The following diagram shows the relationship between instruction cycle and clock of the oscillator (OSC1) as well as that of internal clocks Q1-Q4. Program counter (PC) holds information about the address of the next instruction.
Execution of instruction starts by calling an instruction that is next in string. Instruction is called from program memory on every Q1 and is written in instruction register on Q4. Decoding and execution of instruction are done between the next Q1 and Q4 cycles. The following diagram shows the relationship between instruction cycle and clock of the oscillator (OSC1) as well as that of internal clocks Q1-Q4. Program counter (PC) holds information about the address of the next instruction.

6. Program Memory
The hex file created by the assembler is programmed into the program memory of the PIC. The program memory will be one of several different types. These type RAM, ROM, EPROM, OTP EPROM, EEPROM and FLASH MEMORY.
7. Pulse Width Modulation (PWM)
The function for Pulse Width Modulation (PWM) is to control switching condition by producing sequence of quadrangle pulse as shown in the figure below.

PWM have three basic elements as shown in the figure below.
· Oscillator = to generate triangle wave.
· Gated Latch = to execute modulation to produce sequence of quadrangle pulse. Beside that, its has function as voltage comparator – comparing oscillator output voltage, Vosc with capacitor output voltage , Verror to produced sequence of quadrangle pulse, V1.
Capacitor = to stop any voltage changes for smoothing output voltage, Vo.
· Oscillator = to generate triangle wave.
· Gated Latch = to execute modulation to produce sequence of quadrangle pulse. Beside that, its has function as voltage comparator – comparing oscillator output voltage, Vosc with capacitor output voltage , Verror to produced sequence of quadrangle pulse, V1.
Capacitor = to stop any voltage changes for smoothing output voltage, Vo.

No comments:
Post a Comment