Other Parts Discussed in Thread: CC2640R2F, LAUNCHXL-CC2640R2
I am having this problem with interfacing the FD2214 with the CC2640R2F using the sensor controller studio. Initially I used the launchpad with the FDC2214 EVM to verify that the data is being read from the sensor. And that works just fine. However I have now produced a small run of pcb's with the CC2640R2F launchpad schematics as a reference to the design. I have fully tested that the chip interfaces just fine with the FDC2214 as the device ID is read. However as I use the old code which was used with the EVM module the output remained fully high.
I did have 4 of these boards produced and they all seem to behave in the same way. So I believe the way I am trying to setup the sensor is the issue.
I attached my code below for the initialization and the for the reading bit. I would greatly appreciate any obvious problems if spotted.
Initialization Code:
// Sensor SD pin is tied to one of the SSC output pins and initialized to 0 gpioClearOutput(AUXIO_O_CONTROL_FDC2214); // Setup Config // Init Channel 0 i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_SETTLECOUNT_CH0,0x0400); //rcount maximized for highest accuracy i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_RCOUNT_CH0,0xFFFF); //no offset i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_OFFSET_CH0,0x0000); //Set clock dividers i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_CLOCK_DIVIDERS_CH0, 0x4001); //set drive register i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_DRIVE_CH0, 0x8C40); //Set MUX i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_MUX_CONFIG, 0x820D); // Config and Start Sensor i2cDeviceWriteReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_CONFIG,0x1481); U16 devId = 0; i2cDeviceReadReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_DEVICE_ID;devId); if (devId == 0x3055){ state.capReady = 1; if(devId == 0x3054){ state.capReady = 1; } }
Execution Code:
i2cDeviceReadReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_STATUS;state.capStatus); // Status 000C == unreadconv ready for ch0 and ch1 if (state.capStatus == 0x000C){ i2cDeviceReadReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_DATA_CH0_MSB; output.capacitance[1]); i2cDeviceReadReg16MsbFirst(FDC2214_I2C_ADDR,FDC2214_DATA_CH0_LSB; output.capacitance[0]); }