PIC16f877A input output ports Configuration | TRIS Register | Proteus PIC Simulation

Опубликовано: 20 Май 2026
на канале: Embedded C
15,802
40

GPIO in PIC16F87XA
For program - https://goo.gl/GwcGlv

GPIO in PIC16F877A is divided into 5 ports that is PORTA, PORTB, PORTC, PORTD, PORTE. We can configure a GPIO pin as a input or output. In all the microcontroller that can be set with the direction register. Incase of PIC16F877A we can use a direction register TRIS. For every port there will be one TRIS direction register port. Consider the PORTA, which has TRISA. The address is given below.
What is the use of TRIS ?
As given above TRISA, TRISB, TRISC, TRISC, TRISD, TRISE is used as direction register. So that writing into this register will configure the particular GPIO port as a input or output.
How to configure input and output with TRIS ?
For this we need to refer the datasheet of the PIC16F877A. Setting a TRISA bit (= 1) will make the corresponding PORTA pin an input (i.e., put the corresponding output driver in a High-Impedance mode). Clearing a TRISA bit (= 0) will make the corresponding PORTA pin an output (i.e., put the contents of the output latch on the selected pin). This is common for other ports also.
Reading the PORTA register reads the status of the pins, whereas writing to it will write to the port latch. All write operations are read-modify-write operations. Therefore, a write to a port implies that the port pins are read, the value is modified and then written to the port data latch.
tris register in pic16f877a
pic16f877a port details
difference between tris and port
8051 microcontroller input output ports
lat register in pic
dual role ports of data i/o
adcon1 register in pic16f877a
ansel register
pic16f877a input output ports
pic16f877a ports
Proteus PIC Simulation
Proteus pic
proteus tutorials
PIC tutorials
PIC16f877A tutorials

------------------------------------------------------
Follow us on Facebook
  / mbeddedc  

Follow our webesite
http://www.mbeddedc.com/

To download the project (C program) and Proteus project, click the link below,
https://bit.ly/2ER3Czn

Different Proteus examples and C projects tutorials with PIC16F877A

Input and Output Ports
   • PIC16f877A input output ports Configuratio...  

Blinking LED
   • Blinking LED using PIC16F877A with Proteus  

Multiple Blinking LED
   • Multiple Blinking LED using PIC16F77A with...  

What is Interrupt ? How to use Interrupts with PIC16F877A? Push button example
   • Interrupts in PIC16F877A with Push button ...  

UART Protocol Driver Tutorial with Example
   • UART in PIC16F877A pic microcontroller wit...  

SPI Protocol driver Tutorial with Example
   • PIC16F877A SPI Tutorial with Proteus Simul...  

LCD Interface tutorial with Example using PIC16F877A can be referred for Arduino as well
   • LCD interface with PIC16F877A microcontrol...  

------------------------------------------------------
Top Performing videos in our Channel

UART -    • UART protocol from the basics | Serial com...  
I2C -    • I2C Bus Communication Protocol Tutorial wi...  
SPI -    • SPI Bus communication protocol  

Embedded C interview Questions
   • How to Answer for What is Volatile ? Embed...  

   • Embedded C Interview Questions  

------------------------------------------------------
Follow us on Facebook
  / mbeddedc  

Follow our webesite
http://www.mbeddedc.com/

If you end up liking this video please subscribe to our channel and dont forget to hit the bell icon.

Please share this video with your friends if you find interesting.

#PIC #Microcontroller #Microprocessor #Tutorial #HowToGetStarted #PIC16F877A #Proteus #Tutorials #Examples #Embedded #Arduino #EEvlog #EEBlog #HowTo #HowToMechatronics #CVlog #CBlog

#blinking #led #blinking_led #pic16f877a #proteus #embedded #embeddedc #embeddec_c #interview #interview_questions #interview #interview_questions #interview_question_and_answers #examples #c #c_programming