Hallo oiermann,
ah ja, jetzt kapiere ich den TLC549.
Probier mal mit folgendem rum (keine Garantie, ich kanns ja nicht testen!):
Code:
$regfile = "2313def.dat"
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.0 , Db5 = Portd.1 , Db6 = Portd.2 , Db7 = Portd.3 , E = Portd.5 , Rs = Portd.4
Config Lcdbus = 4
Config Pinb.3 = Output
Cs Alias Portb.3
Cs = 0 'Strobe low
Config Pinb.2 = Input
Eingabepin Alias Portb.2
Config Pinb.1 = Output
Io_clock Alias Portb.1
Io_clock = 0 'Clock low
Dim Cntr As Byte
Dim Ergebnis As Byte
Do
Cs = 1 'Strobe high
Cs = 0 'Strobe low
Ergebnis = 0
For Cntr = 0 To 7
Shift Ergebnis , Left , 1
Ergebnis = Ergebnis + Eingabepin
Io_clock = 1 'Clock high
Io_clock = 0 'Clock low
Next Cntr
' Waitus 17 '17us warten
' (Nur nötig, wenn sofort eine neue Messung erfolgt!)
Cls
Locate 1 , 1
Lcd Ergebnis
Wait 3
Loop
Die Ausgabe ist natürlich jetzt noch nicht in Volt, sondern der Digitalwert (0..255), der in eine Spannung umgerechnet werden muss.
Gruß Dirk
Lesezeichen