I can confirm the sensor works with a Cortex M4 microcontroller (Udoo neo full) with an Arduino sketch with Adafruit Arduino library. Same wires, same jumpers.
Il giorno lunedì 13 febbraio 2017 15:55:04 UTC+1, Dennis Lee Bieber ha scritto: > > On Mon, 13 Feb 2017 04:57:49 -0800 (PST), Davide Aguiari > <[email protected] <javascript:>> declaimed the following: > > >The problem is here, in bbb_dht_read.c > > > >// Record pulse widths for the expected result bits. > > for (int i=0; i < DHT_PULSES*2; i+=2) { > > // Count how long pin is low and store in pulseCounts[i] > > while (!bbb_mmio_input(pin)) { > > if (++pulseCounts[i] >= DHT_MAXCOUNT) { > > // Timeout waiting for response. > > set_default_priority(); > > printf("PulseCounts[i]: %d \n",pulseCounts[i]); > > return DHT_ERROR_TIMEOUT; > > } > > } > > > >bbb_mmio_input(pin) returns 0 too much time and it returns > >DHT_ERROR_TIMEOUT. > > > > At this stage I'd recommend either: a) try the sensor on something > without an OS -- an Arduino, for example (I'm sure AdaFruit have a library > for those); or b) tap into the lines with an oscilloscope (or logic > analyzer) to check for 1) the "wake-up" signal sent by the BBB to the > device and 2) the variable width return data from the device. {Worst case, > tap into the signal line with a transistor driving an LED -- you might be > able see the LED flicker during the pulse train} > > If you don't see the "wake-up" pulse, you likely have a > misconfigured > output GPIO pin. If you see that pulse but nothing coming back you have a > faulty sensor. If you see the return pulse sequence you likely have a > misconfigured input GPIO pin. As I recall, these sensors use the same pin > for both, which means being able to toggle the pin from output to input > during the short period after the "wake-up" and before the device starts > responding. I'd hope the library does that -- but if it didn't set > pull-up/pull-down you may have the wrong state on the line. > -- > Wulfraed Dennis Lee Bieber AF6VN > [email protected] <javascript:> HTTP://wlfraed.home.netcom.com/ > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/9678dc20-b0da-43a8-bbc6-cfa7a343d8ec%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
