Salut à tout le monde.
j'ai un probleme avec ma liaison série.
je veux juste savoir si j'ai reçu un caractere.
j'ai réalisé un montage la sortie(une trame) de ce dernier sera l'entrée de mon pic16F873(broche RX de mon pic). si veux juste allumer une led dès que je reçois un caractère.
je n'utilise pas de timer ni d'interruptions.
je suis en mode asynchrone et j'ai une vitesse de 9600 bauds.
Vos suggestions et remarques sont les bienvenues.
Merci à tout le monde.

Voici mon code:

****************************** ****************************

list p=16f873 ; list directive to define processor
#include <p16f873.inc> ; processor specific variable definitions

__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_OFF & _XT_OSC

; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.

;***************************** ****************************** ************************
;***** VARIABLE DEFINITIONS
;CBLOCK 0x00C
;w_temp EQU 0x20 ; variable used for context saving
;status_temp EQU 0x21 ; variable used for context saving
;count EQU 0x22 ; temporary variable
;vitesse :25

;ENDC


;***************************** ****************************** ***********************
RESET_VECTOR CODE 0x000 ; processor reset vector
;movlw high start ; load upper byte of 'start' label
;movwf PCLATH ; initialize PCLATH
goto start ; go to beginning of program


;INT_VECTOR CODE 0x000 ; interrupt vector location
;movwf w_temp ; save off current W register contents
;movf STATUS,w ; move status register into W register
;bcf STATUS,RP0 ; ensure file register bank set to 0
;movwf status_temp ; save off contents of STATUS register


; isr code can go here or be located as a call subroutine elsewhere


;bcf STATUS,RP0 ; ensure file register bank set to 0
;movf status_temp,w ; retrieve copy of STATUS register
;movwf STATUS ; restore pre-isr STATUS register contents
;swapf w_temp,f
;swapf w_temp,w ; restore pre-isr W register contents
;retfie ; return from interrupt


;***************************** ****************************
; Programme Principal *
;***************************** ****************************


MAIN CODE
start
;SPBRG=Baud Rate Generator Register

InitA
bcf STATUS,RP0
bcf STATUS,RP1
clrf PORTA ; efface le PORTA
bsf STATUS,RP0 bcf STATUS,RP1
movlw 0x06
movwf ADCON1
movlw b'00000000'
movwf TRISA
InitC
clrf PORTC
movlw 0x06 ; PORTC = digital input/output
movlw b'10000000' movwf TRISC


;Procédure suivu pour la Réception asynchrone

movlw D'25' ;25 pour vitesse de 9600 Bauds
movwf SPBRG ;Vitesse 9600 bauds
bsf TXSTA,BRGH bcf TXSTA,SYNC ;mode asynchrone
bsf RCSTA,SPEN ;serial port enable
bcf PIE1,RCIE ;pas d'interruption sur reception
bcf RCSTA,RX9
bsf RCSTA,CREN ;reception continue enable
goto Reception

;fin du Programme Principal

Reception
btfss PIR1,RCIF
goto Reception
movf RCREG,W
goto allume_led
;return

allume_led
bsf PORTA,1 ;la led est au PORTA,1 goto Reception

END ;directive fin de programme