Pic 16F84A chenillard
Résolu
zizou5roni
Messages postés
25
Date d'inscription
Statut
Membre
Dernière intervention
-
robervalll -
robervalll -
Bonjour,
je cherche le code source de la realisation d'un chenillard a l'aide du PIC 16F84A
merci de m'aider
je cherche le code source de la realisation d'un chenillard a l'aide du PIC 16F84A
merci de m'aider
A voir également:
- Lognes pic 77 lettre recommandée
- Clavier iphone chiffre et lettre - Guide
- Roissy courrier international pic ✓ - Forum Laposte
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Entrée dans le réseau des pic - Forum Consommation & Internet
- Lettre recommandée 2d 049 ✓ - Forum Logiciels
1 réponse
;---------------------------example d'application avec un pic: ---------------------
;
;titre:Chenillard
;date:19/12/2008
;auteur:HITMMAN
;pic utilisé:16f84A
;
;
;------------------------directive d'assemblage pour MPLAB------------------------------------
processor 16f84a
#include <p16f84a.inc>
__config 3ff9h
;-------------------------definition des constantes-----------------------------------------
#define bouton 4
;-------------------------definition des registres----------------------------------------
retard1 EQU 0x22
retard2 EQU 0x24
memo EQU 0x26
;-------------------------remise a zero----------------------------------------------------
org 0x00
goto start
;------------------------initialisation des ports-----------------------------------------
start
bsf STATUS,5
movlw 0x00
movwf TRISB
movlw 0x1f
movwf TRISA
bcf STATUS,5
;-------------------------initialisation des LEDs----------------------------------------
clrf PORTB
movlw 0x01
movwf memo
;-------------------------programme principal--------------------------------------------
debut
btfss PORTA,bouton
goto debut
bsf STATUS,C
debut1
movf memo,w
movwf PORTB
call tempo
RLF memo,f
goto debut1
;-----------------------sousprogramme de temporisation------------------------------------
tempo
movlw 0xaa
movwf retard1
movwf retard2
attente
decfsz retard1,f
goto attente
movlw 0xff
movwf retard1
decfsz retard2,f
goto attente
return
;-------------------------sous programme de table affiche---------------------------------
;-----------------------------------------------------------------------------------------
END
;
;titre:Chenillard
;date:19/12/2008
;auteur:HITMMAN
;pic utilisé:16f84A
;
;
;------------------------directive d'assemblage pour MPLAB------------------------------------
processor 16f84a
#include <p16f84a.inc>
__config 3ff9h
;-------------------------definition des constantes-----------------------------------------
#define bouton 4
;-------------------------definition des registres----------------------------------------
retard1 EQU 0x22
retard2 EQU 0x24
memo EQU 0x26
;-------------------------remise a zero----------------------------------------------------
org 0x00
goto start
;------------------------initialisation des ports-----------------------------------------
start
bsf STATUS,5
movlw 0x00
movwf TRISB
movlw 0x1f
movwf TRISA
bcf STATUS,5
;-------------------------initialisation des LEDs----------------------------------------
clrf PORTB
movlw 0x01
movwf memo
;-------------------------programme principal--------------------------------------------
debut
btfss PORTA,bouton
goto debut
bsf STATUS,C
debut1
movf memo,w
movwf PORTB
call tempo
RLF memo,f
goto debut1
;-----------------------sousprogramme de temporisation------------------------------------
tempo
movlw 0xaa
movwf retard1
movwf retard2
attente
decfsz retard1,f
goto attente
movlw 0xff
movwf retard1
decfsz retard2,f
goto attente
return
;-------------------------sous programme de table affiche---------------------------------
;-----------------------------------------------------------------------------------------
END
;**l'en tete du programme ***
PROCESSOR 16F84A
INCLUDE <P16F84A.INC>
__CONFIG H'3FF9'
CBLOCK 0X0C
VAR1; variable de travail
COMPTEUR
ENDC
ORG 00
GOTO DEBUT
DEBUT BSF STATUS,RP0
MOVLW H'1F' ;*****configuration du porta en entrée
MOVWF TRISA
MOVLW H'00'
MOVWF TRISB;*****configuration du portb en sortie
BCF STAUS,RP0
BSF OPTION_REG,INTEDG;***** Interruption en front montant
BSF INTCON,INTE;******autorisation d'interruption sur RB0
BSF INTCON,GIE ;******* validation generale des interruptions
NOP
END