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

Analog input range correction. #1

Open
anzishi-mm opened this issue Jan 23, 2023 · 3 comments
Open

Analog input range correction. #1

anzishi-mm opened this issue Jan 23, 2023 · 3 comments

Comments

@anzishi-mm
Copy link

Thanks for the library ! It really helps. I found a small point that “The function setRange(bool) can be used to set the limits to 5V (+/- 2.5V) with false or 10V (+/- 5V) with true.” According to the datasheet the analog input range is +/- 5V or +/- 10V .

@leollo98
Copy link
Owner

leollo98 commented Jan 24, 2023

This was a problem that I found while testing. Maybe I got a faulty silicon, but the maximum reading (0x7FFF) with only 3v when false, and a valid +/- 5V (4CCC) for true, considering that all numbers are on 2's complement.

@anzishi-mm
Copy link
Author

I tested my AD7606 yesterday. And I found this problem is from the code not hardware. In the data sheet of AD7606, we can find the description:

"The falling edge of CS takes the bus out of three-state and clocks out the MSB of the 16-bit conversion result. This MSB is
valid on the first falling edge of the SCLK after the CS falling edge. The subsequent 15 data bits are clocked out of the AD7606/ AD7606-6/AD7606-4 on the SCLK rising edge. Data is valid on the SCLK falling edge. To access each conversion result, 16 clock cycles must be provided to the AD7606/AD7606-6/AD7606-4."

So in the read function, maybe DB15 is missed.

@leollo98
Copy link
Owner

Sorry for the wait, I corrected some problems and bugs on the "Dev" branch, if it's possible you can test to se if it's correct now.

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