Post Go back to editing

AD7190: Can not read data while switching between 2 channels

Hello Everyone,

   I am trying to read load cell data which is connected to Ain1P- Ain2N and Ain3P-Ain4N channel respectively. I can successfully read the data when single channel Ain1P and Ain2N is used. The default register values are also read successfully.Continuous conversion mode is selected.AD7190 is interfaced with MSP432 controller.

I am doing some following steps to switch between 2 channel as ref in https://www.analog.com/media/en/technical-documentation/frequently-asked-questions/AD719x_FAQ_Instru_Conv.pdf (page no 8)

In while loop:-

1. CS pin low

2 Delay 5uS

3. Write 0x8 to communications register: Write 0x080060 to mode register.

4.Wait for RDY line to go low

5.Delay 5uS

6.Write 0x10 to communications register: Write 0x000110 to configuration register.Channel Ain1P and Ain2N is selected

7.Wait for RDY line to go low

8.Delay 5uS

9.Write 0x58 to the communications register: 

10. Wait for RDY line to go low. Write dummy 0xFF.Read load cell data in LoadCellData1 variable.

11.Delay 80ms

12.Write 0x10 to communications register: Write 0x000110 to configuration register.Channel Ain3P and Ain4N is selected

13.Wait for RDY line to go low

14.Delay 5uS

15.Write 0x58 to the communications register: 

16. Wait for RDY line to go low. Write dummy 0xFF.Read load cell data in LoadCellData2 variable.

17.Delay 5uS

17. CS pin high

I have attached main file for your reference.How can I read data simultaneously between 2 channel??

while(1) { P1->OUT &=~BIT4; __delay_cycles(200); // continuous conversion mode register WriteRegister(COM_WRITE_MODE_REG_CMD,3,0x080060); while(!((P1IN&BIT7)==0)){} //wait for calibration complete __delay_cycles (200); //write in configuration register WriteRegister(COM_WRITE_CONFIG_REG_CMD,3,0x000110); while(!((P1IN&BIT7)==0)){} //wait for calibration complete //000310 __delay_cycles (200); spi_tx(0x58); //read continuous data mode while(!((P1IN&BIT7)==0)){} // Wait until data ready LoadCellData1=ReadData(); // Read load cell data __delay_cycles (144000); //write in configuration register WriteRegister(COM_WRITE_CONFIG_REG_CMD,3,0x000210); while(!((P1IN&BIT7)==0)){} //wait for calibration complete //000310 __delay_cycles (200); spi_tx(0x58); //read continuous data mode while(!((P1IN&BIT7)==0)){} // Wait until data ready LoadCellData2=ReadData(); // Read load cell data __delay_cycles(200); P1->OUT |= BIT4; }

Parents Reply Children
No Data