This project uses the PIC-DIP40 Development Board and presents 7 projects using the PIC16F877A in C Language. All codes are functional!
Run theses Examples by Install MPLAB-X on WIN10:
Use: microchip_MPLABX
Use: MPLAB® XC8 Compiler
Version:
Product Version: MPLAB X IDE v6.10
Java: 1.8.0_345; OpenJDK 64-Bit Server VM 25.345-b01
Runtime: OpenJDK Runtime Environment 1.8.0_345-b01
System: Windows 10 version 10.0 running on amd64; Cp1252; pt_BR (mplab)
Download the project
Create a Directory named:
MPLABXProjects
Inside expand the Directories:
(PRAT_1, PRAT_2...)
Open App and Point to Open each Project:
MPLABX app
/*
Prática 1 (A): Piscar 1 LED
MCU: PIC16F877A
Dev.Board: PIC-DIP40 - UNINTER - VERSAO 2
Oscillator: 4M
Ext. Modules: PIC KIT 3 - MICROCHIP
Date: AGO/2023
*/
#include <xc.h> // Biblioteca do compilador
#include <pic16f877a.h> // Inclua a biblioteca para o PIC16F877A0
// Configuração dos bits de configuração do PIC16F877A
#pragma config FOSC = HS // Oscilador externo em modo HS (High Speed)
#pragma config WDTE = OFF // Watchdog Timer desativado
#pragma config PWRTE = OFF // Power-up Timer desativado
#pragma config BOREN = ON // Brown-out Reset habilitado
#pragma config LVP = OFF // Programação em baixa tensão desabilitada (Vpp alto)
#define _XTAL_FREQ 4000000 // Frequência do oscilador (4 MHz)
# define TRUE 1
void main(){
TRISD = 0x00;
while (TRUE){
PORTD = 0x7f; // Todos pinos PORTD off, exceto RD0
__delay_ms(1000); // Espera 1 sec.
PORTD = 0xff; // Todos pinos PORTD off
__delay_ms(1000); // Espera 1 sec.
}
}
In the PIC-DIP40 Development Board
> KEEP LED-EN jumper
> REMOVE the LED-EN jumper