This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS7038-Q1: CRC Error in auto mode polling the OSR_DONE bit

Part Number: ADS7038-Q1
Other Parts Discussed in Thread: ADS7038,

Hi, 

i am using the ADS7038 in autonomous mode. I switched on oversampling to get more accurate samples and i am using the SPI interface with CRC enabled. In the application node

Resolution-Boosting ADS7138 Using Programmable Averaging Filter

it is mentioned to poll the OSR_DONE bit to determine that sampling with oversampling is finished.

So after configuration of the chip (switch on CRC, statistic module enable, autonomous mode on, selecting the channels, selecting oversampling)  i started the sequence. 

After that i try to poll the status register by reading the status register. But this results in CRC errors (CRCERR_IN ist set).

I don´t now how to read the OSR_DONE bit in my selected mode other than reading the status register.

Thanks for help

Thomas Jung

  • Hi Thomas,

    Have you used the CRC calculator tool to generate the 8-bit CRC input value?

  • Hi Tom,

    no i didn´t use this tool, but during the initialisation i read the status register many times always with CRC enabled and i never had a problem with the CRC. So my CRC calculation should be ok.  Just after starting the conversion and than reading the status register i get the CRC error.

    Thanks Thomas

  • Hi Thomas,

    Just curious, but have you set threshold limits?  Once in autonomous mode, the ADS7038 is running in a self contained mode and would only expect to be queried after setting the ALERT.  I'm not sure if that is the issue just yet, so I'll dig into it a bit more.  It would be interesting to hear if you set the limit and then applied an 'overvoltage', would you still get the CRC error.

  • Hi Tom,

    i did not set limits and i did also not setup an Alert till now, because im am not aweare of a dependency.

    I configured 5 analog inputs and 3 digital outputs. One Output is connected to the LED, on the two other outputs i connected a voltage devider (two resistors) and connected it to the first analog input. To answere your question, yes i applied 2.3Volts to the analog input 0, all other inputs are floating.

    I will try set the limits and getting an ALERT. It takes a while.

    Can You tell me if there are some special settings you want me to set?

    Thanks

  • Hi Thomas,

    No special settings - and you don't really need to setup ALERT as an interrupt to your controller - if you can just monitor that with a scope it would be good enough.  If you set a limit on CH0 for say 2.3V and push the analog input to 2.4V, it should trigger an alert.  Once you see that, try sending the command to read the status.

  • Hi Tom,

    sorry i coudn´t reproduce the fault with the CRC error, don´t ask me what i have seen. However, the main problem still exists.

    As i mentioned in the first post i want to run the device in automatic mode with oversampling. So i hav initialzed the device to run autonomous with a 5 channel sequence and oversampling and i want to poll the OSR_DONE flag to determin when the sequence with oversampling has finished.

    But i never see the OSR_DONE flag to be set. I also tried the SEQ_STATUS flag. I also don´t see that this flag will be ´0´.

    Here ist the initialization (first param is the register address, second the data, third the flag that CRC is enabled)

    // set AIN5-7 to dig out

    ads7038_writeReg(0x05, 0xE0,1);

    ads7038_writeReg(0x07, 0xE0,1);

    ads7038_writeReg(0x09, 0xE0,1);

    ads7038_writeReg(0x0B, 0xC0,1);

    // set fix patten

    // ads7038_writeReg(0x02, 0x80,1);

    // enable status bits after read

    // ads7038_writeReg(0x02, 0x20,1);

    // switch on OSR mode = 128

    ads7038_writeReg(0x03, 0x07,1);

    // select channels for sequence

    ads7038_writeReg(0x12, 0x1F,1);

    // setup timing and automode

    ads7038_writeReg(0x04, 0x3F,1);

    // switch on on the fly mode

    // ads7038_writeReg(0x10, 0x02,1);

    // switch on auto mode

    ads7038_writeReg(0x10, 0x01, 1);

    // start conversions

    ads7038_writeReg(0x00, 0x0B,1);

    ads7038_readReg(0x00, 1);

    ads7038_setBit(0x10, 0x10,1);

    ads7038_readReg(0x00, 1);

    Here a screen shot (SALEA) of the status register read.

    Sorry for CRC. Thanks for help.

    Thomas

  • Hi Thomas,

    In autonomous mode, you first need to exit before you can read anything.  Have you tried running in auto sequence mode?  That should work for what you are trying to accomplish.

  • Hi Tom,

    auto sequence mode is not an option. We have several devices on the same bus (different CS) and we want the device to run autonomously. We decide to use the autonomous mode, wait the necessary time and read out the values from the statistics module (LAST_VALUE). It is described in Figure 37 of the data sheet. It seems there is no possibility to check that we really have new values (Busy flag or Finished or something like this).

    In Figure 37 it is mentioned that we can read the last value registers without stopping the sequence. Is this realy the case? How can i be sure that i read high and low byte of the same conversion? Is there any protection or do i have to stop the sequence before reading the values?

    After stopping the sequence (SEQ_START = 0), will the running conversion be finished or does the conversion stops immediately?

    Thanks

    Thomas

  • Hi Thomas,

    Which datasheet are you looking at?  There is no Figure 37 in the ADS7038-Q1 (lit number SBAS981) datasheet.