Pic microcontroller [autosaved] [autosaved]

27
PIC MICROCONTROLLER Features & Applications

description

 

Transcript of Pic microcontroller [autosaved] [autosaved]

Page 1: Pic microcontroller [autosaved] [autosaved]

PIC MICROCONTROLLER Features & Applications

Page 2: Pic microcontroller [autosaved] [autosaved]

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

Page 3: Pic microcontroller [autosaved] [autosaved]

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

Page 4: Pic microcontroller [autosaved] [autosaved]

Types of Microcontrollers

Page 5: Pic microcontroller [autosaved] [autosaved]

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.

Page 6: Pic microcontroller [autosaved] [autosaved]

PIN DESCRIPTION

Page 7: Pic microcontroller [autosaved] [autosaved]

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.

Page 8: Pic microcontroller [autosaved] [autosaved]

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.

Page 9: Pic microcontroller [autosaved] [autosaved]

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

The data memory is divided into 4 memory banks

Page 10: Pic microcontroller [autosaved] [autosaved]

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.

Page 11: Pic microcontroller [autosaved] [autosaved]

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

Page 12: Pic microcontroller [autosaved] [autosaved]

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.

Page 13: Pic microcontroller [autosaved] [autosaved]

REGISTER ASSOCIATED WITH TIMER0 OPTION_REG Register

Page 14: Pic microcontroller [autosaved] [autosaved]

REGISTER ASSOCIATED WITH TIMER1T1CON:Timer1 Control Register

Page 15: Pic microcontroller [autosaved] [autosaved]

REGISTER ASSOCIATED WITH TIMER1T1CON:Timer1 Control Register

Page 16: Pic microcontroller [autosaved] [autosaved]

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.

Page 17: Pic microcontroller [autosaved] [autosaved]

BLOCK DIAGRAM AND OUTPUT WAVEFORM OF PWM

Page 18: Pic microcontroller [autosaved] [autosaved]

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

Page 19: Pic microcontroller [autosaved] [autosaved]

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)

Page 20: Pic microcontroller [autosaved] [autosaved]

PIC Peripherals: USART And SSP Serial Communication

Page 21: Pic microcontroller [autosaved] [autosaved]

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.

Page 22: Pic microcontroller [autosaved] [autosaved]

INTERFACING TO PC

Page 23: Pic microcontroller [autosaved] [autosaved]

SSP SERIAL COMMUNICATION

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

Page 24: Pic microcontroller [autosaved] [autosaved]

SPI COMMUNICATION

Page 25: Pic microcontroller [autosaved] [autosaved]

APPLICATIONSINTERFACING OF LCD WITH PIC16F73

PIC16F73

PORTPINS

Page 26: Pic microcontroller [autosaved] [autosaved]

INTERFACING OF SEVEN SEGMENT DISPLAY WITH PIC16F73

PIC16F73

PIC16F73

Page 27: Pic microcontroller [autosaved] [autosaved]

Thank You For Your Attendance