Simple question about Sensirion from OBEX
port513
Posts: 50
Just wanted to know if I'm thinking wrong or if the code is slightly wrong [noparse];)[/noparse]
In the above code the dataline is driven HIGH, but when I read about SHT1x it tells me to never drive the DATA high
In the above code the data is set high through the tri-state and a pull-up resistor.
Why is the DATA used in this two ways? Is it possible in the PUB Main to use the same pull-up to initiate a reset?
/Henke
PUB start(data_pin, clock_pin) ' assign SHT-11 clock and data pins and reset device dpin := data_pin ' assign data pins cpin := clock_pin ' assign clock pin outa[noparse][[/noparse]cpin]~ ' set clock low dira[noparse][[/noparse]cpin]~~ outa[noparse][[/noparse]dpin]~~ ' set data high dira[noparse][[/noparse]dpin]~~ REPEAT 9 ' send 9 clock pulses for reset !outa[noparse][[/noparse]cpin] !outa[noparse][[/noparse]cpin]
In the above code the dataline is driven HIGH, but when I read about SHT1x it tells me to never drive the DATA high
PRI sendCommand(cmd) ' send transmission start sequence ' clock  ' data  dira[noparse][[/noparse]dpin]~ ' data high (pull-up) ' outa[noparse][[/noparse]cpin]~ ' clock low outa[noparse][[/noparse]cpin]~~ ' clock high outa[noparse][[/noparse]dpin]~ ' data low dira[noparse][[/noparse]dpin]~~ outa[noparse][[/noparse]cpin]~ ' clock low outa[noparse][[/noparse]cpin]~~ ' clock high dira[noparse][[/noparse]dpin]~ ' data high (pull-up) ' outa[noparse][[/noparse]cpin]~ ' clock low return writeByte(cmd) ' send command and return ACK
In the above code the data is set high through the tri-state and a pull-up resistor.
Why is the DATA used in this two ways? Is it possible in the PUB Main to use the same pull-up to initiate a reset?
/Henke