Hallo André,
Wie man kan kein eProgramme übertragen? Mit Treibern meinst du doch so Standardroutienen, wie z.B. zum ansteuern eines LCDs, I²C oda so?
Code:
define SDA Port[9]
define SCL Port[10]
define I2C_Daten byte
define N byte
SDA=ON
SCL=ON
...
#I2C_Start
SDA=OFF
SCL=OFF
return
#I2C_Stop
SDA=OFF
SCL=ON
SDA=ON
return
#I2C_Write
for N=1 to 8
SDA=OFF
if (I2C_Daten and 128) =128 then SDA=ON
pulse SCL
I2C_Daten=I2C_Daten shl 1
next
pulse SCL
return
#I2C_Read
I2C_Daten=0
deact SDA
for n=1 to 8
I2C_Daten=I2C_Daten shl 1
SCL=ON
if SDA then I2C_Daten=I2C_Daten+1
SCL=OFF
next
return
#Ack
SDA=0
pulse SCL
return
#NoAck
SDA=1
pulse SCL
return
Code:
define lcd byteport[2]
define rw port[13]
define rs port[14]
define e port[15]
define buffer byte
define parameter byte
gosub initialisierung
pause 10
...
#initialisierung
lcd=off
parameter=&h38:gosub command
lcd=&b00000010
tog e
tog e
parameter=&h28:gosub command
parameter=&h0c:gosub command
#clear
parameter=&h02:gosub command
parameter=&h02:gosub command
return
#whichline
if parameter=1 then parameter=&h80
if parameter=2 then parameter=&hc0
goto command
#command
buffer=off
goto write_
#writeletter
buffer=&b00100000
#write_
lcd=buffer or (parameter shr 4)
tog e
tog e
lcd=buffer or (parameter and &h0f)
tog e
tog e
return
Die hier sind für die CC1
Lesezeichen