PIC16F877A – Interfacing Switch

PIC 16F877A Mini Development Board has 3 Switches (SW1,SW2 & SW3) connected to port pins RC3, RC2 & RB5 via jumpers J8, J9 & J15 respectively. All the switches are pulled up to +5V via resistors (as shown in the schematic given below) which keeps the corresponding port pin in logic high state. When a switch is pressed, it gets ground, which brings the port pin to logic low state. On shorting the jumpers J8, J9 & J15, the switches can be used as pull-up keys and if the jumpers are left open, then the port pins can be used independently.

SchematicSample Code

Sample code to test the switches is given below. In the code, switch press is detected by polling and upon pressing a switch, its name gets displayed on the LCD

Topics related to PIC16F877A Development Board-Mini

  1. PIC16F877A Mini Development Board – Overview
  2. PIC16F877A Mini Development Board – Interfacing LED
  3. PIC16F877A Mini Development Board – Interfacing LCD
  4. PIC16F877A Mini Development Board – Serial communication(USART)
  5. PIC16F877A Mini Development Board – Interfacing Switch
  6. PIC16F877A Mini Development Board – Interfacing Buzzer
  7. PIC16F877A Mini Development Board – Interfacing  POT(ADC)
  8. PIC16F877A Mini Development Board – Interfacing Temperature sensor
  9. PIC 16F877A Mini Development Board – Interfacing Servo Motor
  10. PIC 16F877A Mini Development Board – Interfacing μRFID Reader

Resources

How to buy?

SupportPlease share your ideas with us, visit our forum for discussion

 

Leave a Reply