Other Parts Discussed in Thread: ADS1298,
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.
Hello PVB,
Welcome to our forum and thank you for your post.
It's possible that the SPI data is changing abruptly because the data is getting corrupted. This can happen if you are not monitoring the /DRDY pin, which indicates when new data is available. If another /DRDY falling edge occurs while you are reading the previous sample, the data will be overwritten immediately. Each SPI data read transaction (from /CS = 0 to /CS = 1) must occur between /DRDY falling edges.
Best regards,
Hi Ryan,
Thanks for your quick response.
let me explain you the scenario, I have connected 1.5V battery at JP32 (LA,RA) terminals, I was expecting to read constant ADC value but this didn't happen.
the values are changing
procedure
I was making start pin go high wait for 1msec, then making start pin low then I will poll for dataready pin status, if its low, STOP command is sent then ADC data is read.
let me know if this is the right procedure or not if it is right then where could be the issue.
below is the sample code for reference.
while(1)
{
if((HAL_GPIO_ReadPin(GPIOG, 13))==0) //Dataready port pin
{
ADS_STOP();
ADS_RDATA();
HAL_GPIO_WritePin(GPIOI, ADS_START_Pin, GPIO_PIN_SET);
HAL_Delay(1);
HAL_GPIO_WritePin(GPIOI, ADS_START_Pin, GPIO_PIN_RESET);
}
}
Thanks,
Veera
Hi Ryan,
I am not able to understand regarding DRDY pin, it is changing continuously even though I am giving battery voltage as input.
I just want to know did I miss anything about DRDY functionality.
I have noticed the delay between DRDY pulses is 2ms, I am seeing this pulses as soon as I make start pin high.
my query is, why DRDY is changing when there is no change in input?
In my previous post I mentioned the procedure of reading ADC data.
Is it mandatory to read ADC data in DRDY interrupt? can't I poll for DRDY pin status in while loop for reading ADC data?
Thanks in advance.
Veera
Hello Veera,
Please review the Start Mode (9.4.1.1) and the Data Ready (9.4.1.2) sections of the data sheet. The START pin is intended to be remain high in order for the ADCs to convert. The Data Ready (/DRDY) pin only transitions from high to low when new data is available. Some settling time is required when START transitions high.
Furthermore, the timing or duty cycle of the /DRDY output has no relationship to the input voltage. The time between /DRDY falling edges will correspond to the configured output data rate. The first falling edge of SCLK in the frame clears /DRDY.
Best regards,
Hi Ryan,
Thanks for your response, As mentioned in previous post, I am connecting 1.5V battery across channel 1.
From your post
"The Data Ready (/DRDY) pin only transitions from high to low when new data is available"
My query is, since I am connecting battery of fixed voltage across ADC terminals, why DRDY pin is changing continuously.
can you provide more information for my understanding.
Thanks,
Veera
Hi Vera,
By "new data", I'm not implying whether the conversion result is the same or different compared to the previous result. In fact, they will almost never be the same since noise will force the least significant bits to toggle randomly. For a fixed DC input voltage, the ADCs in the ADS1298R will continuously sample the input and provide conversion results at the output at the output data rate. The collection of samples will follow a Gaussian distribution centered around the mean output value.
The /DRDY output should be treated as an active-low interrupt for the MCU to enter a data collection routine.
Best regards,
Hi Ryan,
I have implemented /DRDY interrupt in controller and also implemented function to read ADC data from ADS128 at the fourth interrupt of DRDY as per information provided in 9.4.1.1.1 of datasheet.
still I am unable to get the ECG signal which I was able to get using ADS1298R AFE.
let me know if I need to change anything else or is it the issue with my ADS1298 R register configuration.
Thanks,
Veera
Hi Ryan,
For 60 bpm, I have converted voltage values generated by ADS1298 PDK to corresponding ADC value and they are mentioned below in Hex.
14648 |
14623 |
14616 |
1461C |
14631 |
14626 |
14641 |
14608 |
when I read ADC value from ADS1298R through SPI I am getting below mentioned values
FAFFF1 |
FBFFEE |
ECFFF1 |
BEFFF9 |
EDFFF1 |
F1FFF1 |
FA0023 |
ECFFF1 |
F3FFF0 |
BC0013 |
these values are no where close to expected.
my first query, data read through PDK is 5 digits means 20 bits, where as ADS1298 is expected to send 24 bits of ADC data for each channel as per datasheet.
the first 3 digits in the data captured from PDK are constant and the data I captured through STM32 controller is very different ( first 3 digits are not same)
I am not sure whether my procedure is right or wrong or there is something I am missing.
kindly provide your input.
Thanks in advance,
Veera
14648 |
14623 |
14616 |
1461C |
14631 |
14626 |
14641 |
14608 |
14633 |
1462D |
1463A |
14648 |
1464F |
14670 |
14644 |
14641 |
14626 |
14644 |
1464B |
1464B |
14641 |
14633 |
1460F |
14633 |
14648 |
14648 |
14631 |
14626 |
1463A |
14648 |
14662 |
14655 |
14619 |
1460C |
14641 |
1462A |
14644 |
Hello Veera,
"60 bpm" tells me nothing about the applied input voltage to the ADC, so it's impossible to tell you what the expected output voltage or output code should be.
I suggest removing the external ECG simulator for now and conduct your testing with the internal test signal options within the ADS1298. There are 1-mV and 2-mV amplitude options. The test signal frequency can be either AC or DC. Try the DC option first and you should see consistent output codes corresponding to the test signal amplitude multiplied by the PGA gain.
Please review the codes-to-volts conversion guide in the ADS129x BIOFAQ page for more information.
Best regards,
Hi Ryan,
Thanks Ryan for your input, I tested Test signal feature, I was able to read consistent ADC values as mentioned below
more or less values are same for each channel
Ch1 | Ch2 | ch3 | ch4 | ch5 | ch6 | ch7 | ch8 |
24407 | 17211 | 22771 | 18328 | 15297 | 23805 | 13871 | 19524 |
24469 | 17290 | 22853 | 18389 | 15388 | 23866 | 13926 | 19612 |
24413 | 17194 | 22751 | 18318 | 15328 | 23811 | 13865 | 19554 |
24424 | 17194 | 22763 | 18318 | 15323 | 23813 | 13869 | 19543 |
24469 | 17267 | 22819 | 18368 | 15338 | 23841 | 13929 | 19606 |
24414 | 17181 | 22759 | 18318 | 15326 | 23808 | 13889 | 19554 |
24409 | 17177 | 22758 | 18339 | 15289 | 23806 | 13884 | 19544 |
24439 | 17224 | 22796 | 18360 | 15326 | 23841 | 13886 | 19568 |
I also calculated channels offset as mentioned below, the average value was considered as offset
ch1 | ch2 | ch3 | ch4 | ch5 | ch6 | ch7 | ch8 |
3570 | 16773055 | 1422 | 16774499 | 16771434 | 2813 | 16770022 | 16775372 |
3576 | 16773063 | 1419 | 16774465 | 16771430 | 2823 | 16770005 | 16775359 |
3569 | 16773037 | 1408 | 16774509 | 16771441 | 2827 | 16770009 | 16775422 |
3570 | 16773020 | 1414 | 16774495 | 16771433 | 2823 | 16770031 | 16775373 |
3555 | 16773030 | 1428 | 16774475 | 16771442 | 2811 | 16770022 | 16775370 |
3547 | 16773031 | 1429 | 16774475 | 16771414 | 2824 | 16769998 | 16775399 |
3557 | 16773049 | 1428 | 16774470 | 16771455 | 2816 | 16770007 | 16775387 |
3563 | 16773053 | 1424 | 16774495 | 16771430 | 2829 | 16770029 | 16775385 |
3571 | 16773067 | 1407 | 16774494 | 16771432 | 2818 | 16770018 | 16775394 |
3556 | 16773045 | 1416 | 16774487 | 16771448 | 2826 | 16770021 | 16775369 |
Then I tried to give input from ECG simulator to ADS1298 and captured channels ADC values, which I mentioned in earlier posts.
Then the offset was subtracted from channel ADC data respectively and plotted the graph. To my surprise it is no where near to what is expected.
I just want to know, whether my procedure is correct or not? let me know if you need any more information to understand the issue.
please provide your input to resolve this long pending issue.
Thanks in advance,
Veera