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.

MSP432P401R: Problem with adc14 clock frequency

Part Number: MSP432P401R


Hi,

I am quite new to this so please be kind to me. My aim is to record an analogue sine wave. I am looking at (adcsignalchannel.c) example which is in TI-RTOS. The port P5.5 is defined for A0 and P5.4 is for A1. For testing the adc14, I have done one example. I connected the P5.5 to the 3v3 and P5.4 to GND and what I see that ADC is reading is xxFF which is 255.  In this code I could find that number of samples are defined, for example 10 samples. I want to know the time between each sample? Or in the case I connect the P5.5 to the sine wave voltage and P5.4 to GND, I would like to know how can I read this sine wave and what is the ADC clock frequency to record a sine wave. Is it defined in this example in adcsignalchannel.c or I should write a code about it. When I connect the sine wave voltage to the P5.5, I do not get repeatable data which gives me an idea that it is recording a sine wave. If somebody can recommend a short code to do this, I would be happy since now I am just using the example which cover a lot of other things that makes me confused. It would be good if TI put short examples.

Thanks,

Baha

  • BEZAK said:
    I want to know the time between each sample? Or in the case I connect the P5.5 to the sine wave voltage and P5.4 to GND, I would like to know how can I read this sine wave and what is the ADC clock frequency to record a sine wave.

    To understand how stuff works, you shall read documentation. Read documentation chapters regarding questions you are interested in. In case after reading documentation you still have questions - do not hesitate to come back and ask.

  • Hello Baha,

    I am sorry for such a delayed response.  The code you reference is not using timers for timing between samples.  Instead, all of those samples happen immediately after one another in the loop iterations.

    You should try using the example code: adcBufContinuousSampling.c which allows you to set the adcBufParams.samplingFrequency parameter.

    The frequency of your sampling should depend on what resolution you require.  You could play with this value until you find something suitable for your application (2n+1 is Nyquist Sampling Theorem - starting with a frequency at least twice your highest expected frequency would be a good starting point.  It may require many times that though in order to reproduce point by point a sine wave.)

**Attention** This is a public forum