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.

Periodic sampling using the f28069M with simulink

Hi all, 

I am attempting to sample a signal through my ADC, add it to a buffer and then find the peak frequency of the signal using an FFT block in Simulink. Here is my code:

This seems to work fine at low sampling rates but my code stops working when i set the ADC rate to 1e-6. I have optimized my build for fast run, I have set my acquisition window to the smallest value possible and have not been building it to boot from flash (which I believe means that it must be running on RAM) so I feel that I have done everything to speed up the execution. 

I spoke with Mathworks who seem to think that the problem stems from the fact that my buffer is being filled and sending the data to the FFT before the previous set of data has been processed. Although I need a high sampling rate, I only need to sample my signal every second.  In other words, I want it to take 1024 samples, put them in the buffer, find the peak frequency and then wait 1 second before repeating the process. In that way, the FFT block would never receive new data before it had finished processing the previous batch. I do not need my code to do anything else during the 1 second wait. 

I have though of using a triggered system (which I have no experience with) but have not been able to set it up without getting any build errors. I get an error saying that the ADC must have an inherited or constant sampling time and I am not too sure how to handle this. I think my main problem is that I do not know which blocks should go in the triggered system and how to go about triggering it. 

Is there a good way to set my code up to accomplish what I have described above?

Thanks in advance, 

Eric

  • Eric,

    I apologize for the delay in responding. Brian McKay, the MathWorks contact for the TI C2000 team, has invited you to connect with him on E2E. He would like to get in touch over phone to assist you. Once you're connected with Brian, you can send him a private message with your contact information and set up a time to talk.

    The E2E help pages explains how to send messages and connect with others:

    Another option in case you're not able to connect with and message him, I can give him your email address on your TI account if I have your permission.

    Thanks,

    Elizabeth