Hi everyone,
I am trying to use 4 channels of ADS1248 for a2d conversion. Writeing to MUX0 register, we should be able to look into differient AINx channels. I use the following code to write and read MUX0 register. Wonder what is missing here since we don't read back what was written to the register. I would greatly appreciate your feedback.
thanks,
Hamid
spi.write(SDATAC); // to read other registers than data, stop readining data continously
spi.write(0x40); // writre to MUX0
spi.write(0x00); // number of bytes - 1
spi.write(0x29); // BCS1:0 (current) MUX_SP2:0 (positive input) MUX_SN2:0 (negative input) ex: 0x29 = +AIN5, -AIN1
wait(.5);
spi.write(0x20);
spi.write(0x0);
int MUX0REG = spi.write(NOP); // read SYS0 regiter back;
pc.printf(" MUX0 1byte register contains 0x%X \n\r", MUX0REG);