Other Parts Discussed in Thread: MSPM0G3507, , LP-MSPM0G3507, SYSCONFIG,
Hello TI,
I am interfacing 3 wire RTD PT1000 sensor with ADS124S08 and MSPM0G3507.
Reference circuit/Schematic is ADS124S08 datasheet example page no. 91.
Below are the register setting.
int main (void) { delay_cycles(80000); //2.2ms delay as per data sheet of ads124s08 SYSCFG_DL_init(); DL_GPIO_clearPins(GPIO_SPI_0_CS0_PORT,GPIO_SPI_0_CS0_PIN); //cs low delay_cycles(16000); DL_SPI_transmitData8(SPI_0_INST,RESET_OPCODE_MASK); //reset device delay_cycles(128000); regWrite(REF_ADDR_MASK,0x06); regWrite(PGA_ADDR_MASK,0x0A); //0A// PGA enabled, Gain = 4 regWrite(INPMUX_ADDR_MASK,0x12); //12// Select AINP = AIN1 and AINN = AIN2 regWrite(IDACMAG_ADDR_MASK,0x07); //07// IDAC magnitude set to 1mA regWrite(DATARATE_ADDR_MASK,0x14); regWrite(SYS_ADDR_MASK,0x10); regWrite(IDACMUX_ADDR_MASK,0x35); //35;// IDAC1 set to AIN5, IDAC2 set to AIN3 readRegs(INPMUX_ADDR_MASK,5,Data); //trying to read 5 register starting from register address 0x02 DL_SPI_transmitData8(SPI_0_INST,START_OPCODE_MASK); //start command delay_cycles(16000); DL_GPIO_setPins(GPIO_SPI_0_CS0_PORT,GPIO_SPI_0_CS0_PIN); //cs high while (1) { if (!DL_GPIO_readPins(GPIO_LEDS_DRDY_ADC_PORT, GPIO_LEDS_DRDY_ADC_PIN)) //waiting for DRDY pin to goes low { DL_GPIO_clearPins(GPIO_SPI_0_CS0_PORT,GPIO_SPI_0_CS0_PIN); //cs low delay_cycles(16000); DL_GPIO_setPins(GPIO_LEDS_START_PORT,GPIO_LEDS_START_PIN); //testing delay_cycles(16000); DL_SPI_transmitData8(SPI_0_INST,RDATA_OPCODE_MASK); #if 1 for(int i=0;i<3;i++) { Input_Data[i] = DL_SPI_receiveData8(SPI_0_INST); } #endif delay_cycles(16000); DL_GPIO_setPins(GPIO_SPI_0_CS0_PORT,GPIO_SPI_0_CS0_PIN); } } }}
SPI setting
- SPI Mode 1
- clock bit rate 1MHz
- Bit order - MSB first
We followed datasheet pseudo code but not getting data from ADC. When reading SPI RX buffer some random value comes.
We are not sure ADC get configured or not.
IDAC magnitude not set as per setting 500uA.