Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's new
AMC
boardBrief description of the reading
We know that the chip_MA730 has a resolution of 14 bits, so it can count values from 0 to 16383.
We also know that in order to perform a reading we have to send 2 bytes to the clock source.
Finally, from the Datasheet, we know that the first bit of the Byte read is a dummy bit and the last bit of the second Byte is a zero-padded bit.
Let's see how to read the case of maximum value in summary:
Step 0 (initial conditions)
Step 1 (clip
Buffer[0]
by removing the dummy bit (mask it with 0x7F) and shift it to the left by 7 positions)Step 2 (shift
Buffer[1]
by 1 position to the right, then perform the OR operation withposition
)In the last step, position contains our final 14-bit value ---> 16383.
Furthermore here is the code used to validate the
chip_MA730
:cc @valegagge @ale-git