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.

LAUNCHXL-F280049C: ADC resolution with low frequency and high frequency analogue waveform

Part Number: LAUNCHXL-F280049C

Technical_Support_Ti.docx

Dear Tech support,

I am trying to read values from the ADC of a Ti Picollo 280049C launch pad using the scope block in MATLAB Simulink. The Simulink block settings for the ADC are configured for an acquisition window (ACQPS = 8) and sample time 0.00001 s.

If I try to measure a 1 Hz sinusoidal analogue signal, then the ADC shows a perfect sine wave in Simulink, as shown below.

As soon as the frequency of the analogue signal increases, the resolution of the ADC seems to decrease. I'd like to be able to measure signals of 50 Hz frequency. With the current settings, it appears that samples are missing since the sine wave has poor resolution (See image below).

To check if the ADC does the conversion correctly, I have connected a DAC input to the ADC output. Indeed, the DAC output is a perfect sine wave if viewed on an oscilloscope, which means that, internally, the ADC is doing the conversion properly.

I now suspect that this problem relates to a communication issue between my laptop and the Ti Launchpad.

I use external mode to communicate between the laptop and the Launchpad and the baudrate for the COM port is maxed at 115200.

Please advise what could be the matter.

  • Ao,

    Is the customer attempted to export data real time, or creating a buffer of the data then exporting to Simulink?  Based on what is happening with the final image, I'm assuming that the issue is just with the data export.  As he has shown with the DAC image the ADC data looks to be OK. 

    It may not be possible to have a real-time export of data with other system activity going on.  Can the customer comment on how the data is being exported?  I think simulink uses the UART channel as he mentioned; we may need to look how the data is fed to the UART, things like using the DMA vs the CPU for the transfer.  Alternatively we can capture ADC data with the DMA as well.

    Best,

    Matthew

  • Dear Matthew,

    Thanks for the response. I am the customer with regards to this query.

    To answer to your question: Firstly let us consider the Ti Picollo 280049C Launchpad. We have used "External Mode" to read the data in real time while the system is running, by specifying the communication as "Serial over XCP". The COM ports have been configured with a baud rate of 115200 (max) and specific port numbers according to the device manager.

    If I use external mode as described above with a Ti Defrilo 28335 MCU, then the waveform from the ADC is perfect for a 50 Hz sine wave. The baud rate then is 921600 which is much higher than what the Ti Picollo 280049C has to offer. 

    Could the baud rate then be the issue? 

    Looking forward to your response. 

    Thanks so much

    Best wishes,

    Akshay

  • Akshay,

    Thanks for the extra info.  I think the baud rate could be one factor.  Another would be the relative speed of the MCUs and their instructions.  While F28335 is 150MHz F280049 is 100MHz, that is not the whole story here. 

    The flash access time on the F28335 is slightly faster at 25MHz vs 20MHz on the F28004x; but for what you are doing I would look to see if the program code is executing out of RAM for 0WS performance(or at least if they are both running from flash so our comparison is apples to apples).

    Can you elaborate on where the data on the scope is coming from?  Is this from the internal Buf DAC on the F28004x, or from an external DAC that is fed via data-stream? 

    If the data is correct inside the device per the 1st email I'm not exactly sure I understand the problem precisely.

    Best,
    Matthew

  • Hi Matthew,

    Thanks for the response. Both the F28335 and the F280049C codes are running from flash and MATLAB Simulink does not produce any error message about exceeding RAM in either case.

    The data on the Simulink scope comes from the output of the ADC scaled by 3.3/4095. The input to the ADC comes from a signal generator. Therefore, we are only trying to measure a signal from a signal generator, fed into an ADC with the ADC output Scaled by 3.3/4095 to get the actual analogue value.

    Best wishes,

    Akshay

  • Akshay,

    Is it possible on the F280049C to modify the linker file that MATLAB is using to run the code from RAM addresses to see if that changes the behavior?  If it is straightforward you could also attach the generated C code from both the F28335 and F28004x so I could see if there is a big difference in how the devices are exporting the data, as that might have something to do with it.

    Just re-looking at the analogue scope plot for the "bad" waveform it looks very similar to an undersampled signal, but from your investigation this is only seen when exporting the data out, vs the data-stream inside the device, correct?

    Best,

    Matthew

  • Hi Matthew,

    Thanks for the response. It is possible to modify the linker file from the "Configuration Parameters" tab in MATLAB. Which linker file should I then choose to run the code from RAM instead? I see 2 options that are available for the F280049C MCU: 

    1. c280049M

    2. c28004x Peripherals

    As you have correctly mentioned, the data stream inside the device seems correct as the DAC provides a clean output on the oscilloscope. It is only when displaying the signal on Simulink (using external mode) that shows an undersampled signal.

    Best regards,

    Akshay

  • Akshay,

    I will need to look into this a bit more, I think we can just edit the .cmd but I need to find that source on my machine.  Just to ask, have you also posted this on the MW forum in parallel?  They may have a simpler soln or known reason for the above.  I can try to loop them here too.

    Best,

    Matthew

  • Dear Matthew,

    I appreciate the time you are devoting to solving this issue. I have not posted it in the MW forum (unsure of what this one is about). May you please do the needful to loop them onto this threaD?

    Best regards,

    Akshay

  • Hi Pitambar,

    There is no way we can pull MathWorks team in this thread. I will send the reminder to MW team member, however as Matt said earlier, it will be much faster to get the response if you post the question at MathWorks forum. That thread is monitored by group of MathWorks expert.

    https://www.mathworks.com/matlabcentral/?s_tid=gn_mlc

    Thanks & Regards,

    Santosh

  • Hi Santosh,

    Thanks for the response. I will get in touch with MathWorks to try to solve this pending issue.

    Best wishes,

    Akshay