digital i o
TRANSCRIPT
Lecture 3 :
Digital I/O & Small Project
Agenda
• Why PIC ??? & Why PIC16F877A• PIC16F877A ports and Pins• Project 1 “Flasher-1”• Project 2 “Flasher-2”• Pull-up & Pull-down Resistors• Project 3 “Button-1”• Project 4 “Button-2”
Why PIC ? & Why PIC16F877A
Why PIC ???• PIC is a well-known Microcontroller from a big company ‘Microchip’• Microchip produce big number of controllers with different features • There is a lot of online tutorials on PIC family
Why PIC16F877A ??• Big memory size• Wide range of Peripheral
PIC16F877A Ports : PORTA
PORTA : is a 6-Bit Bidirectional port
PORTA Pins
• 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
PIC16F877A Ports : PORTB
PORTB : is an 8-Bit Bidirectional port , with software weak PULL-UP
PORTB Pins
• 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
Note :- RB4 : RB7 have interrupt on-change feature , and only pins configure as input can cause interrupt to occar.
PIC16F877A Ports : PORTC
PORTC : is an 8-Bit Bidirectional port
PORTC Pins
• 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
PIC16F877A Ports : PORTD
PORTD : is an 8-Bit Bidirectional port
PORTD Pins
• 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
PIC16F877A Ports : PORTE
PORTE : is a 3-Bit Bidirectional port
PORTE Pins
• 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
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-2”
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 Resistors
Project 3 “Button-1”
LED is connected to RB0 and button to RD0When the button is pressed the LED complement Its Status
Project 4 “Button-2”
8 LEDs connected to PORTB and two Switches connected to RA0 and RA1. When Switch1 is pressed the LEDs shiftRight and if Switch2 is pressed the LEDs shift Left
Q & A
For more information
AZEX Team : FB Page : https://www.facebook.com/AlAZharEXhibition
Mohamed Ali Bedair:FB URL : https://www.facebook.com/MoahmedAliBedairMail : [email protected]