AnsweredAssumed Answered

I can not write to REG_OFFSET AD719x

Question asked by zz555 on May 25, 2017
Latest reply on May 26, 2017 by zz555

I can not write to REG_OFFSET AD7195.
I am writing 0x807600, later I read 0x800000 (should read 0x807600).
I read that before you write to REG_OFFSET ADC needs to be translated into Idle mode (MD = 010) - does not work.
What am I doing wrong?

 

My code:

 

// MD(000)=0 - Continuous conversion mode
// MD(001)=2 - Single conversion mode
// MD(010)=4 - Idle mode
// MD(011)=6 - Power-down mode
// MD(100)=8 - Internal zero-scale calibration
// MD(101)=A - Internal full-scale calibration
// MD(110)=C - System zero-scale calibration
// MD(111)=E - System full-scale calibration

 

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET); // CS_0
AD719x_SetRegisterValue(AD719x_REG_MODE, 0x440001, 2, 0); // Idle mode 0x440001 or 0x448401
AD719x_WaitRdyGoLow();
AD719x_SetRegisterValue(AD719x_REG_OFFSET, 0x807600, 2, 0); // write 0x807600, read 0x800000
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET); // CS_1

 

HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET); // CS_0
AD719x_SetRegisterValue(AD719x_REG_MODE, 0x048401, 2, 0); // MD=0
AD719x_WaitRdyGoLow();
num = AD719x_GetRegisterValue(AD719x_REG_OFFSET, 2, 0); // resd 0x800000
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET); // CS_1
numUart(num);

Outcomes