Sie sind auf Seite 1von 14

UNIVERSIDAD RICARDO PALMA

FACULTAD DE INGENIERA

ESCUELA PROFESIONAL DE INGENIERA


ELECTRNICA

CURSO : MICROPROCESADORES

DOCENTE : Juan Meza A.

ALUMNO : Huamani Huaman Roy


Godofredo
2008

RELOJ DIGITAL CON MINUTOS Y HORAS

El funcionamiento de este circuito es simple, ya que solo tenemos que controlar


el puerto A que es por donde salen las seales para excitar la base del
transistor, que es necesario para que se encienda el display de ctodo comn,
para la implementacin del circuito se empleo un cristal de 4MHz que va entre
los pines 15 y 16 que nos genera la temporizacion en el programa.
PROGRAMA DEL CIRCUITO

list p=16f84

status equ 0x03


roption equ 0x81
trisb equ 0x86
trisa equ 0x85
porta equ 0x05
portb equ 0x06
uno equ 0x0c
dos equ 0x0d
tres equ 0x0e
cuatro equ 0x0f
cinco equ 0x10
seis equ 0x11
siete equ 0x12
ocho equ 0x13
nueve equ 0x14
cero equ 0x15
intcon equ 0x0b
tmr equ 0x01
cont equ 0x16

movlw 0x7e
movwf cero
movlw 0x30
movwf uno
movlw 0x6d
movwf dos
movlw 0x79
movwf tres
movlw 0x33
movwf cuatro
movlw 0x5b
movwf cinco
movlw 0x5f
movwf seis
movlw 0x70
movwf siete
movlw 0x7f
movwf ocho
movlw 0x7b
movwf nueve

inicio bsf status,5


movlw 0x07
movwf roption
movlw 0x00
movwf trisb
movlw 0x00
movwf trisa
bcf status,5

movlw 0x1f
movwf porta
movf cero,0
movwf portb

bsf portb,7

movlw 0x01
movwf porta
bcf portb,7
call delay1seg

call cont090
rlf porta,1
movf uno,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cero,0
movwf portb

call delay1seg

rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf seis,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf siete,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf ocho,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf nueve,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cero,0
movwf portb

call delay1seg

rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cero,0
movwf portb

call delay1seg

rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf seis,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf siete,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf ocho,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf nueve,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cero,0
movwf portb
rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf seis,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf siete,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf ocho,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf nueve,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cero,0
movwf portb
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
rrf porta,1
call horas
rlf porta,1
movf cero,0
movwf portb
rlf porta,1
movf cero,0
movwf portb
goto inicio

horas call minutos


rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
rrf porta,1
call minutos
rlf porta,1
movf cero,0
movwf portb
return

minutos call segundos


rlf porta,1
movf uno,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf seis,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf siete,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf ocho,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf nueve,0
movwf portb
rrf porta,1
rrf porta,1
call segundos
rlf porta,1
movf cero,0
movwf portb
return

segundos call cont090


rlf porta,1
movf uno,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf dos,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf tres,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cuatro,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cinco,0
movwf portb
rrf porta,1
call cont090
rlf porta,1
movf cero,0
movwf portb
return

cont090 movf cero,0


movwf portb
movf uno,0
movwf portb
movf dos,0
movwf portb
movf tres,0
movwf portb
movf cuatro,0
movwf portb
movf cinco,0
movwf portb
movf seis,0
movwf portb
movf siete,0
movwf portb
movf ocho,0
movwf portb
movf nueve,0
movwf portb
movf cero,0
movwf portb
return

delay1seg movlw 0x64


movwf cont
lazo2 call delay10ms
decfsz cont,1
goto lazo2
return

delay10ms bcf intcon,2


movlw 0xd9
movwf tmr
lazo3 btfss intcon,2
goto lazo3
return
end

Das könnte Ihnen auch gefallen