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.

CC2650: [SCE + ADC] 1ms period, 1sec (1000 samples) sampling example

Part Number: CC2650

Champs,

For about using Sensor Controller Engine and ADC, user wants to get 1 second duration, total 1000 samples of 1ms period sampling.

With the latest Sensor Controller Studio (v1.4.0), it seems current smallest (fastest) period is 10ms.

* Is it possible to get ADC 1000 samples with 1ms period sampling frequency?

* If possible, do you have SCE example code of doing ADC sampling with 1ms period sampling, for 1 second duration?

Thanks and regards,

Hayden

  • Hi Hayden,

    Hayden Kim said:
    * Is it possible to get ADC 1000 samples with 1ms period sampling frequency?

    Yes

    Hayden Kim said:
    * If possible, do you have SCE example code of doing ADC sampling with 1ms period sampling, for 1 second duration?

    I have no example that I can give you to sample at 1ms, but you can start with the ADC Data Logger example (already in Sensor Controller Studio) and modify a few parameters.

    1. You will need to change the period (in your application code)
    2. You will need to change the BUFFER_SIZE to 1000 (in Sensor Controller Studio)

    The period at which the sensor controller is triggered is set by the tick period configured in the application code.

    The period is modified when calling this funciton:

    void scifStartRtcTicksNow  ( uint32_t   tickPeriod )

    Here is the definition of the parameter taken from the Sensor Controller Interface documentation:

    tickPeriod Interval at which subsequent ticks are generated:
    • Bits 31:16 = seconds
    • Bits 15:0 = 1/65536 of a second

    So, in order to get a sample every 1ms, you need to call scifStartRtcTicksNow  like this:

    scifStartRtcTicksNow (0x00010000 / 1000);

    It will not be exactly 1ms because they will be in fraction of 1/65536 of second, but close enough.

    Regards,

    Michel