Está en la página 1de 9

PLAN DE PRÁCTICA NO.

DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 1 DE 9

FECHA DE EMISIÓN: 20 de Julio de 2021 ELABORÓ: Dr. en C. Israel Alejandro Rojas Olmedo
FECHA DE REALIZACIÓN: 20 de Julio de 2021 REVISÓ: Dr. en C. Israel Alejandro Rojas Olmedo
ASIGNATURA: Microcontroladores (Optativa I) APROBÓ:
UNIDAD TEMÁTICA: I.
TEMA: Temporizadores/contadores con C18 CUATRIMESTRE: NOVENO
NÚMERO DE PARTICIPANTES RECOMENDABLE: 2 DURACIÓN: 2 hrs
LUGAR: Laboratorio de Instrumentación Eléctrica Profesor: Dr. en C. Israel Alejandro Rojas Olmedo
Alumnos(as):
• Cesar Iván Ortega Villeda
• Carlos Daniel Saavedra Alcántara

REQUISITOS TEÓRICOS DE LA PRÁCTICA:


✓ Apuntes de clase
✓ Conocimientos básicos de programación en C18 para microcontroladores.
✓ Conocimientos sobre estructuras, retardos, y funciones.

OBJETIVO DE LA PRÁCTICA
Programar un microcontrolador PIC18F4550 en C18 para generar una frecuencia de 50 Hz utilizando la
interrupción del Timer 0.
MATERIAL: REACTIVOS: EQUIPO:
✓ 1 tablilla de experimentación ✓ Computadora personal (PC) con MPLAB X IDE
✓ 1 microcontrolador
V3.35 o superior, compilador C18 V3.47 y
PIC18F4550
Simulador Proteus.
✓ 1 cristal de cuarzo de 4 MHz
✓ 2 capacitores cerámicos de 27
pF
✓ 1 Fuente de alimentación a 5 V
✓ Push botón
✓ Resistencias
✓ Programador universal

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 2 DE 9

PROCEDIMIENTO

1. Abra y cree un nuevo proyecto en MPLAB X IDE.

Figura 5.1. MPLAB X IDE.

2. Escriba en el proyecto creado en MPLAB X IDE el código de la figura 5.2.

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 3 DE 9

Figura 6.2. Código en C18 para generar una f=50 Hz utilizando la interrupción del
TMR0.

3. Compile y verifique que el programa no tenga errores.

4. Simule el funcionamiento del circuito de la figura 5.3 en Proteus.

Figura 5.3. Circuito para encender 2 LEDs del puerto D del PIC18F4550
Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 4 DE 9

5. Arme en una tablilla de experimentación el circuito de la figura 5.3.

6. Descargue el archivo “. hex” al microcontrolador utilizando el programador universal.

7. Verifique el funcionamiento.

RESULTADOS

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 5 DE 9

Código en MPLAABXIDE

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 6 DE 9

Simulación en PROTEUS

ANÁLISIS DE RESULTADOS

En practica física podemos notar que físicamente el realizar las conexiones en una protoboard en
comparación a la simulación es muy diferente ya que en la simulación se puede representar de
manera diferente, pero de manera física se tiene un orden especifico que nos ayuda a visualizar
de una manera mejo como es que se trabajan con cada uno de los pines que tiene el PIC18F46K22.

Otra cosa que se observó dentro de esta práctica es el rango de visualización de frecuencia que el
ojo humano alcanza a percibir, al realizar esta práctica notamos que a nuestra vista el led pareciera
permanecer encendido sin alteración alguna, más sin en cambio está encendiendo a una
intermitencia de 50Hz.

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 7 DE 9

CONCLUSIONES

• Carlos Daniel Saavedra Alcántara:


In the present practice we can conclude with the practice carried out, it was concluded
correctly, since the objective proposed and raised at the beginning of this was fulfilled, also
respecting the certain conditions that it must contain. We fulfilled the objective proposed at
the beginning of this since we were able to turn on the led in an intermittent way, which
would indicate that the timer works, in this practice we made use of all the knowledge
acquired throughout the course without any exception, since as It can be observed, we make
use of structures, ports, conditions, arrangements, etc. In carrying out this practice we had to
do a great concentration since all the steps carried out have a sequence that we could not lose
and with the condition proposed at the beginning. to use port B. As you can see, the led turns
on and off. It shows us a number depending on which button we are pressing, with the
condition proposed at the beginning that it was to use Port B, likewise use the led and make
use of all the programming tools seen throughout the course in order to conclude and perform
practice correctly.

• Cesar Iván Ortega Villeda:


The most important thing in this practice is to realize the frequency that is done through the
programming and the equation that we took previously enc lase, making the calculations to
take a pre-scaler well with the documents that previously the professor gave us. In this
practice we used in the simulation an oscilloscope that helped us to see the wave of square
form to the certain frequency that we put in the programming and we observed that the wave
this of a form well done with the programming that was provided to us in the notes of
microcontrollers.
The most important thing for me in this practice is to get the necessary values through the
equation and the data that we can obtain previously taking care that we are in a range where
those data are correct, since that final number is the one that we will use so that the frequency
of our practice is correct.

