I wrote the following code to set the XADC input to unipolar mode (0~1V, VN=0V, VP=0~1V),
but it does not work.
When I read the register value and printf to find the problem, only "0" is displayed.
1) I would like to know what is wrong in the code below.
2) How to set XADC to unipolar mode?
plz. help me ~
my code
/////////////////////////////////Unipolar setup
regValue = XAdcPs_ReadReg(XPAR_PS7_XADC_0_BASEADDR, XADCPS_CFR0_OFFSET);
printf("before register0 = %x \n", regValue);
regValue &= ~(XADCPS_CFR0_DU_MASK);
XAdcPs_WriteReg(XPAR_PS7_XADC_0_BASEADDR, XADCPS_CFR0_OFFSET, regValue);
regValue = XAdcPs_ReadReg(XPAR_PS7_XADC_0_BASEADDR, XADCPS_CFR0_OFFSET);
printf("after register0 = %x \n", regValue);
////////////////
results :No more than 0.5V
register values are "0"