Line 1: Line 1:
 
[[Category:Starter PIC16F877]]
 
[[Category:Starter PIC16F877]]
 
In this tutorial we will see how to interface a switch and buzzer with Pic16f877a starter board.<br>
 
In this tutorial we will see how to interface a switch and buzzer with Pic16f877a starter board.<br>
The switch will be used to control the buzzer.<br>  
+
Starter PIC board comes with on board switch connected to PORTD2 which will be used to control the buzzer.<br>  
  
 
=Steps=
 
=Steps=

Latest revision as of 18:26, 2 May 2016

In this tutorial we will see how to interface a switch and buzzer with Pic16f877a starter board.
Starter PIC board comes with on board switch connected to PORTD2 which will be used to control the buzzer.

Steps

  1. Configure the PORT D0 as output to control the buzzer.
  2. Configure the PORT D2 as input to read the switch status..
  3. Read the switch status.
  4. ON/OFF the Buzzer as per switch status.

Code

Demo

Pic16f877a buzzer.gif