[sclug] thermometer accessory for my raspberry pi

Mark Robson markxr at gmail.com
Thu Aug 9 14:39:51 UTC 2012


Chris, Hi,

A 1k-ohm pull-up resistor is shown on the circuit diagram on page 2. This
may not be entirely clear.

The protocol is pretty similar to how you described it last night.

Good luck getting the R? to speak that protocol though. Without a
controller chip of any kind, it's going to be difficult to effectively
measure the length of pulses which are 25-70 microseconds long.

I suppose a tight loop spinning in kernel-mode busy-reading the GPIO (and
the clock) could decipher it though, maybe with IRQs disabled. It would
only need to spin until the end of the packet, which is only 5 bytes ( * 8
bytes * 75 microseconds) = 4.8 milliseconds.

Trying to read the GPIO at that speed from user-space is going to be
more-or-less impossible; if any hardware interrupt occurs from another
device, you'll lose too much time.

Mark



More information about the Sclug mailing list