Ayuda con Circuito PIC

1:47

General (prev)
Chat History
Project
Library
Aquí tienes tres opciones para el pulsador de 2 pines y tres opciones de resistencia de 10 kΩ (1/4 W, ±5%) para el pull-up de MCLR:

Pulsadores momentáneos 2 pines (THT)


Part NameManufacturerMPNDatasheet
6x6mm micro tactile switch
Push ButtonDatasheet
Push Button B3FS-1050POMRONB3FS-1050PDatasheet

Resistencias 10 kΩ 1/4 W ±5% (Axial, THT)


Part NameManufacturerMPNDatasheet
CFR-25JT-52-10KYageoCFR-25JT-52-10KDatasheet
CFR-25JB-52-10KYageoCFR-25JB-52-10KDatasheet
MFR50SFTE52-10KYAGEOMFR50SFTE52-10K2304140030_YAGEO-MFR50SFTE52-10K_C173139.pdf
Estos componentes permitirán implementar correctamente el pull-up de MCLR con resistencia de 10 kΩ y un pulsador momentáneo para reset.
227 days

Ready.


puedes hacer una simulacion de este codigo: \#include <16F877A.h> \#device \*=16...

puedes hacer una simulacion de este codigo: #include <16F877A.h> #device *=16
#FUSES NOWDT //No Watch Dog Timer #FUSES XT //Low power xtal #FUSES PUT //Power Up Timer #FUSES NOPROTECT //Code not protected from reading #FUSES BROWNOUT //Reset when brownout detected #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(crystal=4MHz) //Cristal de 4 MHz
#include //Incluye la librería LCD
void main() { unsigned int contador = 0; // Contador char buffer[5]; // Buffer para el número a mostrar en el LCD
// Inicialización del LCD
lcd_init();

// Configuración de los pines del puerto B
set_tris_b(0x03); // RB0 y RB1 como entradas

while(TRUE) {
    // Detección del botón de incremento
    if(input(PIN_B0)) {
        delay_ms(50); // Antirrebote
        if(input(PIN_B0)) {
            contador++;
            if (contador > 9999) // Limitar el contador a cuatro dígitos
                contador = 0;
            while(input(PIN_B0)); // Espera a que se suelte el botón
        }
    }

    // Detección del botón de decremento
    if(input(PIN_B1)) {
        delay_ms(50); // Antirrebote
        if(input(PIN_B1)) {
            if(contador == 0) // Manejo del desbordamiento bajo
                contador = 9999;
            else
                contador--;
            while(input(PIN_B1)); // Espera a que se suelte el botón
        }
    }

    // Mostrar el contador en el LCD
    sprintf(buffer, "%04u", contador); // Convertir el contador a string de 4 dígitos
    lcd_gotoxy(1, 1); // Posicionar el cursor en la posición inicial
    lcd_putc(buffer); // Mostrar el contador en el LCD
}
}
1y
Simular directamente el código C escrito para un PIC16F877A-I/P en un entorno de simulación sin un compilador específico y una herramienta de simulación no es posible de manera directa aquí. Sin embargo, puedo ayudarte a crear un esquema preliminar en Flux y brindarte una guía detallada para montar este circuito que luego puedes simular usando un simulador PIC como MPLAB X y un entorno adicional como Proteus.
Manejemos las conexiones del hardware necesario para tu código:
Conexiones del PIC16F877A-I/P:
  1. Alimentación:
    • Connect VDD_1 (Pin 11) a +5V
    • Connect VSS_1 (Pin 12) a GND
    • Connect VDD_2 (Pin 32) a +5V
    • Connect VSS_2 (Pin 31) a GND
  2. Oscilador:
    • Connect OSC1/CLKI (Pin 13) a uno de los terminales del cristal de 4MHz
    • Connect OSC2/CLKO (Pin 14) al otro terminal del cristal de 4MHz
    • Conecta condensadores de 22pF entre cada pin del cristal y GND (estos valores pueden variar).
  3. MCLR:
    • Connect MCLR/VPP (Pin 1) a +5V a través de una resistencia de 10kΩ
  4. Botones:
    • Connect un extremo de un botón al RB0 (Pin 33) y el otro a GND.
    • Connect un extremo de un botón al RB1 (Pin 34) y el otro a GND.
  5. LCD:
    • Conéctalo a los pines adecuados del PIC según tu librería lcd.c. Normalmente, esto puede variar, pero una configuración típica podría ser:
    LCD_RS -> Pin del PIC (Ej: RC4)
    LCD_RW -> Pin del PIC (Ej: RC5)
    LCD_E  -> Pin del PIC (Ej: RC6)
    LCD_D4 -> Pin del PIC (Ej: RD4)
    LCD_D5 -> Pin del PIC (Ej: RD5)
    LCD_D6 -> Pin del PIC (Ej: RD6)
    LCD_D7 -> Pin del PIC (Ej: RD7)
    
    Asegúrate de definir estos pines correctamente en el archivo lcd.c si no están definidos.
