- ;;;;;;;;;;;;;;;;;;;;;;;;text du 15/3/2009;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
- LIST P=16F84, R=DEC
- #include "P16F84.INC"
-
- __CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC
- __IDLOCS 1998h
-
-
-
- mv1 EQU h'0C'
- mv2 EQU h'0D'
- mv3 EQU h'0E'
- mv4 EQU h'0F'
-
-
-
-
- ORG 0x004
- GOTO projet
- ;;;;;;;;;;;;;;;;;;;;;;;;; zorne des souprogrammes;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- projet ; contiguration des ports du pic
-
- bsf STATUS,RP0 ; passé en banque 1
-
- ; 1 pour dit en entrée OU 0 en sortie
- movlw b'00100' ; 0 0 1 0 0
- movwf TRISA ; A4 A3 A2 A1 A0
- movlw b'00000000' ; 0 0 0 0 0 0 0 0
- movwf TRISB ; B7 B6 B5 B4 B3 B2 B1 B0
-
- bcf STATUS,RP0 ; passé en banque 0
-
- clrf PORTA ; effacé les ports du pic portA
- clrf PORTB ; effacé les ports du pic portB
-
-
- program ; debut du program
-
- btfss PORTA,2
- bsf PORTA,0
- call tempo
- btfsc PORTA,2
- bcf PORTA,0
- call tempo
-
- btfss PORTA,2
- bsf PORTA,1
- call tempo
- btfsc PORTA,2
- bcf PORTA,1
- call tempo
-
- btfss PORTA,2
- bsf PORTB,0
- call tempo
- btfsc PORTA,2
- bcf PORTB,0
- call tempo
-
- btfss PORTA,2
- bsf PORTB,2
- call tempo
- btfsc PORTA,2
- bcf PORTB,2
- call tempo
-
-
-
- goto program ; retour au program
-
- ;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
-
- tempo
-
- movlw d'255'
- movwf mv1
- movlw d'255'
- movwf mv2
-
-
-
- gf decfsz mv1,f ; -1 du contenu de mv1 saut si mv1 = 0
- goto gf
- decfsz mv2,f ; -1 du contenu de mv2 saut si mv2 = 0
- goto gf
-
-
- return
-
-
- ;;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
-
-
-
-
-
- ;;;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- END ; fin du projet
-
-
;;;;;;;;;;;;;;;;;;;;;;;;text du 15/3/2009;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LIST P=16F84, R=DEC
#include "P16F84.INC"
__CONFIG _CP_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC
__IDLOCS 1998h
mv1 EQU h'0C'
mv2 EQU h'0D'
mv3 EQU h'0E'
mv4 EQU h'0F'
ORG 0x004
GOTO projet
;;;;;;;;;;;;;;;;;;;;;;;;; zorne des souprogrammes;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
projet ; contiguration des ports du pic
bsf STATUS,RP0 ; passé en banque 1
; 1 pour dit en entrée OU 0 en sortie
movlw b'00100' ; 0 0 1 0 0
movwf TRISA ; A4 A3 A2 A1 A0
movlw b'00000000' ; 0 0 0 0 0 0 0 0
movwf TRISB ; B7 B6 B5 B4 B3 B2 B1 B0
bcf STATUS,RP0 ; passé en banque 0
clrf PORTA ; effacé les ports du pic portA
clrf PORTB ; effacé les ports du pic portB
program ; debut du program
btfss PORTA,2
bsf PORTA,0
call tempo
btfsc PORTA,2
bcf PORTA,0
call tempo
btfss PORTA,2
bsf PORTA,1
call tempo
btfsc PORTA,2
bcf PORTA,1
call tempo
btfss PORTA,2
bsf PORTB,0
call tempo
btfsc PORTA,2
bcf PORTB,0
call tempo
btfss PORTA,2
bsf PORTB,2
call tempo
btfsc PORTA,2
bcf PORTB,2
call tempo
goto program ; retour au program
;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
tempo
movlw d'255'
movwf mv1
movlw d'255'
movwf mv2
gf decfsz mv1,f ; -1 du contenu de mv1 saut si mv1 = 0
goto gf
decfsz mv2,f ; -1 du contenu de mv2 saut si mv2 = 0
goto gf
return
;;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;; sous-programme ;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
END ; fin du projet