Skip to content

Ensure all allowed filter bit combinations can be set on on AD7124. #36

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions Arduino Uno R3/examples/CN0391_example/CN0391.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ void CN0391_init() {

// Set AD7124_Filter_0 0x21
regNr = AD7124_Filter_0;
setValue = AD7124_ReadDeviceRegister(regNr);
setValue |= AD7124_FILT_REG_FILTER(2); // set SINC3
setValue |= AD7124_FILT_REG_FS(384); //FS = 48 => 50 SPS LOW power
setValue = 0; // Avoid interference with nonzero Power-On/Reset Value
setValue |= AD7124_FILT_REG_FILTER(2); // set SINC3
setValue |= FILT_REG_POST_FILTER(3); // Keep default POST_FILTER setting
setValue |= AD7124_FILT_REG_FS(384); //FS = 48 => 50 SPS LOW power
setValue &= 0xFFFFFF;
AD7124_WriteDeviceRegister(regNr, setValue);// Write data to _ADC

Expand Down Expand Up @@ -236,11 +237,12 @@ void CN0391_init() {
setValue &= 0xFFFF;
AD7124_WriteDeviceRegister(regNr, setValue); // Write data to _ADC

// Set AD7124_Filter_0 0x21
// Set AD7124_Filter_1 0x22
regNr = AD7124_Filter_1;
setValue = AD7124_ReadDeviceRegister(regNr);
setValue |= AD7124_FILT_REG_FILTER(2); // set SINC3
setValue |= AD7124_FILT_REG_FS(384); //FS = 48 => 50 SPS
setValue = 0; // Avoid interference with nonzero Power-ON/reset Value
setValue |= AD7124_FILT_REG_FILTER(2); // set SINC3
setValue |= FILT_REG_POST_FILTER(3); // Keep default POST_FILTER setting
setValue |= AD7124_FILT_REG_FS(384); //FS = 48 => 50 SPS
setValue &= 0xFFFFFF;
AD7124_WriteDeviceRegister(regNr, setValue);// Write data to _ADC

Expand Down