Para los pines específicos del LCD, necesitarás referencias del archivo lcd.c para las conexiones correctas. Con esto en mente, puedes simular y probar el programa utilizando un entorno que soporte el compilador del Microchip y simulación de hardware, como MPLAB X y Proteus.
Flujo general de la simulación:
  1. Compilación y Carga:
    • Usa MPLAB X para escribir y compilar el código y generar el archivo HEX.
  2. Simulación:
    • Importa el archivo HEX generado en una herramienta como Proteus.
    • Construye el mismo circuito en Proteus con los componentes simulados.
    • Ejecuta la simulación y observa los resultados en el LCD.
Si tienes algún problema específico con la configuración del circuito en Flux o con los detalles de la biblioteca lcd.c, por favor házmelo saber para que pueda asistirte más.
1y
Someone is typing...
create a high level mermaid block diagram of this project. Include key component...

@copilot create a high level mermaid block diagram of this project. Include key component's manufacturer part number in each block whenever possible.
1y
Below is a high-level Mermaid block diagram for the project, which includes the key component, the PIC16F877A-I/P, and its manufacturer name, Microchip Technology.

Mermaid


graph TD
    A["PIC16F877A-I/P\n(Microchip Technology)"]

    A -->|Pin 1| B[~MCLR~/VPP]
    A -->|Pin 2| C[RA0/AN0]
    A -->|Pin 3| D[RA1/AN1]
    A -->|Pin 4| E[RA2/AN2/VREF-/CVREF]
    A -->|Pin 5| F[RA3/AN3/VREF+]
    A -->|Pin 6| G[RA4/T0CKI/C1OUT]
    A -->|Pin 7| H[RA5/AN4/~SS~/C2OUT]
    A -->|Pin 8| I[RE0/~RD~/AN5]
    A -->|Pin 9| J[RE1/~WR~/AN6]
    A -->|Pin 10| K[RE2/~CS~/AN7]
    A -->|Pin 11| L[VDD_1]
    A -->|Pin 12| M[VSS_1]
    A -->|Pin 13| N[OSC1/CLKI]
    A -->|Pin 14| O[OSC2/CLKO]
    A -->|Pin 15| P[RC0/T1OSO/T1CKI]
    A -->|Pin 16| Q[RC1/T1OSI/CCP2]
    A -->|Pin 17| R[RC2/CCP1]
    A -->|Pin 18| S[RC3/SCK/SCL]
    A -->|Pin 19| T[RD0/PSP0]
    A -->|Pin 20| U[RD1/PSP1]
    A -->|Pin 21| V[RD2/PSP2]
    A -->|Pin 22| W[RD3/PSP3]
    A -->|Pin 23| X[RC4/SDI/SDA]
    A -->|Pin 24| Y[RC5/SDO]
    A -->|Pin 25| Z[RC6/TX/CK]
    A -->|Pin 26| AA[RC7/RX/DT]
    A -->|Pin 27| AB[RD4/PSP4]
    A -->|Pin 28| AC[RD5/PSP5]
    A -->|Pin 29| AD[RD6/PSP6]
    A -->|Pin 30| AE[RD7/PSP7]
    A -->|Pin 31| AF[VSS_2]
    A -->|Pin 32| AG[VDD_2]
    A -->|Pin 33| AH[RB0/INT]
    A -->|Pin 34| AI[RB1]
    A -->|Pin 35| AJ[RB2]
    A -->|Pin 36| AK[RB3/PGM]
    A -->|Pin 37| AL[RB4]
    A -->|Pin 38| AM[RB5]
    A -->|Pin 39| AN[RB6/PGC]
    A -->|Pin 40| AO[RB7/PGD]
