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

SPI Mode wrong? #2

Open
EmbeddedDevver opened this issue Mar 4, 2023 · 3 comments
Open

SPI Mode wrong? #2

EmbeddedDevver opened this issue Mar 4, 2023 · 3 comments

Comments

@EmbeddedDevver
Copy link

File mcp41010.c

In the SPI initialization, you use

'' devcfg.mode = 2;''

But according to the datasheet of the potentiometer this should be mode

'' devcfg.mode = 0; ''

or

'' devcfg.mode = 3; ''

Any other value might work but is working on the edge.

@nopnop2002
Copy link
Owner

Thanks for the report.

I checked the datasheet.

datasheet say:

It is possible to operate the devices in SPI modes 0,0 and 1,1. 

We will fix it in the near future.

@EmbeddedDevver
Copy link
Author

EmbeddedDevver commented Mar 5, 2023

Thank you.
Maybe for your reference.

I used your original code with 5 modules in parallel, and 2 of the 5 were working.
After changing the SPI mode to 0, all modules are working fine.

So it might work with the current code but may not be stable over temperature and design changes.

Thank you for posting this lib!

@nopnop2002
Copy link
Owner

Changed SPI mode from 2 to 0 and changed to component

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