Good morning everyone.
Sory to disturb you but I got a really annoying issue when using the secoundary SPI bus.
To give you some context :
I need to read the data from 8 accelerometers (and an IMU ic on top of that) nearly silmutanously and reccord that data straight into an SD card as fast as possible to have the highest stable sampling rate.
I made it as a self-sufficient device with every components soldered on one main and two secondary pcbs, wich are connected with 3cm long shielded cables, the pcbs don't exceed 20cm in length
To get below the 100Hz limitation with I2C communication (it takes some time to read 8 times 6 registers) I switced to spi communication beetween LSM6DSOX (as sensors) and a teensy 4.0 (not a 4.1 due to space constraints as the device is self contained)
To avoid getting issues with the SD logging on the main SPI line, I used the seondary one (I soldered headers on the two corresponding pads on the underside to solder every point directly to the pcb)
my issue is that when I test only the main pcb with 4 accelerometers and the IMU everything worked (-ish one accelerometer didn't respond due to a broken track), when I connect on the bus the other accelerometers on the other pcbs everything works, except when I plug the accelerometer n°2, wich is located on the upper pcb, and that ones makes everyone on the bus silent, I can't even get a proper response of the who_am_i registers for any of the sensors
I tried to visualise the sensors initialisation signals as I though that the core issue may lay there (having a four channel oscillioscope is handy), and I run this little program taht only writes into two separate registers to initialise each accelerometers (activation, measurment range, noise filtering, ...).
As expected, (first picture) when the accelerometer n°2 wasn't connected everything worked, and the comunication lasts for exactly 4 bytes
but after connecting it without modifying the code the first accelerometers (second picture) comunication misses the last byte (the CS line goes up back 8 clock cycles too early) and the 5th accelerometer (third picture) misses the first and last bytes, but everything works when the 2nd accelerometer isn't connected
to check the chronograms : yellow is SCK, purple is MOSI, blue is MISO and green is CS (which CS depends on wich picture)
You also get this weird drop to GND on the MISO line when the 2nd accelerometer is connected
To give you more info, I struggled with noise due to too-long jumping wires during the early tests of the concept (multiple accelerometers and SD card on the same board) and got rid of it by twisting the corresponding CS lines with a gnd wire. Not knowing anything about RF circuits I tried to mimick the thing by putting two gnd tracks at each side of the cs lines and the SCK/MOSI/MISO bus with lots of straping wires to connect grounds as I worked with a single-sided pcb.
I don't think that the issue comes from the accelerometer breakout board (Adafruit LSM6DSOX) as I have already replaced it (before probing with the oscilloscope) and the issues remained
To be fair I think tha maybe my modules are at fault (as I power them with 3.3V due to these damned integrated level-shifters) and all the pull-up resistors that may add-up, but I clearly see that the issue lays on the CS lines, that are separate, and I can't explain it, signal interference or paraisitc capacitances shouldn't make such clear CS ill-timed transitions
Thanks a LOT to everyone that took time to read my grumbling, and if anyone has an dea, I am all ears.
Thanks in advance
Sory to disturb you but I got a really annoying issue when using the secoundary SPI bus.
To give you some context :
I need to read the data from 8 accelerometers (and an IMU ic on top of that) nearly silmutanously and reccord that data straight into an SD card as fast as possible to have the highest stable sampling rate.
I made it as a self-sufficient device with every components soldered on one main and two secondary pcbs, wich are connected with 3cm long shielded cables, the pcbs don't exceed 20cm in length
To get below the 100Hz limitation with I2C communication (it takes some time to read 8 times 6 registers) I switced to spi communication beetween LSM6DSOX (as sensors) and a teensy 4.0 (not a 4.1 due to space constraints as the device is self contained)
To avoid getting issues with the SD logging on the main SPI line, I used the seondary one (I soldered headers on the two corresponding pads on the underside to solder every point directly to the pcb)
my issue is that when I test only the main pcb with 4 accelerometers and the IMU everything worked (-ish one accelerometer didn't respond due to a broken track), when I connect on the bus the other accelerometers on the other pcbs everything works, except when I plug the accelerometer n°2, wich is located on the upper pcb, and that ones makes everyone on the bus silent, I can't even get a proper response of the who_am_i registers for any of the sensors
I tried to visualise the sensors initialisation signals as I though that the core issue may lay there (having a four channel oscillioscope is handy), and I run this little program taht only writes into two separate registers to initialise each accelerometers (activation, measurment range, noise filtering, ...).
As expected, (first picture) when the accelerometer n°2 wasn't connected everything worked, and the comunication lasts for exactly 4 bytes
but after connecting it without modifying the code the first accelerometers (second picture) comunication misses the last byte (the CS line goes up back 8 clock cycles too early) and the 5th accelerometer (third picture) misses the first and last bytes, but everything works when the 2nd accelerometer isn't connected
to check the chronograms : yellow is SCK, purple is MOSI, blue is MISO and green is CS (which CS depends on wich picture)
You also get this weird drop to GND on the MISO line when the 2nd accelerometer is connected
To give you more info, I struggled with noise due to too-long jumping wires during the early tests of the concept (multiple accelerometers and SD card on the same board) and got rid of it by twisting the corresponding CS lines with a gnd wire. Not knowing anything about RF circuits I tried to mimick the thing by putting two gnd tracks at each side of the cs lines and the SCK/MOSI/MISO bus with lots of straping wires to connect grounds as I worked with a single-sided pcb.
I don't think that the issue comes from the accelerometer breakout board (Adafruit LSM6DSOX) as I have already replaced it (before probing with the oscilloscope) and the issues remained
To be fair I think tha maybe my modules are at fault (as I power them with 3.3V due to these damned integrated level-shifters) and all the pull-up resistors that may add-up, but I clearly see that the issue lays on the CS lines, that are separate, and I can't explain it, signal interference or paraisitc capacitances shouldn't make such clear CS ill-timed transitions
Thanks a LOT to everyone that took time to read my grumbling, and if anyone has an dea, I am all ears.
Thanks in advance