INFO - FAQ - CC2-Forum - CCPro-Forum |
> Hallo, > > > > > function writebyte() > > > > lcd.off > > > > IIC.init > > IIC.stop > > IIC.start > > IIC.send dev > > IIC.send ADDRHI > > IIC.send ADDRLO > > IIC.send DATA > > IIC.stop > > IIC.off > > > > for temp = 0 to 50 'Warteschleife zur Sicherstellung, daß > > next temp 'das Byte zuverlässig geschrieben wird > > > > end function > > > > besser wäre es das CONFIG Register zu prüfen, ob ein Fehler mit der IIC Kommunikation vorliegt: > > > function writebyte() > with iic > .init > .stop > .start > .send dev > .send addrhi > .send addrlo > .send data > .stop > .off > end with > > define tconfig as byte > > do > config.init > config.get tconfig > if(tconfig and 01000000b) = then goto skip > tconfig = tconfig and 10111111b > config.off > loop > > > #skip > > end function > > > Nachtrag: Zur Not könnte man das mit dem Config Register ja noch mal mit einem Timer so verändern, dass eine Zeitüberschreitung nach x Sekunden abgefangen wird. Meine Homepage: http://www.fdos.de |
Antwort schreiben |