Part Number: TSW1400EVM
This is in reference to an older thread but I was trying to run the script to convert the *.bin ADC codes binary file to time domain data in matlab.
In HSDC I noticed for long sample times (much larger than 524288 samples), the maximum number of time domain data points I can save to excel is 2^16 (in the upper time domain window). I wanted to be able to run long time sequences but save all the data points at the smallest resolution (i.e. if I was collecting 20 ms of data at 100MHz, I want samples at every 10 ns, not 305 ns).
It appears if I save the data to *bin file (ADC Codes) the resolution of the data is maintained. It also appears that the software saves data for all channels into one bit stream. (hence if Im saving 4194304 samples per channel, the file will produce (4194304)*4 entries for a four channel ADC).
I tried the following script in matlab to extract the time domain data, but it doesn't seem to make sense or match HSDC outputs. (file name = somthing.bin)
fid = fopen('Filename','r');
N=14
X = fread(fid,'int16');
fclose(fid);
X = X-2^(N-1);
X = X./2^(N-1);
I omitted the ReadTiAdcData() function because I did not have the spectrum_analyzer.m file required to run it.
The resulting data doesn't seem to make sense and im not sure if im parsing it correctly from the get go. Im using the TSW1400EVM with a ADC3444EVM (14 bit). The ADC is four channel but I only have data coming in on one. When I tried to separate the data by four it also didn't seem to change (since one channel is only receiving data) so I suspect my assumption of how the data is separated above is incorrect.
Previous question about this: e2e.ti.com/.../1397498