Forum Rule: Always post complete source code & details to reproduce any issue!
Page 3 of 3 FirstFirst 1 2 3
Results 51 to 58 of 58

Thread: 1 MSPS on a T4? Is this possible...

  1. #51
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    1,369
    Maybe this helps to set up the differential ADC in principle. https://forum.pjrc.com/threads/57890...dout-with-T3-2

  2. #52
    Quote Originally Posted by luni View Post
    Maybe this helps to set up the differential ADC in principle. https://forum.pjrc.com/threads/57890...dout-with-T3-2
    Thanks Luni and Jonr, I like the differential idea ADC but couldn't get the T3.6 to run at nearly the speed I needed, hence the move to the T4 and T4.1, only issue is that these are sans diff ADC

  3. #53
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    315
    Unfortunately, your circuit diagram illustrates a major problem with direct connection of Wheatstone bridges. They often present several K Ohms of impedance at the ADC inputs. This can slow the response of the circuit significantly. Depending on the connections, those high-impedance inputs can also pick up noise from nearby digital circuits. Differential sampling will help with that, but may not fully eliminate the noise. Another problem with these circuits is that the output voltage differential may be just a few millivolts.

    This circuit really needs a fast differential amplifier with high-impedance inputs to convert the signal into a single-ended output. We always needed something like that on our oceanographic pressure sensors and we were only sampling at about 400Hz.

    If you could post the type of sensor you are using, I might be able to give you an amplifier design that could clean up the signal and require only a single ADC input--which could easily be sampled at 1MHZ using code posted earlier.

  4. #54
    Quote Originally Posted by mborgerson View Post
    Unfortunately, your circuit diagram illustrates a major problem with direct connection of Wheatstone bridges. They often present several K Ohms of impedance at the ADC inputs. This can slow the response of the circuit significantly. Depending on the connections, those high-impedance inputs can also pick up noise from nearby digital circuits. Differential sampling will help with that, but may not fully eliminate the noise. Another problem with these circuits is that the output voltage differential may be just a few millivolts.

    This circuit really needs a fast differential amplifier with high-impedance inputs to convert the signal into a single-ended output. We always needed something like that on our oceanographic pressure sensors and we were only sampling at about 400Hz.

    If you could post the type of sensor you are using, I might be able to give you an amplifier design that could clean up the signal and require only a single ADC input--which could easily be sampled at 1MHZ using code posted earlier.
    Hello mborgerson, thanks that would be amazing (in the meantime I will start looking into this myself, I was not aware that I could use an amplifier to get a single output...yes my electronics noob status is still firmly intact)! I am using the Endevco 8530C-100 pressure sensor, datasheet link below:


    https://buy.endevco.com/ContentStore..._DS_082219.pdf

    Can I really push my luck and also ask, how did you convert the .DAT file created by the code in post #45 to a readable format? I use matlab to convert the data from code in post #26 to a readable format but have not been able to do the same for the code in post #45.

  5. #55
    Senior Member
    Join Date
    Jul 2020
    Posts
    705
    Quote Originally Posted by Maximiljan View Post
    I have since Late December 2020 been trying to modify the code in post #26 to accommodate measurement of a full wheatstone bridge (Picture attached), doing this will reduce much of the environmentally induced variability in my readings from a pressure sensor but to put it bluntly it's been an astounding disaster.

    Attachment 23347
    For a strain-guage wheatstone bridge configuration you need an instrumentation amp to boost the differential mode signal.
    There are many instrumentation amps you can get, its basically 3 opamps in a single package.

    https://en.wikipedia.org/wiki/Instrumentation_amplifier
    https://www.ti.com/amplifier-circuit.../overview.html

  6. #56
    Quote Originally Posted by MarkT View Post
    For a strain-guage wheatstone bridge configuration you need an instrumentation amp to boost the differential mode signal.
    There are many instrumentation amps you can get, its basically 3 opamps in a single package.
    I've really been turning over the wrong stones. Thank you MarkT. This is exactly what I needed, just didn't know it.

    @mborgerson, maybe I should first put some time into this before you spend more of your time finding a suitable amplifier design to suggest.

  7. #57
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    315
    Quote Originally Posted by Maximiljan View Post
    Can I really push my luck and also ask, how did you convert the .DAT file created by the code in post #45 to a readable format? I use matlab to convert the data from code in post #26 to a readable format but have not been able to do the same for the code in post #45.
    The output data from the 1MSample logger is a binary file with a sequence of 16-bit unsigned integers. Each integer can have a value between 0 and 4095, which represents the range of values output by the ADC in 12-bit mode. Here is a simple Matlab function to read and display the data on the SD Card.

    Code:
    function [dout]=load1MSample(filnam)
    % load  analog logger collection of 1MSample data with ADC Timer
    % 1/22/21  MJB
    
    if nargin == 0
        [raw_name,temp,filterindex]=uigetfile('*.dat','Load 1MSample Logger File');
        filnam=[temp raw_name];
    
    else 
        filnam = [filnam];
    
    end
    
    disp(sprintf('Reading data from %s',raw_name));
    fid = fopen(filnam,'r');
    fseek(fid,0,'eof'); % move to end of file
    pos2 = ftell(fid); % pos2 is overall length of file
    frewind(fid); % move back to beginning of file
    
    %  each record is 2 bytes
    %  uint16 adc A9 value
    nrecords=floor((pos2)/2); % number of records
    disp(sprintf('%d records of data in the file',nrecords));
    
    fseek(fid,0,'bof');
    % next read ADC
    adcref = 3.32;   % assumed value of adc reference
    % in 12-bit mode max output count is 4095
    adcounts = fread(fid,nrecords,'uint16');
    dout = adcounts * (adcref/4095.0);
    fclose(fid);
    plot(dout);
    
    end

  8. #58
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    315
    I assume that you are driving the sensor with 5V and ground for your power. The outputs should be at about 2.5V each. The T4.1 ADC has an input limit of about 3.3Volts, so you probably need a design that offsets the output signal down closer to zero volts. Otherwise pressure signals over 0.8 Volts will saturate your ADC inputs. You need to go through your sensor's sensitivity specs and calculate the maximum signal you expect in your tests, then design the circuit so that the output will be within the 0 to 3.3V range of the ADC. You also need to make sure that the amplifier has the bandwidth and slew rate to handle the fast pressure transients. (If the transients were slow, there would be no need to sample at 1MHz!)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •