PIC16F877A PIN as input



This post provides an example code to use PIC16F877A pins as inputs. After going through this example, you will understand how to make PIC16F877A pins as inputs and how to read their value in the code. This code is written in C language using MPLAB X IDE with XC8 compiler.


Code

The code for reading the status of RB0 pin is shown below.


Figure 1: PIC16F877A code for PORTB as input


PIC16F877 pin as input demonstrating circuit:


figure2: pic16f877A simulation output

Comments

Popular posts from this blog

555 Timer Astable mode, Lt spice simulation, and real-time testing

Exploring USB Device Detection with Arduino and USB Host Shield

PIC12F675 LED Blinking Code