10 years, 1 month ago.

_repClock.read_ms() check

DMU.cpp

while (_repClock.read_ms() < 100);  //check to ensure device isn't read more than once every 100 ms

I can't quite understand this line. If we already have _spi->frequency(1150000); why we need to have another check here?

Question relating to:

A library for Silicon Sensing DMU02

1 Answer

10 years, 1 month ago.

They are two very different things.

The SPI frequency sets the bit rate when talking to the device.

That while loop is a thousand times slower and is enforcing a minimum time between each read.

Why enforce a minimum time between reads?

Because at the bottom of page 7 of the data sheet it says:

Quote:

Note 2: A quiet time (tq) between messages is required, and 3x( t1 + Tm + Th)+ tq = Ttot. Optimum performance is achieved with a repetition rate of 1ms. Select an appropriate Tclk to meet the requirements of Tm, and then adjust tq to give a Ttot of 1ms.

Accepted Answer