Hi Chris,
I have the arduino nano connected via SPI to the ADC.
I am using SPI mode 1.
![]()
To draw the chart I was first using my own C# application, but I switched now to a software thats called realView.
The decimal numbers are not referenced to ful scale.
So here is what I am doing on the Arduino:
I read the 3 bytes (_highByte, _middleByte, _lowByte) comming from the ADC and store them into a single variable (result). Here is the source code:
digitalWrite(CS,LOW);
SPI.transfer(0x01);
delayMicroseconds(DELAY_BEFORE_READ);
_highByte = SPI.transfer(0x0);
_middleByte = SPI.transfer(0x0);
_lowByte = SPI.transfer(0x0);
digitalWrite(CS, HIGH);
delayMicroseconds(DELAY_AFTER_READ);
result = _highByte * 65536 + _middleByte * 256 + _lowByte;
Directly after that I convert the unsigned 24 bit data to signed 32 bit data
if (result & 0x00800000)
{
result |= 0xff000000;
}
Then I cast the result into a float variable
result_float = (float)result;
So related to the jumps I noticed that I have these jumps within the raw data that I read from the ADC.
Here is the data that I recorded.
![]()
(Please visit the site to view this file)
The text document is separated into 3 columns -> 1. the variable result (so raw ADC data), 2. value in degree, 3. timestamp
You can see that I have 4 jumps at the time 11:23:35,11:23:39, 11:23:40 and 11:23:50.
If you want I can send you my complete Arduino projekt and the SPI protocol, but due to our client I can not post all of this within this blog. Let me know if you need more information.
Furthermore I would like thank for your support and your quick response.
Best regards
Thomas