hello,
I would want to use the ADS1247 with two 3-wire RTDs (100 ohms).
Is it possible?
Best regards.
Alessandro,
It could be that for some reason the SDATAC command is not being issued correctly. It is also possible that you have noise in your communication, in particular false triggering on your SCLK line.
Your basic functions appear to flow correctly, although you do not need to always write registers that don't change value. It is not clear what happens with the functions Read_Data_Manually() and Read_24bit_data() actually do. Could this be causing an issue?
The only good troubleshooting tool with respect to communication is an oscilloscope. The pictures you sent in an earlier posting doesn't show enough detail as to what may be happening.
Best regards,
Bob B
Hi Bob,
following you can find the two functions Read_Data_Manually() and Read_24bit_data():
void Read_Data_Manually(){ uint8_t command = READ_DATA_MANUALLY; //0x13 HAL_WriteSpi(&spiDesc, &command, sizeof(uint8_t));}
void Read_24bit_Data(unsigned long *RTD_Voltage_Ptr){
for(i = 1; i <= 3; i++){ HAL_ReadSpi(&spiDesc, (uint8_t *)&b1, sizeof(uint8_t)); bufferIN = b1; if (i == 1){ *RTD_Voltage_Ptr = (*RTD_Voltage_Ptr + bufferIN) << 8; } else if (i == 2){ *RTD_Voltage_Ptr = (*RTD_Voltage_Ptr + bufferIN) << 8; } else if (i == 3){ *RTD_Voltage_Ptr = *RTD_Voltage_Ptr + bufferIN; }
Alessandro
Is there any point In your routine where you might be turning on RDATAC?
No, there aren't.
I noted that when I put a break point (I am using a debugger) between the two sequences, I results are correct also with more runs.
If the problem goes away by stopping the program, then you most likely either have a timing issue or a noise issue that is created with the data lines toggling more often. Have you tried slowing down your communication to see if that solves the problem? Another issue could be poor grounding. A lot of ground bounce can corrupt the communication transfer. Can you send me a picture of your setup? Can you send me some better pictures of the scope so that I can actually see the SLCK transitions relative to the data in and out?