hey I an using ad7730 for getting the load cell reading but I am not receiving any data , I have tried the pseudo code given in the data sheet , when i checked with logic analyzer the data is correct in MOSI but nothing comming in MISO.
my POL pin is high and in the controller i am using clock polarity HIGH and clock phase as 2 EDGE can someone provide clarification in this ?
void AD7730_Start_Cont_Read(AD7730 gauge){
spi_tx_buffer[0] = 0x02;//CR_SINGLE_WRITE | CR_MODE_REGISTER; //write to comms register and set next write to mode reg
Tx_AD7730(1, spi_tx_buffer); //0x02
spi_tx_buffer[0] = 0x21;//MR1_MODE_CONTINUOUS | CURRENT_MODE_1_SETTINGS_READ; //write to mode reg startin cont readings for 0-10mV range
spi_tx_buffer[1] = 0x80; //CURRENT_MODE_0_SETTINGS_READ;
Tx_AD7730(2, spi_tx_buffer); //0x2180
spi_tx_buffer[0] = 0x21; //CR_CONTINUOUS_READ_START | CR_DATA_REGISTER;
Tx_AD7730(1, spi_tx_buffer); //0x21
while(AD7730_ConfigData->AD7730_dataReadyPin_read() != GPIO_PIN_RESET); //wait for ready pin to go low after calibration //wait for ready pin to go low when cont readings start
CONT_READ_STARTED = SET;
}
void AD7730_Read_Cont(AD7730 gauge, uint8_t * rx_buffer){
spi_tx_buffer[0] = 0x0;
spi_tx_buffer[1] = 0x0;
spi_tx_buffer[2] = 0x0; //need to transfer all 0 bytes to keep DIN of AD7730 low prevent device reset during cont read
while(AD7730_ConfigData->AD7730_dataReadyPin_read() != GPIO_PIN_RESET); //wait for ready pin to go low after calibration //wait for ready pin to go low
AD7730_ConfigData->AD7730chipSelectSET(); //slave select low to begin
BSP_Delay(1);
AD7730_ConfigData->BSP_AD7730_SPI_TransmitReceive((uint8_t *)spi_tx_buffer,(uint8_t *)rx_buffer,3,1000);
BSP_Delay(1);
AD7730_ConfigData->AD7730chipSelectReset(); //slave select low to begin
}
void AD7730_Stop_Cont_Read(AD7730 gauge){
spi_tx_buffer[0] = CR_SINGLE_WRITE | CR_CONTINUOUS_READ_STOP; //0x30
Tx_AD7730(1, spi_tx_buffer);
CONT_READ_STARTED = RESET;
}