Pic 16F84A chenillard

Résolu/Fermé
zizou5roni Messages postés 25 Date d'inscription mercredi 23 janvier 2008 Statut Membre Dernière intervention 5 décembre 2008 - 30 mai 2008 à 18:45
 robervalll - 4 mars 2009 à 13:08
Bonjour,
je cherche le code source de la realisation d'un chenillard a l'aide du PIC 16F84A
merci de m'aider
A voir également:

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
4
ok mon frère voici la reponse a ta question ce programme permet d'effectuer le chenillard a la suit d'une interruption sur rb0
;**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
0