- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I'm attempting to use a PSOC 5LP to read data from a SHT75 Temperature & Humidity sensor (https://www.sensirion.com/en/environmental-sensors/humidity-sensors/pintype-digital-humidity-sensors...
In order to read data from the sensor, I need two pins (clock and data). At the moment, I configured my clock pin as a Digital Output (Strong Drive), and my data pin as a Bidirectional Pin (Open Drain Drives Low). The clock pin is working fine with the functions I created, while the data pin is not working as expected: do I need to dynamically change the configuration of the data pin whenever I need to write/read from it? How should I connect the bidirectional pin (pull-up resistor?)?
Thanks,
Davide
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
See datasheet of SHT75:
To avoid signal contention the microcontroller must only drive DATA low. An external pull-up resistor
(e.g. 10 kΩ) is required to pull the signal high – it should be noted that pull-up resistors may be included in I/O circuits of microcontrollers.
So best would be to configure the pin as "Resistive pull up" initial drive high. Then you may write low to the sensor and while written high you may read from the pin.
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
thanks for your kind reply.
In the configuration you suggested me, would the data line of the sensor be able to pull the PSoC pin down to 0 when required? As per the datasheet, after a command is sent to the sensor (8 clock pluses with 8 data bits), a ninth clock pulse should be issued and the data line should go down to 0.
Thanks,
Davide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
would the data line of the sensor be able to pull the PSoC pin down to 0 when required?
Yes, sure.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bob,
thank you for your answer. I did some tests this morning with the following setup:
- clock line as output pin - strong drive
- data line as bidirectional pin, resistive pull up and initial state as HIGH.
I did some tests looking at the data and clock signals during some basic procedures (start transmission and reset communications), and the signals are as expected. When I send a command to the sensor (start transmission procedure + command sent as per datasheet specs), I expect the sensor to push the data line low after the ninth clock pulse. But what happens, as you can see from the attached image, is that the data line goes down after receiving the 8 bits of the command, but then at the clock pulse, goes up (not to Vdd, but a little lower): do you have any suggestions about what could cause this problem?
Thank you very much in advance,
Davide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to the datasheet the data line should not stay low, but will be low after the measure is done (80ms).
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, it will be low after the measurement is complete. But according to the datasheet it should be low also at the end of the command for the acknowledgment bit, as visible in the attached image.