Universidad Tecnologica de Santiago Utesa: Asignatura Microprocesador II

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

UNIVERSIDAD TECNOLOGICA DE SANTIAGO

UTESA

ASIGNATURA
Microprocesador II

TEMA
Tarea segundo parcial

PRESENTADO POR:
SCHNEIDER FERJUSTE

MATRICULA:
1-17-2646

PROFESOR:
ING. RAUL TORIBIO

SANTIAGO DE LOS CABALLEROS,


REPUBLICA DOMINICANA
Diseñe un programa que genera una onda cuadrada en P0.0 de Fosc = 50khz.

Buscamos el periodo de onda:


T(on + off) = 1/50khz = 20uS
Ton/Toff = 20uS/2 = 10uS
Al aplicar la regla de tres para buscar el número de ciclo, tenemos:
X = (10uS * 1 c.m)/1uS = 10 ciclo.maquina
Modo 0: TH0.TL0 = 2X.2X
TL0 = 32 – 10 = 22

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x00;
TCON = 0X00;
while(1)
{
TH0 = 255;
TL0 = 255;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}
MODO 1:

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x01;
TCON = 0X00;
while(1)
{
TH0 = 1;
TL0 = 0;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}

MODO 2:

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x00;
TCON = 0X00;
while(1)
{
TH0 = 255;
TL0 = 254;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}

Diseñe un programa (Timer1) que genere un delay de 0.5seg  (LED ON/OFF)

Buscamos el periodo de onda:


T(on + off) = 0.5s
Ton/Toff = 0.5s/2 = 0.25s
Al aplicar la regla de tres para buscar el número de ciclo, tenemos:
X = (0.25s * 1 c.m)/1s = 0.25 ciclo.maquina
Modo 0: TH0.TL0 = 2X.2X
TL0 = 32 – 0.25 = 31.75

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x00;
TCON = 0X00;
while(1)
{
TH0 = 255;
TL0 = 255;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}
MODO 1:

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x01;
TCON = 0X00;
while(1)
{
TH0 = 1;
TL0 = 0;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}

MODO 2:

#include <REG51.H>

sbit led = P0^0;


void main(void)
{
TMOD = 0x00;
TCON = 0X00;
while(1)
{
TH0 = 255;
TL0 = 254;
TR0 = 1;
while(TF0 != 1);
TF0 = 0;
TR0 = 0;
led =~led; }
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy