Interfacing I
Agenda
• ‘PIC16F877A’ Overview
• ‘PIC16F877A’ Pins & Ports
• Minimum Hardware
• Input & Output Devices
• Project 1 “Flasher-1”
• Project 2 “Flasher-2”
• Pull-Up & Pull-Down Resistor
• Project 3 “Button-1”
• Project 4 “High-Volt”
‘PIC16F877A Overview
• Operating Speed : 20 MHz clock input
• 3 Timers ( 1 * 16 bit --- 2 * 8 bit)
• 2 CCP Modules
• 8- channel , 10-Bit Analog to digital Converter (ADC)
• Synchronous Serial Port ( SPI & I2C)
• Universal Synchronous Asynchronous
Receiver/Transmitter (USART)
• 100,000 Erase/Write cycle Enhanced Flash
• 1000,000 Erase/Write cycle EEPROM
• In-Circuit Serial Programmer (ICSP)
‘PIC16F877A’ Pins & Ports
‘PIC16F877A Ports : PORTA
• RA0 , RA1 : Digital I/O , Analog input
• RA2 : Digital I/O , Analog input , ADC Ref- , Comparator Ref
• RA3 : Digital I/O , Analog input , ADC Ref+
• RA4 : Digital I/O , Comparator 1 output
• RA5 : Digital I/O , Analog input , SPI salve select , Comparator 2 output
PORTA : is a 6-Bit Bidirectional port
‘PIC16F877A Ports : PORTB
• RB0 : Digital I/O , External Interrupt
• RB1 : Digital I/O
• RB2 : Digital I/O
• RB3 : Digital I/O , Low voltage ICSP programming enable pin
• RB4 : Digital I/O
• RB5 : Digital I/O
• RB6 : Digital I/O , In circuit Debugger & ICSP Programming Clock
• RB7 : Digital I/O , In circuit Debugger & ICSP Programming Data
PORTB : is an 8-Bit Bidirectional port , with software weak PULL-UP
‘PIC16F877A Ports : PORTC
• RC0 : Digital I/O , TMR1 Oscillator output , TMR1 external clock input
• RC1 : Digital I/O , TMR1 Oscillator input , Capture2 input , compare2 , PWM2
• RC2 : Digital I/O , Capture 1 input , Comparator 1 output , PWM 1 output
• RC3 : Digital I/O , SPI clock , I2C clock
• RC4 : Digital I/O , SPI data in , I2C data I/O
• RC5 : Digital I/O , SPI data out
• RC6 : Digital I/O , UART transmitter , USART clock
• RC7 : Digital I/O , UART receiver , USART Data
PORTC : is an 8-Bit Bidirectional port
‘PIC16F877A Ports : PORTD
• RD0 : Digital I/O , Parallel Slave port bit 0
• RD1 : Digital I/O , Parallel Slave port bit 1
• RD2 : Digital I/O , Parallel Slave port bit 2
• RD3 : Digital I/O , Parallel Slave port bit 3
• RD4 : Digital I/O , Parallel Slave port bit 4
• RD5 : Digital I/O , Parallel Slave port bit 5
• RD6 : Digital I/O , Parallel Slave port bit 6
• RD7 : Digital I/O , Parallel Slave port bit 7
PORTD : is an 8-Bit Bidirectional port
‘PIC16F877A Ports : PORTE
• RE0 : Digital I/O , Analog input , Read control for parallel slave
• RE1 : Digital I/O , Analog input , Write control for parallel slave
• RE2 : Digital I/O , Analog input , chip select control for parallel slave
PORTE : is a 3-Bit Bidirectional port
Minimum Hardware
Input & Output Devices
Output Devices :
- LEDs
- Buzzer
- 7-Segment
- LCDs
Input Devices :
- Buttons & Switches
- Sensors
Project-1 “Flasher-1”
Make project where a LED is connected to RB0 , This LED is on for
half Second and off for another half second .
Project-2 “Flasher-1”
Make project where an 8 LED is connected To PORTB , half LED is on
for 0.5s and the other is off and After 0.5s the LED is complemented
Pull-Up & Pull-Down Resistor
Project-3 “Button-1”
LED is connected to RB0 and button to RD0 When the button is pressed the
LED complement Its Status
Project-4 “High-Volt”
220-Lamp is connected to RB0 and button to RD0 When the button is pressed
the Lamp is on for 1s then off.
Q & A

