Torna indietro   BaroneRosso.it - Forum Modellismo > Elettronica > Circuiti Elettronici


 
 
Strumenti discussione Visualizzazione
Prev Messaggio precedente   Prossimo messaggio Next
Vecchio 09 aprile 06, 13:30   #2 (permalink)  Top
User
 
Data registr.: 28-05-2005
Residenza: Roma
Messaggi: 660
Vi posto qui di seguito quella parte del datasheet che mi è molto oscura..... vi prego qualcuno mi aiuti..... è la prima volta che provo a programmare il 16f628, e non ho capito una parte del datasheet a mio avviso importante.... .

-----------------------------------------------------------------------
For example, a BSF operation on Bit 5
of PORTB will cause all eight bits of PORTB to be read
into the CPU. Then the BSF operation takes place on
Bit 5 and PORTB is written to the output latches. If
another bit of PORTB is used as a bi-directional I/O pin
(e.g., Bit 0) and it is defined as an input at this time, the
input signal present on the pin itself would be read into
the CPU and rewritten to the data latch of this particular
pin, overwriting the previous content. As long as the pin
stays in the Input mode, no problem occurs. However,
if Bit 0 is switched into Output mode later on, the
content of the data latch may now be unknown.
-----------------------------------------------------------------------



E anche il piccolo esempietto che segue poco dopo:



-----------------------------------------------------------------------
;Initial PORT settingsORTB<7:4> Inputs
;
; PORTB<3:0> Outputs
;PORTB<7:6> have external pull-up and are not
;connected to other circuitry
;
; PORT latchPORT Pins
---------- ----------
BCF STATUS, RP0 ;
BCF PORTB, 7 ;01pp pppp 11pp pppp
BSF STATUS, RP0 ;
BCF TRISB, 7 ;10pp pppp 11pp pppp
BCF TRISB, 6 ;10pp pppp 10pp pppp
;
;Note that the user may have expected the pin
;values to be 00pp pppp. The 2nd BCF caused
;RB7 to be latched as the pin value (High).
-----------------------------------------------------------------------


Non riesco a capire, di quando parla perchè finche il segnale di input di quel pin
resta input non ci sono problemi, ma se viene cambiato in output genera un valore
sconosciuto, poi quando si riferisce a: " .... the pin itself would be....." si
riferisce al bit 0 o al bit 5?
Grazie ancora
SoldatoSemplice non è collegato   Rispondi citando
 

Bookmarks




Regole di scrittura
Non puoi creare nuove discussioni
Non puoi rispondere alle discussioni
Non puoi inserire allegati
Non puoi modificare i tuoi messaggi

BB code è Attivato
Le faccine sono Attivato
Il codice [IMG] è Attivato
Il codice HTML è Disattivato
Trackbacks è Disattivato
Pingbacks è Disattivato
Refbacks è Disattivato


Discussioni simili
Discussione Autore discussione Forum Commenti Ultimo Commento
brand misterioso Corrado Aeromodellismo 2 23 febbraio 07 15:58
Power Datasheet danverz Elimodellismo Motore Elettrico 2 16 gennaio 06 17:53
Oggetto misterioso...... mephisto Aeromodellismo Volo Elettrico 49 25 ottobre 05 09:32
Datasheet batterie Lipo Paperinik Aeromodellismo Volo Elettrico 6 25 aprile 04 14:26



Tutti gli orari sono GMT +2. Adesso sono le 03:56.


Basato su: vBulletin versione 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
E' vietata la riproduzione, anche solo in parte, di contenuti e grafica. Copyright 1998/2019 - K-Bits P.I. 09395831002