ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Semaforo 4 Vias Con Pic 16f84


Enviado por   •  5 de Septiembre de 2011  •  1.673 Palabras (7 Páginas)  •  2.048 Visitas

Página 1 de 7

#include <p16f84.inc>

PDel0 equ 0x0c ;comando de las temporizaciones

PDel1 equ 0x1d

PDel2 equ 0x2e

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

Bsf STATUS,5

movlw 0x01 ;carga puerto A como entrada (pulsador)

movwf TRISA

movlw 0x00 ;carga puerto B como salida

movwf TRISB

bcf STATUS,5

ORG 6

movlw 0X00

movwf PORTB

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

inicio

btfss PORTA,0

goto inicio

jump movlw 0x24 ; rojo de ambos 0010 - 0100

movwf PORTB;24

call DEMORA3

movlw 0x84 ; Verde S1 Rojo S2 1000 - 0100

movwf PORTB;84

call DEMORA1

movlw 0x44 ; Amarillo S1 Rojo S2 0100 - 0100

movwf PORTB;44

call DEMORA2

movlw 0x24 ; Rojo ambos 0010 - 0100

movwf PORTB; 24

call DEMORA3

movlw 0x21 ; Rjo S1 verde S2 0010 - 0001

movwf PORTB;21

call DEMORA1

movlw 0x22 ; Rojo S1 Amarillo S2 0010 - 0010

movwf PORTB;22

call DEMORA2

GOTO jump

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

DEMORA1 movlw .100 ; 1 set numero de repeticion (C)

movwf PDel0 ; 1 |

PLoop0 movlw .55 ; 1 set numero de repeticion (B)

movwf PDel1 ; 1 |

PLoop1 movlw .201 ; 1 set numero de repeticion (A)

...

Descargar como (para miembros actualizados)  txt (3.7 Kb)  
Leer 6 páginas más »
Disponible sólo en Clubensayos.com