SPI and multiple and different types of sensors


i have problem communicating sensors via spi.
i have 8 ldc1000 (inductive sensors) , 8 adt7310s (temperature sensors) on spi bus.

i cannot read 16.
even if connect 1 of each, luck have values both, of time, 1 correctly giving me values.

for lcd chose:
spi.setclockdivider(spi_clock_div8);
spi.setdatamode(spi_mode0);
spi.setbitorder(msbfirst);

other values of clock_div , other mode not work @ all, if in other project seen work.

for adt
spi.setdatamode(spi_mode3);
works better.

so each time configure or read sensor change spi parameters.

in order select devices using flip-flops in cascade mode rotate high bit connected cs input of device in question. (with 10ms delays between pulses)

do have advice in handling 2 different kind of sensors in same spi bus? in terms of configuration, delays, etc?

when add second pair of sensors, cant read any. random values.
so evidently there conflict in data line; if flipflop ensures 1 device selected (cs) @ time... thought?

thank you.

can show whole sketch, , schematic or drawing of flip-flops. have see it, know going on.

do use long wires ?
or use breadboard, can have bad contacts.
and ground connected ? bad or missing ground wire cause this.

the datamode has right. seem have selected 1 works. think better set according sensor, , try make work.

the spi bus fast, using different spi sensors without delay should not problem @ all.


Arduino Forum > Using Arduino > Sensors > SPI and multiple and different types of sensors


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support