This diagram provides a simplified representation of the PIC16F877A microcontroller and its associated pins, which you can extend based on your specific project needs.
1y
Proyec one led
3mo
Someone is typing...
5
create a high level mermaid block diagram of this project. Include key component...

@copilot create a high level mermaid block diagram of this project. Include key component's manufacturer part number in each block whenever possible.
1y
Certainly! Here's a high-level Mermaid block diagram representing your project with the key component, the PIC16F877A-I/P microcontroller from Microchip Technology.

Mermaid


graph TB
    A($$Power Supply$$) --> B($$Microchip Technology\\nPIC16F877A-I/P$$)
    B --> C($$Analog Inputs$$)
    B --> D($$Digital I/O$$)
    B --> E($$USART Interface$$)
    B --> F($$PWM Outputs$$)

    C --> G($$RA0/AN0$$)
    C --> H($$RA1/AN1$$)
    C --> I($$RA2/AN2/VREF-$$)
    C --> J($$RA3/AN3/VREF+$$)
    C --> K($$RA5/AN4/~SS~/C2OUT$$)
    C --> L($$RE0/~RD~/AN5$$)
    C --> M($$RE1/~WR~/AN6$$)
    C --> N($$RE2/~CS~/AN7$$)

    D --> O($$RB0/INT$$)
    D --> P($$RB1$$)
    D --> Q($$RB2$$)
    D --> R($$RB3/PGM$$)
    D --> S($$RB4$$)
    D --> T($$RB5$$)
    D --> U($$RB6/PGC$$)
    D --> V($$RB7/PGD$$)

    E --> W($$RC7/RX/DT$$)
    E --> X($$RC6/TX/CK$$)

    F --> Y($$RC2/CCP1$$)
    F --> Z($$RC1/T1OSI/CCP2$$)

    classDef default fill:#f9f,stroke:#333,stroke-width:2px;
