Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Measurements and SPI transmissions stop after some time with 4 sensors #9

Open
vmanoj1996 opened this issue Jul 1, 2024 · 4 comments

Comments

@vmanoj1996
Copy link

vmanoj1996 commented Jul 1, 2024

I have made some minor modifications to the library to handle 4 sensors.
https://github.com/vmanoj1996/ultrasonic.arduino.ICUX0201

Here is my brief workflow:

  1. Initialize the sensors. first one in tx, rx mode and the rest are only receiving.
  2. Trigger
  3. Wait for data ready. Once data is ready, read it and trigger again.

For 2 sensors, it works robustly.
But when I have 4 sensors connected, the sensor stops after some time sporadically.

Lowering the SPI clock speed from 12MHz to 6MHz seems to help. Additionally, length of ribbon cables going to the sensor seems to have an effect on this.

Are there some cabling or clock speed guidelines for using ICU30201 sensor.

For some reason, it works robustly with ICU Evaluation utility.

I used teensy 4.0.

Is there a possibility of signals (clock or data) getting corrupted as stated in this page,
https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/643087/tm4c1294kcpdt-spi-terminations-for-multiple-slave

I have a 25MHz logic analyzer and can get one oscilloscope to debug further. But not sure what to look for. Any guidelines would help.

@vmanoj1996
Copy link
Author

The code is here
code.txt

@rprzybyla-invn
Copy link

Hi Manoj,
Good question. Yes, I think ringing on the clock line is a possible culprit. This can definitely be a problem as the flex cables get longer. The resource you found seems to be describing a similar problem we have faced in the past. I am not sure about the arduino hardware, but you may also be able to configure the rise/fall time of the SCLK to improve the performance - this might explain the difference between Arduino and our devkit.

Here is a selection of alternate flex cables, if you don't need the full length it might be a good workaround for you to use shorter flexes:
https://www.newark.com/w/c/cable-wire-cable-assemblies/cable-assemblies/ffc-fpc-flat-flex-jumper-cables?no-of-cores=12conductor&pitch-spacing=0.5mm&contact-orientation=same-sided-contacts&sort=adf_f1001602_bv

@vmanoj1996
Copy link
Author

Got it. Thanks for the insight. This is what I was looking for.

Additionally, are there any other things that I can try. Will adding any resistors on the clock line help? I read it in a few forums like the above one.

@vmanoj1996
Copy link
Author

Just curious, are there any SPI buffers on the Smart Sonic EVK board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants