Sie sind auf Seite 1von 6

PIC Microcontroller

PIC microcontrollers (Programmable Interface Controllers), are electronic circuits that


can be programmed to carry out a vast range of tasks. They can be programmed to be timers
or to control a production line and much more. They are found in most electronic devices such
as alarm systems, computer control systems, phones, in fact almost any electronic device.
Many types of PIC microcontrollers exist, although the best are probably found in the GENIE
range of programmable microcontrollers. These are programmed and simulated by Circuit
Wizard software.
PIC Microcontrollers are relatively cheap and can be bought as pre-built circuits or as kits that
can be assembled by the user.

PIC is a family of modified Harvard architecture microcontrollers made by Microchip


Technology, derived from the PIC1650 originally developed by General Instrument's
Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller'".

PICs are popular with both industrial developers and hobbyists alike due to their low
cost, wide availability, large user base, extensive collection of application notes, availability of
low cost or free development tools, and serial programming (and re-programming with flash
memory) capability.

Over view of 16F877A PIC Microcontroller:

The PIC16F877A CMOS FLASH-based 8-bit microcontroller is upward compatible with


the PIC16C5x, PIC12Cxxx and PIC16C7x devices. It features 200 ns instruction execution,
256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 8 channels of
10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM functions, a synchronous
serial port that can be configured as either 3-wire SPI or 2-wire I2C bus, a USART, and a
Parallel Slave Port.
Features of PIC 16F877A Microcontroller:
8 Bit microcontroller
CMOS FLASH-based microcontroller
High-Performance RISC CPU
Lead-free; RoHS-compliant
Operating speed: 20 MHz, 200 ns instruction cycle.
Operating voltage: 4.0-5.5V
Industrial temperature range (-40 to +85C)
35 single-word instructions
Power on Reset (POR)
Low power- high speed CMOS flash/EEPROM
Low power consumption (<0.6mA typical @3v-4MHz, 20A typical @3v-32MHz and <1
A typical standby)

Special Features of PIC 16F877A Microcontroller:


Flash Memory: 8 KB (14 bit words).
368 Bytes of SRAM
256 Bytes of EEPROM
2 serial communication ports (MSSP, USART).
PSP parallel communication port
Self-reprogrammable under software control
In-Circuit Serial Programming via two pins
Watchdog Timer with on-chip RC oscillator
Programmable code protection
Power-saving Sleep mode
Selectable oscillator options
In-Circuit Debug via two pins
3 types of addressing modes (direct, Indirect, relative addressing modes)

Key Features of PIC 16F877A:


100000 times erase/write cycle enhanced memory.
1000000 times erase/write cycle data EEPROM memory.
Self programmable under software control.
In-circuit serial programming and in-circuit debugging capability.
Single 5V DC supply for circuit serial programming.
Programmable code protection.
Power saving sleep modes.
Selectable oscillator options.

Peripheral Features:
5 I/O ports (Port A, Port B, Port C, Port D and Port E).
33 I/O Pins
15 Interrupt Sources
2 CCP modules
3 Timers (two 8 bit and one 16 bit timers. Timer0 and Timer1 are 8 bit, Timer2 is 16 bit)
Timer0: 8-bit timer/counter with 8-bit prescaler
Timer1: 16-bit timer/counter with prescaler (Can be incremented during Sleep via
external crystal/clock)
Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
Two Capture, Compare, PWM modules (16-bit Capture input; max resolution 12.5 ns,
16-bit Compare; max resolution 200 ns, 10-bit PWM)
Synchronous Serial Port (SSP) with two modes (1. SPI (Master), 2. I2C (Master and
Slave))
USART/SCI with 9-bit address detection
Parallel Slave Port (PSP) 8 bit wide with external RD, WR and CS controls
Brown-out detection circuitry for Brown-Out Reset

Analog Features:
10 Bit, 8 channel inbuilt ADC.
Brown-Out Reset
2 Analog Comparators
Programmable on-chip voltage reference module
Programmable input multiplexing from device inputs and internal VREF
Comparator outputs are externally accessible
Input/output ports:

PIC16F877 has 5 basic input/output ports. They are usually denoted by PORT A (R A),
PORT B (RB), PORT C (RC), PORT D (RD), and PORT E (RE). These ports are used for
input/ output interfacing. In this controller, PORT A is only 6 bits wide (RA-0 to RA-7), PORT
B , PORT C,PORT D are only 8 bits wide (RB-0 to RB-7,RC-0 to RC-7,RD-0 to RD-7),
PORT E has only 3 bit wide (RE-0 to RE-7).

PORT-A RA-0 to RA-5 6 bit wide

PORT-B RB-0 to RB-7 8 bit wide

PORT-C RC-0 to RC-7 8 bit wide

PORT-D RD-0 to RD-7 8 bit wide

PORT-E RE-0 to RE-2 3 bit wide

All these ports are bi-directional. The direction of the port is controlled by using TRIS(X)
registers (TRIS A used to set the direction of PORT-A, TRIS B used to set the direction for
PORT-B, etc.). Setting a TRIS(X) bit 1 will set the corresponding PORT(X) bit as input.
Clearing a TRIS(X) bit 0 will set the corresponding PORT(X) bit as output.

(If we want to set PORT A as an input, just set TRIS(A) bit to logical 1 and want to set PORT B
as an output, just set the PORT B bits to logical 0.)

Analog input port (AN0 TO AN7) : these ports are used for interfacing analog inputs.
TX and RX: These are the USART transmission and reception ports.
SCK: these pins are used for giving synchronous serial clock input.
SCL: these pins act as an output for both SPI and I2C modes.
DT: these are synchronous data terminals.
CK: synchronous clock input.
SD0: SPI data output (SPI Mode).
SD1: SPI Data input (SPI mode).
SDA: data input/output in I2C Mode.
CCP1 and CCP2: these are capture/compare/PWM modules.
OSC1: oscillator input/external clock.
OSC2: oscillator output/clock out.
MCLR: master clear pin (Active low reset).
Vpp: programming voltage input.
THV: High voltage test mode controlling.
Vref (+/-): reference voltage.
SS: Slave select for the synchronous serial port.
T0CK1: clock input to TIMER 0.
T1OSO: Timer 1 oscillator output.
T1OS1: Timer 1 oscillator input.
T1CK1: clock input to Timer 1.
PGD: Serial programming data.
PGC: serial programming clock.
PGM: Low Voltage Programming input.
INT: external interrupt.
RD: Read control for parallel slave port.
CS: Select control for parallel slave.
PSP0 to PSP7: Parallel slave port.
VDD: positive supply for logic and input pins.
VSS: Ground reference for logic and input/output pins.

What do the pins mean?

The pins RB0-RB7, RC0-RC7, and RD0-RD7 are digital I/O pins. The pins CCP1 and
CCP2, which share locations with RC1 and RC2, can be used for a PWM signal. The pins
AN0-AN7 are for analog I/O. TX and RX are for debugging I/O. The remaining pins deal with
power/ground, the clock signal, and programmer I/O.
A PIC is made of several ports. Each port is designated with a letter, RB0-RB7 are a
port. RC0-RC7 and RD0-RD7 are a port as well. RA0-RA5 and RE0-RE2 are also ports, but
with fewer pins. Some of these pins have special purposes, but most can be used as basic
input/output pins.

For example, you can set pin RB0 to be either an input pin, or an output pin. As an input
pin, the digital voltage on the pin can be read in. For example, if RB0 is connected to ground
(0v), then you would read a digital 0. If RB0 was connected to power (5v), then you would read
a digital 1.

On the other hand, if you wanted to set RBO as an output pin, you could choose to
make RB0 either be 5v, or 0v. This can be used, for example, to turn off or on a LED, or to turn
off or on a motor.

Das könnte Ihnen auch gefallen