This diagram presents the PIC16F877A-I/P at the center with connections to different functionalities and pins. Let me know if you need any modifications or additional details!
1y
Someone is typing...
6


  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    Wirelessly connects nets on schematic. Used to organize schematics and separate functional blocks. To wirelessly connect net portals, give them same designator. #portal
  • Power Net Portal
    Wirelessly connects power nets on schematic. Identical to the net portal, but with a power symbol. Used to organize schematics and separate functional blocks. To wirelessly connect power net portals, give them the same designator. #portal #power
  • Generic Resistor
    A generic fixed resistor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0Ω 10Ω 100Ω 1.0kΩ 10kΩ 100kΩ 1.0MΩ 1.1Ω 11Ω 110Ω 1.1kΩ 11kΩ 110kΩ 1.1MΩ 1.2Ω 12Ω 120Ω 1.2kΩ 12kΩ 120kΩ 1.2MΩ 1.3Ω 13Ω 130Ω 1.3kΩ 13kΩ 130kΩ 1.3MΩ 1.5Ω 15Ω 150Ω 1.5kΩ 15kΩ 150kΩ 1.5MΩ 1.6Ω 16Ω 160Ω 1.6kΩ 16kΩ 160kΩ 1.6MΩ 1.8Ω 18Ω 180Ω 1.8KΩ 18kΩ 180kΩ 1.8MΩ 2.0Ω 20Ω 200Ω 2.0kΩ 20kΩ 200kΩ 2.0MΩ 2.2Ω 22Ω 220Ω 2.2kΩ 22kΩ 220kΩ 2.2MΩ 2.4Ω 24Ω 240Ω 2.4kΩ 24kΩ 240kΩ 2.4MΩ 2.7Ω 27Ω 270Ω 2.7kΩ 27kΩ 270kΩ 2.7MΩ 3.0Ω 30Ω 300Ω 3.0KΩ 30KΩ 300KΩ 3.0MΩ 3.3Ω 33Ω 330Ω 3.3kΩ 33kΩ 330kΩ 3.3MΩ 3.6Ω 36Ω 360Ω 3.6kΩ 36kΩ 360kΩ 3.6MΩ 3.9Ω 39Ω 390Ω 3.9kΩ 39kΩ 390kΩ 3.9MΩ 4.3Ω 43Ω 430Ω 4.3kΩ 43KΩ 430KΩ 4.3MΩ 4.7Ω 47Ω 470Ω 4.7kΩ 47kΩ 470kΩ 4.7MΩ 5.1Ω 51Ω 510Ω 5.1kΩ 51kΩ 510kΩ 5.1MΩ 5.6Ω 56Ω 560Ω 5.6kΩ 56kΩ 560kΩ 5.6MΩ 6.2Ω 62Ω 620Ω 6.2kΩ 62KΩ 620KΩ 6.2MΩ 6.8Ω 68Ω 680Ω 6.8kΩ 68kΩ 680kΩ 6.8MΩ 7.5Ω 75Ω 750Ω 7.5kΩ 75kΩ 750kΩ 7.5MΩ 8.2Ω 82Ω 820Ω 8.2kΩ 82kΩ 820kΩ 8.2MΩ 9.1Ω 91Ω 910Ω 9.1kΩ 91kΩ 910kΩ 9.1MΩ #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor ideal for rapid circuit topology development. You can choose between polarized and non-polarized types, its symbol and the footprint will automatically adapt based on your selection. Supported options include standard SMD sizes for ceramic capacitors (e.g., 0402, 0603, 0805), SMD sizes for aluminum electrolytic capacitors, and through-hole footprints for polarized capacitors. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF 10pF 100pF 1000pF 0.01uF 0.1uF 1.0uF 10uF 100uF 1000uF 10,000uF 1.1pF 11pF 110pF 1100pF 1.2pF 12pF 120pF 1200pF 1.3pF 13pF 130pF 1300pF 1.5pF 15pF 150pF 1500pF 0.015uF 0.15uF 1.5uF 15uF 150uF 1500uF 1.6pF 16pF 160pF 1600pF 1.8pF 18pF 180pF 1800pF 2.0pF 20pF 200pF 2000pF 2.2pF 22pF 20pF 2200pF 0.022uF 0.22uF 2.2uF 22uF 220uF 2200uF 2.4pF 24pF 240pF 2400pF 2.7pF 27pF 270pF 2700pF 3.0pF 30pF 300pF 3000pF 3.3pF 33pF 330pF 3300pF 0.033uF 0.33uF 3.3uF 33uF 330uF 3300uF 3.6pF 36pF 360pF 3600pF 3.9pF 39pF 390pF 3900pF 4.3pF 43pF 430pF 4300pF 4.7pF 47pF 470pF 4700pF 0.047uF 0.47uF 4.7uF 47uF 470uF 4700uF 5.1pF 51pF 510pF 5100pF 5.6pF 56pF 560pF 5600pF 6.2pF 62pF 620pF 6200pF 6.8pF 68pF 680pF 6800pF 0.068uF 0.68uF 6.8uF 68uF 680uF 6800uF 7.5pF 75pF 750pF 7500pF 8.2pF 82pF 820pF 8200pF 9.1pF 91pF 910pF 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor for rapid developing circuit topology. *You can now change the footprint and 3D model at the top level anytime you want. This is the power of #generics
  • Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • RMCF0805JT47K0
    47 kOhms ±5% 0.125W, 1/8W Chip Resistor 0805 (2012 Metric) Automotive AEC-Q200 Thick Film #forLedBlink
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink

Inspect

PIC16F877A-I/P

PIC16F877A-I/P
Description

Created
Last updated by adrian95
1 Contributor(s)
adrian95

Controls

Properties

Part Type
Microcontroller
Manufacturer Part Number
PIC16F877A-I/P
Designator Prefix
U

Availability & Pricing

DPNStockQty 1
40–130$6.528–$7.481
13.2K$6.80
1113$4.7649
1164$6.80
110$7.97
1310–940$6.605–$14.6761

Assets