Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: SPI device connection woes
Dave Tyson <dtyson%anduin.org.uk@localhost> writes:
> On Mon, 2023-03-20 at 17:37 -0400, Brad Spencer wrote:
>
[snip]
>> Is there a data sheet for your device somewhere??
>
> https://www.analog.com/media/en/technical-documentation/data-sheets/MAX31865.pdf
>
> It looks pretty straightforward to read the temperature with minimal
> register accesses. There are a some extra registers for setting
> thresholds and detecting and diagnosing broken connections between the
> chip and the sensor. I will have a look at writing a userland driver in
> a couple of weeks time. I decided to use a 4 wire resistive element as
> this gives the greatest accuracy and they are a reasonable price...
>
> Thanks for your help and the additional info on the scmd stuff.
>
> Dave
Ya, that device won't be too bad to work with. You can probably get the
one shot mode working with userland SPI without much trouble. It
appears to use the "set or clear high bit" method to switch between
reading and writing of a register. This is pretty common, it seems.
Both the Bosch chips and the SCMD device did the same thing, although
one of the Bosch chips had registers greater than 0x80 which meant that
a page mode concept had to be used to flip between two different
register pages when using SPI.
Of course, you can't put the metrics into sysmon_envsys(9) with a
userland program, but that may not matter to you.
Have fun.. looks like an interesting project.... the continuous mode
of that chip would be well suited for sub-second queries, but that may
require a kernel driver to get to work consistently. I did that for the
SHT3x chip which can do sub-second queries of the environmental metrics
by allowing a /dev/ device to exist in addition to placing the metrics
in sysmon_envsys(9).
--
Brad Spencer - brad%anduin.eldar.org@localhost - KC8VKS - http://anduin.eldar.org
Home |
Main Index |
Thread Index |
Old Index