Intrerfacing i

  • 1.
  • 2.
    Agenda • ‘PIC16F877A’ Overview •‘PIC16F877A’ Pins & Ports • Minimum Hardware • Input & Output Devices • Project 1 “Flasher-1” • Project 2 “Flasher-2” • Pull-Up & Pull-Down Resistor • Project 3 “Button-1” • Project 4 “High-Volt”
  • 3.
    ‘PIC16F877A Overview • OperatingSpeed : 20 MHz clock input • 3 Timers ( 1 * 16 bit --- 2 * 8 bit) • 2 CCP Modules • 8- channel , 10-Bit Analog to digital Converter (ADC) • Synchronous Serial Port ( SPI & I2C) • Universal Synchronous Asynchronous Receiver/Transmitter (USART) • 100,000 Erase/Write cycle Enhanced Flash • 1000,000 Erase/Write cycle EEPROM • In-Circuit Serial Programmer (ICSP)
  • 4.
  • 5.
    ‘PIC16F877A Ports :PORTA • RA0 , RA1 : Digital I/O , Analog input • RA2 : Digital I/O , Analog input , ADC Ref- , Comparator Ref • RA3 : Digital I/O , Analog input , ADC Ref+ • RA4 : Digital I/O , Comparator 1 output • RA5 : Digital I/O , Analog input , SPI salve select , Comparator 2 output PORTA : is a 6-Bit Bidirectional port
  • 6.
    ‘PIC16F877A Ports :PORTB • RB0 : Digital I/O , External Interrupt • RB1 : Digital I/O • RB2 : Digital I/O • RB3 : Digital I/O , Low voltage ICSP programming enable pin • RB4 : Digital I/O • RB5 : Digital I/O • RB6 : Digital I/O , In circuit Debugger & ICSP Programming Clock • RB7 : Digital I/O , In circuit Debugger & ICSP Programming Data PORTB : is an 8-Bit Bidirectional port , with software weak PULL-UP
  • 7.
    ‘PIC16F877A Ports :PORTC • RC0 : Digital I/O , TMR1 Oscillator output , TMR1 external clock input • RC1 : Digital I/O , TMR1 Oscillator input , Capture2 input , compare2 , PWM2 • RC2 : Digital I/O , Capture 1 input , Comparator 1 output , PWM 1 output • RC3 : Digital I/O , SPI clock , I2C clock • RC4 : Digital I/O , SPI data in , I2C data I/O • RC5 : Digital I/O , SPI data out • RC6 : Digital I/O , UART transmitter , USART clock • RC7 : Digital I/O , UART receiver , USART Data PORTC : is an 8-Bit Bidirectional port
  • 8.
    ‘PIC16F877A Ports :PORTD • RD0 : Digital I/O , Parallel Slave port bit 0 • RD1 : Digital I/O , Parallel Slave port bit 1 • RD2 : Digital I/O , Parallel Slave port bit 2 • RD3 : Digital I/O , Parallel Slave port bit 3 • RD4 : Digital I/O , Parallel Slave port bit 4 • RD5 : Digital I/O , Parallel Slave port bit 5 • RD6 : Digital I/O , Parallel Slave port bit 6 • RD7 : Digital I/O , Parallel Slave port bit 7 PORTD : is an 8-Bit Bidirectional port
  • 9.
    ‘PIC16F877A Ports :PORTE • RE0 : Digital I/O , Analog input , Read control for parallel slave • RE1 : Digital I/O , Analog input , Write control for parallel slave • RE2 : Digital I/O , Analog input , chip select control for parallel slave PORTE : is a 3-Bit Bidirectional port
  • 10.
  • 11.
    Input & OutputDevices Output Devices : - LEDs - Buzzer - 7-Segment - LCDs Input Devices : - Buttons & Switches - Sensors
  • 12.
    Project-1 “Flasher-1” Make projectwhere a LED is connected to RB0 , This LED is on for half Second and off for another half second .
  • 13.
    Project-2 “Flasher-1” Make projectwhere an 8 LED is connected To PORTB , half LED is on for 0.5s and the other is off and After 0.5s the LED is complemented
  • 14.
  • 15.
    Project-3 “Button-1” LED isconnected to RB0 and button to RD0 When the button is pressed the LED complement Its Status
  • 16.
    Project-4 “High-Volt” 220-Lamp isconnected to RB0 and button to RD0 When the button is pressed the Lamp is on for 1s then off.
  • 17.