Part Number: TMS320F28335
Tool/software: Code Composer Studio
So i'm trying to write data from my ADC to a simple text file.
I'm using breakpoints to write data to file, when i use this for an integer "a" while incrementing (a++), when i finish running the program the data is displayed correctly (see at bottom of post).
However if i try to do the same using a float (multiplying with an incrementing integer with pi, it displays the same value twice).
And if i try to sample values from the ADC it displays the same floating value at least 4 times - and skips some values that i would expect to be displayed (i would expect with a resolution of 4096 and a sampling frequency of 100 microseconds i would see all of the discrete values used while changing the voltage with a potentiometer).
As seen on the figure it is a quite significant leap within sample 3 to 18 from 1.65 to 2.25 volts.
If i set the length to anything but 0x01 for a float (i've tried 0x02, 0x03 0x04) i get some totally arbitrary values, like i am extracting wrong parts of the memory.
| int | float with length x01 | float with length x02 | float with length x04 | ADC measurements length x0 | ADC discrete value |
| 1 | 3.141592654 | 0 | 0 | 0.479003906 | 654 |
| 2 | 3.141592654 | 0 | 0 | 0.479003906 | 654 |
| 3 | 6.283185308 | 0 | 0.145825192 | 0.479003906 | 654 |
| 4 | 6.283185308 | 0 | 3.14592654 | 0.479003906 | 654 |
| 5 | 9.424777962 | 3.141592654 | 0 | 0.48046875 | 656 |
| 6 | 9.424777962 | 0 | 0 | 0.48046875 | 656 |
| . | . | 3.141592654 | 0.145825192 | 0.48046875 | 656 |
| . | . | 0 | 3.14592654 | 0.48046875 | 656 |
| . | . | 6.283185308 | 3.14592654 | 0.48046875 | 656 |
So the questions are:
1. What am i doing wrong?
2. Is there a better way to extract the full data set from the DSP?
3. Why is the float displaying same value twice, and from the ADC multiple times?
Bonusinfo: i'm using PWM to start AD conversion, code composer studio v. 6.1.3 ..