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

[driver] IMU ADIS16470 #805

Merged
merged 3 commits into from
Jan 24, 2022
Merged

[driver] IMU ADIS16470 #805

merged 3 commits into from
Jan 24, 2022

Conversation

rleh
Copy link
Member

@rleh rleh commented Jan 5, 2022

  • Driver
    • Add some additional functions for configuration
  • Example
  • Test on real hardware

@rleh
Copy link
Member Author

rleh commented Jan 13, 2022

Chip seems to work (DR pin toggles as expected), but DOUT/MISO signal is constantly low.
image
Looks like it might be shorted to CS, but my multimeter measures approx. 20kOhm from CS to DOUT.

image

@salkinium
Copy link
Member

Maybe the MISO needs a pullup?

@rleh
Copy link
Member Author

rleh commented Jan 13, 2022

Maybe the MISO needs a pullup?

I already enabled the STM32 internal pull-up, but maybe it is to weak for 600kHz SPI...

@salkinium
Copy link
Member

salkinium commented Jan 13, 2022

For F4 it's only 30-50kOhm for the pullup (see datasheet, I/O characteristics).

@rleh
Copy link
Member Author

rleh commented Jan 13, 2022

I added an external 3k9 pull-up to MISO and still same issue.
Maybe a hardware defect of the IMU (costs 300$)... 😒
I will test the driver with another identical IMUs (but already soldered on custom PCBs).

@chris-durand
Copy link
Member

chris-durand commented Jan 13, 2022

Maybe the MISO needs a pullup?

I already enabled the STM32 internal pull-up, but maybe it is to weak for 600kHz SPI...

I guess it is. Rise time is 2.2 * R *C. With the pull up R=40kOhm and C=5pF for the STM32 IO we get 2.8 µS. The reciprocal is 362 kHz.

EDIT: Ah, the calculation is wrong, I made a typo with the calculator but it's not the issue anyways 🤦‍♂️ .

@salkinium
Copy link
Member

Uiuiui, the gloves are off now, at your pencils, ready, math!

@chris-durand
Copy link
Member

The IMU requires SPI mode 3:

spi

This is never configured in the driver.

@chris-durand
Copy link
Member

The data out should not require a pull-up. I would remove it.

@rleh rleh marked this pull request as ready for review January 13, 2022 20:45
@rleh
Copy link
Member Author

rleh commented Jan 14, 2022

The IMU requires SPI mode 3: [image ...]
The data out should not require a pull-up. I would remove it.

Works now with SPI mode 3 and without any pull-up.

Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice driver, just needs to guard the IO module.

src/modm/driver/inertial/adis16470.hpp Outdated Show resolved Hide resolved
src/modm/driver/inertial/adis16470.lb Outdated Show resolved Hide resolved
src/modm/driver/inertial/adis16470.hpp Outdated Show resolved Hide resolved
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash?

@rleh
Copy link
Member Author

rleh commented Jan 22, 2022

Squash?

Yes, but after investigating why the MSC_CTRL register does not read back correctly.

@rleh rleh requested review from salkinium and chris-durand and removed request for chris-durand January 24, 2022 16:14
@rleh
Copy link
Member Author

rleh commented Jan 24, 2022

Squashed, tested (again) on real hardware & ready to merge!

Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Very nice!

@rleh rleh merged commit b153186 into modm-io:develop Jan 24, 2022
@rleh rleh deleted the feature/driver_ADIS16470 branch January 24, 2022 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants