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.

CCS/LPSTK-CC1352R: Changing update rate of accelerometer readings to 400Hz

Part Number: LPSTK-CC1352R
Other Parts Discussed in Thread: SYSCONFIG

Tool/software: Code Composer Studio

Could I have some pointers on how to modify the LPSTK-CC1352R 15.4 Stack sensor/collector code example to get as greater update rate as possible for the accelerometer readings. I note that the ADXL362 accelerometer on the LPSTK has a maximum update rate of 400Hz. I am looking to write a program that can achieve this update rate on the collector and print to a console.

[https://dev.ti.com/tirex/explore/node?node=AIKcHFRMmg0MRAyz1RySsg__pTTHBmu__LATEST]

 

I have followed the other example, Sensor and Collector TI 15.4 Stack Project Zero, which gives guidance on updating the reporting and polling rates to 1.5s. Code Composer Studio warns that changing these reporting and polling rates to below 1.5s will cause instability.

[https://dev.ti.com/tirex/explore/node?node=AFU6dryAU8NukjdRPy4T4Q__pTTHBmu__LATEST] 

 

Interestingly, running the LPSTK 15.4 Stack example, the accelerometer values are updated at a much greater rate than 3s, which is the reporting and polling rate settings in the .sysconfig files, and seems to update based on movement, i.e an event is triggered and the accelerometer value updates. This is in contrast to the other sensor values such as temperature and humidity which only update every 3 s. Does this mean that the accelerometer already reports to the collector at its maximum rate already? Could I have some guidance on how to modify this code to just report accelerometer values to the serial monitor, without any other sensor values.

 

Thanks,

 

Richard

  • Hello Richard,

    Thank you for the detailed description on the question you have and the homework you have done. Very informative.

    Accelerometer Portion:

    As you may already know, the Accelerometer is being controlled by the sensor controller. The sensor controller is separate MCU core inside the CC1352R1 package. This core is used for very low power operations while the main core is sleeping. This is the reason as to why you do not see the code from the example.

    What you can do is download sensor controller studio from ti.com. This tool is basically an IDE for the sensor controller core. Download the LPSTK accelerometer example, and from here you can modify as needed.

    This will generate some files, out of all the files created you will only need:

    • scif_framework.c/h
    • scif_osal_tirtos.c/h
    • scif.c/h

    You will copy and paste these files inside the adxl362 folder inside the application/lpstk directory of the example.

    The sensor is configured in the default 100Hz state, you can add an additional SPI write in the init code (in sensor controller studio) to configure the CFG register of the ADXL.

    Reporting Portion:


    Yes, the sensor will report environmental data separate from acc data by default. The Environmental data will be sent at the reporting interval rate, while the accelerometer data will be sent on a separate packet when a tilt is detected.

    If your main request is to be able to monitor the actual data from the serial output, you can always add an additional status line to the CUI (common user interface, this is the serial interface you have access to), you can check this training https://dev.ti.com/tirex/explore/node?node=AHs0wbxuPRpRbJcHasQeYw__pTTHBmu__LATEST and skip to Task2 steps edit ssf.h and edit ssf.c.

    Once you do this you can update this line with accelerometer data. To access the accelerometer data, I recommend you look at the Lpstk_readAccelerometerSensor() API in lpstk_sensors.c . This API is used to read the accelerometer readings directly from the memory, since memory is shared between the M4F core and sensor controller core.

    I know this answer is a bit long, but I wanted to give you some options and explain in detail why I suggested them.

    Let me know if this helps,

    AB

  • Thank you, all vey helpful, this gives me a lot to think about and experiment with. I have the SPI Accelerometer for LPSTK example code open in Sensor Controller Studio, how do I modify this to get 400Hz rather than 100Hz?

  • This is what I have added, is this correct?

  • Hello Richard,

    That is almost correct, but that won't work.

    Replace the cfg with ACCEL_REG_FILTER_CTL

    It should look like spiWriteReg(ACCEL_REG_FILTER_CTL , ACCEL_FC_ODR_400_HZ);

    Regards,

    AB

  • Thanks, I'll give it a try now.

  • Ok, I have tried but am given the following errors when I build the dmm_154remote_sensor_lpstk_app in CCS:

  • did you copy all the required files into the adxl362 folder?

    send a screenshot of the file structure.

    Try rebuilding and see if that helps.

  • Yes I copied all 6 files required. And I have tried rebuild and this is no better.

  • The problem seems to be that you copied one of those file to the root of the project.

    Delete it and it should build and compile.