Sunday 17 February 2013

S'2 WEEK 3 => 28 JAN - 3 FEB




The original PIC was built to be used with General Instruments' new 16-bit CPU, the CP1600. While generally a good CPU, the CP1600 had poor I/O performance, and the 8-bit PIC was developed in 1975 to improve performance of the overall system by offloading I/O tasks from the CPU. The PIC used simple microcode stored in ROM to perform its tasks, and although the term was not used at the time, it shares some common features with RISC designs.

In 1985, General Instruments spun off their microelectronics division and the new ownership cancelled almost everything — which by this time was mostly out of-date. The PIC, however, was upgraded with internal EPROM to produce a programmable channel controller and today a huge variety of PICs are available with various on-board peripherals (serial communication modules, UARTs, motor control kernels, etc.) and program memory from 256 words to 64k words and more (a "word" is one assembly language instruction, varying from 12, 14 or 16 bits depending on the specific PIC micro family).
PIC and PIC micro are registered trademarks of Microchip Technology. It is generally thought that PIC stands for Peripheral Interface Controller, although
General Instruments' original acronym for the initial PIC1640 and PIC1650 devices was "Programmable Interface Controller". The acronym was quickly replaced with “Programmable Intelligent Computer".


The PIC architecture is characterized by its multiple attributes:
ü  Separate code and data spaces (Harvard architecture) for devices other than
PIC32, which has Von Neumann architecture.
ü  A small number of fixed length instructions.
ü  Most instructions are single cycle execution (2 clock cycles, or 4 clock cycles in
8-bit models), with one delay cycle on branches and skips.
ü  All RAM locations function as registers as both source and/or destination of math.
ü  A hardware stack for storing return addresses.
ü  A fairly small amount of addressable data space (typically 256 bytes), extended through banking.
ü  Data space mapped CPU, port, and peripheral registers.
ü  The program counter is also mapped into the data space and writable (this is used to implement indirect jumps).










Microcontrollers

Microcontrollers must contain at least two primary components – random access memory (RAM), and an instruction set. RAM is a type of internal logic unit that stores information temporarily. RAM contents disappear when the power is turned off. While RAM is used to hold any kind of data, some RAM is specialized, referred to as registers. The instruction set is a list of all commands and their corresponding functions. During operation, the microcontroller will step through a program. Each valid instruction set and the matching internal hardware that differentiate one microcontroller from another.
Most microcontrollers also contain read-only memory (ROM), programmable read-only memory (PROM), or erasable programmable read-only memory (EPROM). Al1 of these memories are permanent: they retain what is programmed into them even during loss of power. They are used to store the firmware that tells the microcontroller how to operate. They are also used to store permanent lookup tables. Often these memories do not reside in the microcontroller; instead, they are contained in external ICs, and the instructions are fetched as the microcontroller runs. This enables quick and low-cost updates to the firmware by replacing the ROM.
The input/output (I/O) port pins is the way of communicating with the outside world. The number of I/O pins per controllers varies greatly, plus each I/O pin can be programmed as an input or output (or even switch during the running of a program). The load (current draw) that each pin can drive is usually low. If the output is expected to be a heavy load, then it is essential to use a driver chip or transistor buffer.
Most microcontrollers contain circuitry to generate the system clock. This square wave is the heartbeat of the microcontroller and all operations are synchronized to it. Obviously, it controls the speed at which the microcontroller functions. All that needed to complete the clock circuit would be the crystal or RC components. We can, therefore precisely select the operating speed critical to many applications.



To summarize, a microcontroller contains (in one chip) two or more of the following elements in order of importance:
i. Instruction set
ii. RAM
iii. ROM,PROM or EPROM
iv. I/O ports
v. Clock generator
vi. Reset function
vii. Watchdog timer
viii. Serial port
ix. Interrupts
x. Timers
xi. Analog-to-digital converters
xii. Digital-to-analog converters
















     Microcontroller PIC 16F877A

The microcontroller chip that has been selected for the purpose of controlling the Multi sensor blind stick and the speed of DC motor is PIC16F877A manufactured by Microchip. This chip is selected based on several reasons:
I. Its size is small and equipped with sufficient output ports without having to use a decoder or multiplexer.
ii. Its portability and low current consumption.
iii. It has PWM inside the chip itself which allow us to vary the duty cycle of DC motor drive.
iv. It is a very simple but powerful microcontroller. Users would only need to learn 35 single word instructions in order to program the chip.
v. It can be programmed and reprogrammed easily (up to 10,000,000 cycles) using the universal programmer in robotics lab.


0 comments:

Post a Comment