ChapII. Les entrées -sorties digitales et analogiques_8604e0160b7ad60e99cf9bbaf714c06a - Document to Presentation
Published on Sep 24, 2026
Description:
Let's dive into PIC16F877 microcontrollers. Its 33 I/O pins are grouped into 5 ports, with individual pins like RA0 and RB0 for digital and analog uses.We explore PORTA, which handles both digital and analog I/O. Ports B to E also offer various functionalities, from 8-bit bidirectional data to interrupt triggering for specific applications.Here, we demystify analog-to-digital conversion using successive approximation. A D/A converter, comparator, and control logic work together to transform an analog voltage into a binary number.This diagram illustrates how an analog voltage (Vx) is converted into a digital value over time. Each step compares the voltage with a reference, refining the binary result until a precise conversion is achieved.Discover the PIC16F877's CAN module: a 10-bit analog-to-digital converter supporting 8 external analog inputs. This module ensures precise voltage measurements through adjustable reference tensions and clock settings.Here's how ADRESH and ADRESL registers store the 10-bit conversion result. You can right or left justify the data for different processing needs, controlling how the digital output is aligned.This table details the configuration of PORTA and PORTB pins for various input/output and reference voltage settings. It's crucial for understanding how to properly set up analog and digital functions.Understanding conversion time is key. This table shows how TAD, the conversion time per bit, varies with frequency. We see that for a 4 MHz clock, 8 TAD is 8 µs, for a total conversion of 24 µs.