Dear all,
I want to measure humidity by using an humidity sensor RHT03.
It's a digital sensor, and output 40 bits signal response.
but the way it outputs is little bit strange.
MCU send out start signal to RHT03 and RHT03 send response signal to MCU
RHT03 send data to MCU When RHT03 is sending data to MCU, every bit's transmission begin with low-voltage-level that last 50us, the following high-voltage-level signal's length decide the bit is "1" or "0".
I don't know how to interface my cortex M3 (st32f107) with this sensor? What interface should I use?
I wanted to use GPIO. But the sensor interface with the MCU by only one bus (for both ways of transmission: for receiving and sending data).
the datasheet can be found here www.google.com.vn/url
Maybe SPI?
An interesting thing - in the summary you write Cortex M3 as if that is important information. Shouldn't it be the actual chip name that is the important information - Cortex M3 doesn't say much about the processor peripherial capabilities so it's not summing up the issues unles your question is related to assembler instructions for the processor core.
Thank you for your response.
I asked about Cortex M3 because I have some development kits of ST32F106 and ST32F107. I'm not sure can I use ST32F107, that 's the reason I don't want to put ST32F107 into the summary. Sorry, if I made you confused.
can I use SPI with only one data wire? I read in the datasheet and reference manual, ussually SPI has clock and data.
Can you show me a little bit more details, because I'm quite new in this field of programming SPI
Best regards
Yes, SPI has clock and data. But the clock signal is only relevant if the other side also runs a synchronous transfer. So you do not use this signal.
But you can use the MISO and MOSI lines together to send and receive onewire data. Just remember that you need to add a bit of glue to make the transmit pin (MOSI) "open-collector" so it can drive the line when it wants to, but leaves the signal idle when the sensor is driving the wire. The MISO will just listen - analyze what it has and decide if you have seen a zero or a one.
Just a footnote - some people instead use a UART for onewire communication.
On the STM32 using the TIM in Input Capture or PWM Input mode might be the easiest to manage the response stream.
Bit-Banging ?
Thank you all for your support. I will try. Best regards