Académique Documents
Professionnel Documents
Culture Documents
SALESIANA
INGENIERÍA ELECTRÓNICA
SISTEMAS MICROPROCESADOS
TEMA: TEMPORIZADORES
INFORME Nº 3
VINICIO DAVILA
REMIN ZAMBRANO
1
OBJETIVO:
• EJERCICIO 1:
program timerinterno
dim a as byte
a=0
trisa=$FF
trisb=$0
option_reg=%10000111
Intcon=$0
TMR0=155
portb=$0
lazo:
if tmr0=255 then
inc(a)
if a=38 then
inc(portb)
2
end if
end if
goto lazo
end.
ALGORITMO:
Entradas:
Salidas:
Procesos:
3
DIAGRAMA DE FLUJO:
Configuración de registros
y variables
NO
SI
4
EJERCICIO 2:
Elabore un programa que realice las operaciones del numeral 1, pero con TMR0=96,
TMR0=155.
program temporizadordos
dim a as byte
a=0
trisa=$FF
trisb=$0
option_reg=%10000111
Intcon=$0
TMR0=155
portb=$0
lazo:
if tmr0=255 then
inc(a)
if a=38 then
inc(portb)
end if
end if
goto lazo
end.
5
DIAGRAMA DE FLUJO:
Configuración de
registros y variables
6
EJERCICIO 3:
program timerexterno
main:
trisa=$ff
trisb=$0
option_reg=%10100010
intcon=$0
tmr0=0
lazo:
portb=tmr0
goto lazo
end.
ALGORITMO:
Entradas:
Salidas:
Procesos:
7
2. Almacenar en el puerto a el dato de activación del contador en el circuito
(trisa=$ff).
8
DIAGRAMA DE FLUJO:
9
EJERCICIO 4:
program semaforo1
main:
trisb.0=0
trisb.1=0
trisb.2=0
portb.0=0
portb.1=0
portb.2=0
inicio:
portb.0=1
portb.1=0
portb.2=0
delay_ms(20000)
delay_ms(10000)
portb.0=1
portb.1=1
portb.2=0
10
delay_ms(10000)
portb.0=0
portb.1=0
portb.2=1
delay_ms(20000)
goto inicio
end.
ALGORITMO:
Entradas:
Salidas:
Procesos:
6. Regresar al lazo.
11
DIAGRAMA DE FLUJO:
12
ANEXOS:
13
Fig3: semáforo Fig4: semaforo
14