• Bookshop:
In computer science, a library or, called by vice of the library language is a set of
functional implementations, coded in a programming language, that offers a well-
defined interface for the functionality that is invoked.

• PICKIT 3:
The PICKit 3 is Microchip's simplest and lowest cost debugging and programming
tool. It is fully supported by the MPLAB IDE, and has a simple USB Full Speed
connection with the computer that not only allows programming and debugging but
also updating the internal firmware of the PICKIT3.

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 8 DE 9

• Internal oscillator:
The internal RC oscillator is generally warranted by the manufacturer with no
hardware design issues. The main difference is that the internal oscillator is usually
an RC type oscillator which is not very accurate. External oscillators can be of the
quartz crystal type that are much more accurate.

• Breadboard:
A breadboard, or breadboard, is practically a temporary PCB with a generalized
shape and size. Commonly used for temporary testing and prototyping of circuits. It
is used by inserting the terminals of the electronic devices into the holes of the
breadboard in the way that they have continuity.

Los roles que tuvimos como pareja fue que en el caso de Cesar Iván Ortega Villeda fue el
encargado de la programación y simulación en MPLABXIDE, se encargó de poner todas las
librerías en el programa y de igual manera contribuyo en la generación del código o
transcripción del mismo, el compañero Carlos Daniel Saavedra Alcántara fue el encargado
de realizar la práctica de manera física, el que de igual manera subió el programa al PIC
mediante el programa PICKIT al PICKIT3, el realizo todas las conexiones que se pueden
apreciar en las imágenes pasadas y el funcionamiento correcto de manera física del mismo.

Los retos que presentamos como pareja en la realización de esta práctica fue de igual manera
la distancia que por os problemas de pandemia tenemos, ya que no es lo mismo poder vernos
y explicarnos de manera física a tener que hacer una videollamada en donde tuvimos
problemas de conexión en ocasiones y en donde a veces no nos entendíamos, esos fueron los
retos más relevantes que presentamos, ya que la comunicación de decirnos esto se conecta
acá, y todas esas cuestiones si supimos resolver mediante datasheets, imágenes, videos,
etcétera.

En esta práctica lo más relevante que logramos apreciar es que el uso de TIMER’s en ocasiones
puede ser muy importante para que podamos realizar ciertos “retardos” de alguna manera
diferente a la que ya habíamos realizado; esto puede ser de gran ayuda en circuitos electrónicos
que cubren diferentes partes de prácticas o incluso diferentes tipos de industrias, donde es muy
importante realizar alguna actividad después de cierto tiempo, en donde su puede apreciar
también si un proceso está a punto de terminar o si ha finalizado.

Emisión 2 R-EDU-68
PLAN DE PRÁCTICA NO. DE PRÁCTICA:

DIRECCIÓN DE CARRERA DE MECATRÓNICA Y 7


SISTEMAS PRODUCTIVOS FECHA: 20/07/2021
TÍTULO DE LA PRACTICA: USO DEL TIMER 0 PÁGINA 9 DE 9

CUESTIONARIO

1. ¿Cómo contribuye esta práctica al objetivo de la asignatura?


Contribuye en la formación tanto académica como laboral ya que es algo fundamental para
un ingeniero mecatrónico analizar el funcionamiento de los TIMER’S mediante un PIC
cualquiera, en este caso el PIC18F46K22.

2. Menciona ¿Qué parte del procedimiento es fundamental para obtener los resultados
esperados?
Es fundamental compilar y verificar la programación ya que con eso podemos avanzar y
continuar con las conexiones en una tablilla de experimentación (protoboard), ya que eso es
prácticamente ver que funcione correctamente.

3. ¿Tus resultados son los óptimos? ¿Por qué? De ser posible, compara con otros equipos.
Fueron los óptimos porque logramos llegar a complementar la práctica de manera adecuada
y cumplir el objetivo planteado por el profesor y la práctica.

4. ¿Cómo contribuye está práctica al desarrollo de tus competencias profesionales?


En la forma básica de entrar al mundo de programación de los circuitos integrados y en este
caso además de emplear más programas de simulación, asimismo, recrear la práctica
físicamente con el uso del PIC en físico.

BIBLIOGRAFÍA

[Ho-2006] Hoja de especificación del PIC18F4550, Microchip Technology Inc, 2006.


[Lb-2005] MPLAB C18 C Compiler Libraries, Microchip Technology Inc, 2005.
[Wi-2007]
Designing Embedded Systems with PIC Microcontrollers, Tim
Wilmshurst, Elsevier, 2007.
[Ga-2008] Compilador C CCS y Simulador Proteus para Microcontroladores PIC,
Eduardo García Breijo, Alfaomega, 2008.

Emisión 2 R-EDU-68

También podría gustarte