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.

RTOS/CC1310: CC2640 ADC reading in a particular time interval

Part Number: CC1310
Other Parts Discussed in Thread: CC2640

Tool/software: TI-RTOS

I need to have a DIO_n output at 50% duty cycle clock (around 10kHz, low jitter, timer based) and make an ADC measurement at a fixed time (also low jitter, timer based) after the rising and falling edge to the 10kHz DIO_n.  Ideally this process would buffer up several (maybe 16) of these sample pairs for subsequent processing.   If you have any examples or proposed direction(s), please share.

  • Hello,

    Refer to this CC1310 ADC example for help getting started ( dev.ti.com/.../ ). There is also an ADC TI Driver example you can use for the CC2640 ( dev.ti.com/.../ ). It is unclear exactly which device you are using.

    -Matt
  • Also look into using the Sensor Controller to do this.
  • I've been trying to understand how to do this with the event fabric and have this concept (below), and would like to know if this direction is correct... I've mainly been studying the technical reference manual to understand the HW capability
    www.ti.com/.../swcu117h.pdf

    The ADC will be in asynchronous mode, and the end of sampling (start of conversion) will occur at each edge of the PWM output.
    This is how I hope to synchronize the ADC conversion with the GPT PWM output:

    ADC_CTL.START_SRC <= MCU_EV //set the ADC start source to come from the MCU_EV event
    AUXSEL0.EV <= GPTxA/B interrupt event // Set the event fabric to make AUX Subscriber 0 the GPT interupt
    TAMR.TAPWMIE <= Enable interrupt // Enable the PWM edges as the timer interrupt source
    CTL.TAEVENT <= Both Edges??? // Make both edges generate an interupt

    1) Does this look correct?
    2) Do you have a different approach?
    3) Is AUX Subscriber 0 the ADC in this case? How do I make the ADC Subscriber 0?
    4) When both PWM edges are selected as the interrupt source, how long is the interrupt asserted?
  • Hi Wayne,

    If you'd like to synchronize an ADC conversion along with a 10kHz DIO output, wouldn't you just be able to set up a Timer module (as described in the end of this post e2e.ti.com/.../551308 ) with a period of 50us and then trigger an ADC conversion along with toggling a DIO pin in the timer callback function? The period of 50us is due to your post above mentioning you wanted a conversion on every edge of a 10kHz signal.

    -Matt
  • The PWM and ADC sampling must be very low jitter, and therefore the conversion start time must be hardware driven. A timer callback function will induce unwanted jitter. That's why I have tried to make the timing purely hardware driven.

    This Forum Post seems to agree with my finding.
    e2e.ti.com/.../463461
  • Wayne,

    Okay that makes sense then why you wouldn't want to use the timer.

    I collaborated with a colleague and they recommended that you can use the adcBufContinuousSampling example I sent you previously and just set the adc.BufParams.samplingFrequency to meet your frequency requirements. If you'd also like the PWM signal edges to be synchronous with the ADC sampling, then you can trigger the continuous sampling to start at the first edge of the PWM signal so that all subsequent samples and edges will then be synchronized.

    -Matt