Foros de Electrónica

Comunidad de discusión sobre Automatización, Electrónica industrial, Microcontroladores y electrónica digital, Robótica, Domótica, Telemática, Tecnologías móviles, y muchos temas más.




timer con pic 16f84 5 segundo hasta 5m


       



#1  timer con pic 16f84 5 segundo hasta 5m
carlin38

Registrado: 28 Feb 2007
Mensajes: 10
citar
Hola haber quien se anima a ayudarme quiero hacer unos timer con pic 16f84 el problema es que no se como, con los tiempos siguientes: 5 segundo hasta 5 minutos por favor necesito ayuda

#2  
mabauti

Registrado: 22 Oct 2006
Mensajes: 1066
Ubicación: México
citar
intenta este programa:
http://www.todopic.com.ar/utiles/calcular_retardos.zip

#3  mabauti
carlin38

Registrado: 28 Feb 2007
Mensajes: 10
citar
gracias pero en realiadad necesito un planito para hacer el circuito si puedes mandarme uno
ya que lo e realizado en uno que tengo y solo me da un segundo el archivo que estoy usando

LIST p=16F84 ; PIC16F844 is the target processor

#include "P16F84.INC" ; Include header file

CBLOCK 0x10 ; Temporary storage
state
l1,l2
ENDC

org 0 ; Start up vector.
goto setports ; Go to start up code.

org 4 ; Interrupt vector.
halt goto halt ; Sit in endless loop and do nothing.

setports clrw ; Zero in to W.
movwf PORTA ; Ensure PORTA is zero before we enable it.
movwf PORTB ; Ensure PORTB is zero before we enable it.
bsf STATUS,RP0 ; Select Bank 1
clrw ; Mask for all bits as outputs.
movwf TRISB ; Set TRISB register.
bcf STATUS,RP0 ; Reselect Bank 0.

initialise clrw ; Initial state.
movwf state ; Set it.

loop call getmask ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop1 ; And loop Smile


getmask movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xfe ; state==0 is Green and Red.


;--------------------------------------------------------------------------------

loop1 call getmask1 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop2 ; And loop Smile


getmask1 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xfd ; state==0 is Green and Red.

;--------------------------------------------------------------------------------

loop2 call getmask2 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop3 ; And loop Smile


getmask2 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xfb ; state==0 is Green and Red.
;--------------------------------------------------------------------------------

loop3 call getmask3 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop4 ; And loop Smile


getmask3 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xf7 ; state==0 is Green and Red.

;--------------------------------------------------------------------------------

loop4 call getmask4 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop5 ; And loop Smile


getmask4 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xef ; state==0 is Green and Red.

;--------------------------------------------------------------------------------

loop5 call getmask5 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop6 ; And loop Smile


getmask5 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xdf ; state==0 is Green and Red.

;--------------------------------------------------------------------------------

loop6 call getmask6 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop7 ; And loop Smile


getmask6 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0xbf ; state==0 is Green and Red.

;--------------------------------------------------------------------------------

loop7 call getmask7 ; Convert state to bitmask.
movwf PORTB ; Write it to port.
incf state,W ; Increment state in to W.
andlw 0x04 ; Wrap it around.
movwf state ; Put it back in to memory.
call DELAY ; DELAY Smile
goto loop ; And loop Smile


getmask7 movf state,W ; Get state in to W.
addwf PCL,F ; Add offset in W to PCL to calc. goto.
retlw 0x7f ; state==0 is Green and Red.



; De aqui para abajo este es un tiempo.
wait1 movlw 999
movwf l1

w1 call wait2
decfsz l1
goto w1

return


wait2 clrf l2
w2 decfsz l2
goto w2
return

PORTB EQU 06H
VAR1 EQU 0CH ;Variables para
VAR2 EQU 0DH ;nuestra rutina de Retardo
VAR3 EQU 0EH ;nuestra rutina de Retardo


i EQU 0FH ;Variable de los cambios del semaforo

;*************************************************************************
DELAY MOVLW 20H ;Rutina de Ratardo
MOVWF VAR3

SALTO MOVLW 100H

MOVWF VAR2

SALTO2 MOVLW 20H

MOVWF VAR1

SALTO1 DECFSZ VAR1,1

GOTO SALTO1

DECFSZ VAR2,1

GOTO SALTO2

DECFSZ VAR3,1

GOTO SALTO


RETURN
END

pero solo es un secuenciador quiero variarles los tiempos
otra cosa en el MPLAB se simulan bien pero en el circuito practico no por favor si puedes ayudarme

#4  REspuesta
yack

Registrado: 28 Nov 2007
Mensajes: 5
Ubicación: apizaco
citar
Puedes hacerlo con retardos incluyendolos en una libreria dentro de tu programa y para controlarlos puedes hacerlo con un control binario apartando una seccion de entradas. para la simulacion puedes hacerlo con el proteus este funciona muy bien espero te sirva mi ayuda

 Responder



Google
 


 Temas de interés 
No hay mensajes nuevos Cambiar direccion de giro de motor cada segundo...
No hay mensajes nuevos Oscilador de un segundo
No hay mensajes nuevos Cronometro con centesimas de segundo
No hay mensajes nuevos tv enciende al segundo intento
No hay mensajes nuevos subrutina de retardo de un segundo

Foros de Electronica
|| Cuestiones Elementales de Electrónica || Fuentes de alimentacion || Circuitos de radio || Diseño de circuitos en general ||
|| Sistemas de Audio: Preamplificadores, Ecualizadores || Amplificadores || Reparación || Discusión ||
|| Microcontroladores y sistemas embebidos || Circuitos logicos combinacionales y secuenciales || Interfaces y Programacion || Dudas en general || Sistemas de Video || PC Hardware || Telematica y comunicaciones || Tecnologias moviles || Software Electronico || Robotica, Domotica y Mecatronica || Autotrónica || Automatizacion, Electronica industrial y de Potencia || Documentacion, circuitos y esquemas || Donde Las Ideas Convergen... || Tutoriales y Manuales || Proyectos Prácticos ||