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

drivers: adc: Add Microchip MCP3914 SPI 8ch ADC driver #65646

Closed

Conversation

dean-at-evos
Copy link
Contributor

New driver for the above chip on SPI bus. Runs in async, interrupt driven mode only. Basic chip features supported at this stage.


A new driver for the microchip mcp3914 on SPI bus. Tested on ESP32c3 with basic functionality.

@dean-at-evos
Copy link
Contributor Author

Opening this up for a quick review. We do have a few things to add for our own app;

  • per channel PGA_GAIN support (there is a TODO in comments where that might go)
  • offset/slope correction register set
  • maybe CRC config/interrupt support

There are two things I would like to get feedback on early;

  • The AFE on reset is 24 bit (BE) on the SPI bus, the driver is doing sign extension/cpu endian correction and outputs in int32_t and report resolution as 32 bit. Seems like the best place to do it to me .. is the driver expected to output device native data?
  • For our app it is nice to know when a sample has occurred. I pass a timestamp down inside the driver but want to expose it. At the moment if there is a non-null user-data pointer in the sequence-options the driver treats it is an arrt of timestamps. Of course the can be documented, but it is the correct use of the user data field... or did I miss an obvious way to do this .. or something else??

@dean-at-evos dean-at-evos marked this pull request as ready for review November 28, 2023 09:52
@zephyrbot zephyrbot added area: Devicetree Binding PR modifies or adds a Device Tree binding area: ADC Analog-to-Digital Converter (ADC) platform: Microchip MEC Microchip MEC Platform labels Nov 28, 2023
@dean-at-evos dean-at-evos force-pushed the mcp3419_drvr branch 3 times, most recently from 0d38d20 to 17f21af Compare December 21, 2023 01:39
@dean-at-evos dean-at-evos force-pushed the mcp3419_drvr branch 3 times, most recently from 63c8cf6 to 899a8b2 Compare January 9, 2024 21:01
New driver for the above chip on SPI bus. Runs in async, interrupt
driven mode only. Basic chip features supported at this stage.

Signed-off-by: Dean Sellers <dsellers@evos.com.au>
@salmankhalid-cpi
Copy link

@dean-at-evos I also needed mcp3914 driver for zephyr found your pull request. I am testing it with STM32G491 (not able to successfully test it yet). Also added few comments.

Copy link

@salmankhalid-cpi salmankhalid-cpi left a comment

Choose a reason for hiding this comment

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

Still working on review .. few initial comments.

drivers/adc/adc_mcp3914.c Show resolved Hide resolved
drivers/adc/adc_mcp3914.c Show resolved Hide resolved
drivers/adc/adc_mcp3914.c Show resolved Hide resolved
@dean-at-evos
Copy link
Contributor Author

@dean-at-evos I also needed mcp3914 driver for zephyr found your pull request. I am testing it with STM32G491 (not able to successfully test it yet). Also added few comments.

Thanks for your interest.

TLDR; I'll get to the review soon. I am on another project for a month or two, but I am coming back to this, Q2 24

You say you haven't been able to test it. Does that mean it doesn't [build|load|work] for you, or you just haven't had the [hardware|time] to do it? I have had a machine running with this driver (two chips) for a 16 channel system for a few months now, but that is just on one SOC. If you need help with implementing to get things running let me know, .... I'll look at the review soon

Copy link

github-actions bot commented May 8, 2024

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label May 8, 2024
@github-actions github-actions bot closed this May 22, 2024
@dean-at-evos
Copy link
Contributor Author

Apologies but this is no longer stale ... back in active development :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Devicetree Binding PR modifies or adds a Device Tree binding platform: Microchip MEC Microchip MEC Platform Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants