activer RB3 sur pic16f88

Bonjour,

En essayant de mettre RB0 à RB7 en sortie ( resistance + led ), j'ai remarqué que la led sur RB3 restait eteinte

BSF STATUS,5 MOVLW 0x00 MOVWF TRISB BCF STATUS,5

MOVLW 0xFF MOVWF PORTB

normalement avec ce code toutes les led de RB0 à RB7 devraient être allumées . J'ai ajouté ceci ( d'après ce que j'ai trouvé sur le net )

MOVLW 0x00 MOVWF CCP1CON

mais ça ne marche pas .

quelqu'un a t il une idée pour activer RB3 sur un pic16f88

Merci .

Reply to
steph
Loading thread data ...

il faut mettre le bit 7 de CONFIG1(addr=2007) à zero pour utiliser rb3 comme I/O datasheet page 132 LVP: Low-Voltage Programming Enable bit

1 = RB3/PGM pin has PGM function, low-voltage programming enabled 0 = RB3 is digital I/O, HV on MCLR must be used for programming

Cordialement,

--
----------
Kripton

the ESR Repository @ http://kripton2035.free.fr/esr-repository.html
the Geiger Repository @ http://kripton2035.free.fr/geiger-repositor.html
Reply to
Kripton

Excellent grace à ta solution , j'ai ajouté la ligne suivante

__CONFIG _CONFIG1, LVP_OFF ; ça correspond à 3F7F ( 7eme bit à 0 )

et ça fonctionne , la led s'allume en rb3

Mais mieux que ça , ta solution m'a permis de trouver la solution sur l'horloge interne en ajoutant ceci

__CONFIG _CONFIG1, _LVP_OFF & _INTRC_CLKOUT ; ça correspond à 3F7F (bit 7 =0 ) et 3FFD (bit 2 =0) = 3F7D

+

la partie trouvé sur

formatting link

pour mettre à 4 mhz

f_4MHz

bank1 movlw B'01100000' movwf OSCCON ; bit 6 (IRCF2) = 1 ; bit 5 (IRCF1) = 1 ; bit 4 (IRCF0) = 0 ; Internal RC Oscillator Frequency = 4 MHz bank0

et ça fonctionne sur RA6 (pate 15) j'ai un signal f/4 = 1 Mhz

grand merci pour l'aide .

Reply to
steph

t'as été plus rapide que moi !

c'est un défaut chez la famille PIC, ils ont chacun des petites subtilités qui transforment le portage vers une autre ref en un vrai casse tête.

j'ai moi aussi perdu du temps avec de problème.

JJ

Reply to
jj

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.