This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

High sampling rate on ADC with F28069M stops my code (simulink)

Hello, 

I am trying to use the f28069M to take samples at a rate of about 10^6 samples per second and then perform an FFT on every 2048 samples. When I run my code with a sample rate of 10^5 samples per second, I am still able to collect samples, compute the FFT and send the peak frequency over serial. However, as soon as it surpasses that, the code simply stops working; nothing gets sent over serial. 

I tried to include some blinking LED's to see if they would still work. At the lower rates, the LED's blink normally. However at 10^6, the LED's just turn on and do not blink at all. 

I'm guessing that the board is being bogged down by the high sampling rate but I know that it should be able to sample at several Megasamples per second. 

Is there anything I can do to make the code usable at these rates? 

Thanks, 

Eric

  • Hi Eric,

    I don't fully understand all the nuances of your question, but I can provide a bit of guidance;

    By default MathWorks is not enabling any optimizations. But you can do that from Code Generation-> Build Configurations -> Faster runs.

    If you are running from Flash, performance will be degraded. There are options to copy code from Flash to RAM during execution.

    For more help, you should contact MathWorks Technical Support and provide your model to them so it can be evaluated.

    Cheers,

    -Brian

  • Hi Eric,
    You might want to also make sure that your ADC's acquisition window is adequately small to meet your new sampling rate.

    Thank you,
    Brett

  • Hello Brian,
    Thanks for your response. I set my the build configurations to optimize for faster runs but it made no difference. I have also been using the smallest acquisition window possible (7) so I don't think that is the problem. 

    In regards to what you said about copying from flash to ram, is that something that I can do through simulink itself or does it have to be done by editing a compiler file of sorts?
    Thanks in advance for the help!
    All the best,
    Eric