Pic microcontroller [autosaved] [autosaved]

Post on 29-Nov-2014

2.640 views 6 download

description

 

Transcript of Pic microcontroller [autosaved] [autosaved]

PIC MICROCONTROLLER Features & Applications

WHAT IS A MICROCONTROLLER

• A smaller computer• On-chip RAM, ROM, I/O ports... • Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8

and PIC 16X

RAM ROM

I/OPort Timer

Serial COMPort

CPU A single chip Microcontroller

HOW IT IS DIFFERENT FROM A MICROPROCESSOR

General-purpose microprocessor• CPU for Computers• No RAM, ROM, I/O on CPU chip itself• Example: Intel’s x86, Motorola’s 680x0

CPU

General-Purpose Micro-processor

RAM ROM I/O Port

TimerSerial COM Port

Data Bus

Address Bus

Types of Microcontrollers

IMPORTANT FEATURES OF PIC 16F73

• High performance RISC CPU.• There is Only 35 single word instructions.• 4K Bytes Flash Program Memory.• 192 Bytes RAM.• Three I/O ports – PORT A = 6 Bit. PORT B & C = 8 Bit.• on-chip RC Oscillator.

PIN DESCRIPTION

PIC MEMORY

• The PIC 16F73 has 4 kbytes of program memory.

• 192 Bytes Registers as Data Memory : Special Function Registers: used to control

peripherals and PIC behaviors. General Purpose Registers: used for temporary

storage of data.

PIC PROGRAM MEMORYTakes a max of 8 addresses, the ninth address will write over the first.

When the controller is reset, program execution starts from here.

If interrupted, program execution continues from here.

PIC DATA MEMORYThe most important registers have addresses in all the four banks

The data memory is divided into 4 memory banks

PERIPHERAL FEATURES OF PIC

• Three timers –Timer0: 8-bit timer Timer1: 16-bit timer Timer2: 8-bit timer • Two PWM modules• 8-bit, 5-channel Analog-to-Digital converter.• USART And SSP Serial Communication.• Brown-out detection circuitry with Watchdog

timer.

PIC Peripherals: Timers

The PIC16F73 has 3 TimersThey can be used as- TIMER: When The clock source is the internal crystal

frequency of the PIC. COUNTER: When an external pulse is given from the

input pin. For timer0 input pin is pin number 6 i.e TOCKI For timer1 input pin is pin number 11 i.e T1CKI

Special features of timers

Only timer0 and timer1 can be used as a Timer and Counter. Timer2 is related with PWM wave generation.

Every timer is associated with pre-scaler factor. Generate interrupts on timer overflow.There is a Watchdog Timer with brown out

detection circuit.

REGISTER ASSOCIATED WITH TIMER0 OPTION_REG Register

REGISTER ASSOCIATED WITH TIMER1T1CON:Timer1 Control Register

REGISTER ASSOCIATED WITH TIMER1T1CON:Timer1 Control Register

PIC Peripherals: PWM

PWM stands for pulse width modulation. It is generally used to slow down the speed of motors by varying the duty cycle of the period.DUTY CYCLE is given by- Ton time / T total time The ratio between ON and OFF

state of the pulse determines the amount of energy tranferred to the device.

BLOCK DIAGRAM AND OUTPUT WAVEFORM OF PWM

PIC Peripherals: ADC

• ADC stands for analog to digital comparator.• In PIC16F73 there is 8 bit , 5 channels ADC.Therefore there are 256 combinations• For conversion of analog voltage to digital first

we have to make a least count matching between the two devices.

Least Count=Vref. /resolution

BLOCK DIAGRAM OF ANALOG TO DIGITAL CONVERTER

The A/D module has four registers. These registers are:A/D Result Register (ADRES)A/D Control Register0 (ADCON0)A/D Control Register1 (ADCON1)

PIC Peripherals: USART And SSP Serial Communication

USART REGISTERS

USART stands for synchronous asynchronous serial receiver and transmitter

IT DEALS WITH TWO REGISTERS:TXSTA : Transmit status and control register.RXSTA : Receive status and control register.In synchronous communication we have to give the same clock

to both the transmitter and receiver whereas In asynchronous communication we have to make the baud

rate( data transfer rate ) of both the transmitter and receiver same.

INTERFACING TO PC

SSP SERIAL COMMUNICATION

SSP stands for synchronous serial peripherals.InPIC16F73 there are 2 SSP’s-I2C AND SPII2C COMMUNICATION

SPI COMMUNICATION

APPLICATIONSINTERFACING OF LCD WITH PIC16F73

PIC16F73

PORTPINS

INTERFACING OF SEVEN SEGMENT DISPLAY WITH PIC16F73

PIC16F73

PIC16F73

Thank You For Your Attendance