This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Archivo de cabecera para configuración y uso de módulo LCD | |
//con el PIC18F4550 en el puerto D y E. | |
#include "p18f4550.h" //Cabecera de Núcleo | |
#include "xc.h" | |
#include "delays.h" | |
#include "stdlib.h" | |
//Prototipos de las funciones | |
void LCD_Retardo_Corto(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __DELAYS_H | |
#define __DELAYS_H | |
#if defined (__18CXX) || defined(_PLIB) | |
/* C18 cycle-count delay routines. */ | |
/* Delay of exactly 1 Tcy */ | |
#define Delay1TCY() _delay(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Frecuencimetro digital | |
// Cuenta las veces que ocurre un flanco ascendente durante un segundo | |
// Y muestra el resultado en la LCD | |
// Ángel Moreno | |
// David Escobar | |
// Eduardo Rivas | |
#include "p18f4550.h" | |
#include "xc.h" | |
#include "stdlib.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//primer avance del codigo | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <p18f4550.h> | |
#include <xc.h> | |
//#include "lcd.h" //incluir los header para la LCD y delays | |
//Directivas para activar los bits de configuración | |
#pragma config FOSC = INTOSCIO_EC //Oscilador Interno, Puerto A RA6 activo, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title "PIC18F4550 Envio de byte por SPI Modo Maestro" | |
list p=18F4550 ; indica el modelo de PIC | |
#include <p18f4550.inc> ; archivo de encabezado | |
CONFIG FOSC = INTOSCIO_EC | |
CONFIG WDT = OFF | |
CONFIG PBADEN = OFF | |
CONFIG MCLRE = ON | |
CONFIG DEBUG = ON | |
CONFIG LVP = OFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;*************************************************************************************** | |
; Cálculos | |
;*************************************************************************************** | |
; X: Condición no importa | |
; Baud rate = 8000000/(16 (51 + 1)) | |
; = 9615.3846 = 9615 | |
; Error = (Baud Rate calculado - Baud Rate deseado)/Baud Rate deseado | |
; = (9615 - 9600)/9600 = 0.16% | |
title "PIC18F4550 Comunicación serie" | |
List p=18F4550;Tipo de procesador |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;*************************************************************************************** | |
; Cálculos | |
;*************************************************************************************** | |
; X: Condición no importa | |
; Baud rate = 8000000/(16 (51 + 1)) | |
; = 9615.3846 = 9615 | |
; Error = (Baud Rate calculado - Baud Rate deseado)/Baud Rate deseado | |
; = (9615 - 9600)/9600 = 0.16% | |
title "PIC18F4550 Comunicación serie" | |
List p=18F4550;Tipo de procesador |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title "PIC18F4550 bit paridad" | |
list p=18F4550 ; indica el modelo de PIC | |
#include <p18f4550.inc> ; archivo de encabezado | |
CONFIG FOSC = INTOSCIO_EC | |
CONFIG WDT = OFF | |
CONFIG PBADEN = OFF | |
CONFIG MCLRE = ON | |
CONFIG DEBUG = ON | |
CONFIG LVP = OFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Manda datos del ADC por el EUSART al presionar un boton | |
// Boton pull down en RB0 | |
// Entrada analogica en RA0 | |
// Carlos Zelada | |
// Eduardo Rivas | |
#include "xc.h" | |
#include "stdlib.h" | |
#include "p18f4550.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://www.etnassoft.com/biblioteca/lenguaje-ensamblador-para-c/ |
OlderNewer