SWRA578B October   2017  – April 2020 CC1312PSIP , CC1312R , CC1314R10 , CC1352P , CC1352P7 , CC1352R , CC2620 , CC2630 , CC2640 , CC2640R2F-Q1 , CC2642R , CC2642R-Q1 , CC2650MODA , CC2652P , CC2652R , CC2652R7 , CC2652RB , CC2652RSIP

 

  1.   Ultra-Low Power Sensing Applications With CC13x2/CC26x2
    1.     Trademarks
    2. 1 Overview
    3. 2 Measurement Conditions
      1. 2.1 Software
      2. 2.2 Hardware
    4. 3 Measurements
      1. 3.1 BOOSTXL-ULPSENSE
        1. 3.1.1 Analog Light Sensor
        2. 3.1.2 Capacitive Touch
        3. 3.1.3 LC Flow Meter
        4. 3.1.4 Potentiometer
        5. 3.1.5 Reed Switch
        6. 3.1.6 SPI Accelerometer
      2. 3.2 LPSTK-CC1352R
        1. 3.2.1 I2C Light Sensor
        2. 3.2.2 I2C Temperature and Humidity Sensor
        3. 3.2.3 SPI Accelerometer
        4. 3.2.4 Hall Effect Sensor
      3. 3.3 Comparison with System CPU
        1. 3.3.1 4 MHz SPI Transfer
        2. 3.3.2 1 MHz SPI Transfer
        3. 3.3.3 Wake-up and Sleep
    5. 4 Summary
    6. 5 References
  2.   A Creating the comparison examples
    1.     A.1 SPI Transfer – Sensor Controller
    2.     A.2 SPI Transfer – System CPU
    3.     A.3 Wake Up and Sleep – Sensor Controller
    4.     A.4 Wake up and Sleep – System CPU
  3.   Revision History

SPI Transfer – Sensor Controller

The SPI transfer example is created in the following way:

  1. Open an empty_CCxxx2xx_LAUNCHXL_tirtos_ccs project in CCS, for example empty_CC1352R1_LAUNCHXL_tirtos_ccs.
  2. Create a new project in Sensor Controller Studio and select output directory to the empty_CCxxx2xx_LAUNCHXL_tirtos_ccs project folder.
  3. Select correct chip.
  4. Create a new task called “SPI” with “SPI Chip Select”, “SPI Data Transfer” and “RTC-Based Execution Scheduling” enabled
  5. Call the SPI Chip Select pin "CHIPSELECT"
  6. Let the code in “Initialization Code” be the following:
  7. fwScheduleTask(1);
  8. Let the code in “Execution code” be the following:
  9. // SPI Data Transfer spiCfg(SPI_POL0_PHA0,2); // 1MHz for Low-Power mode //spiCfg(SPI_POL0_PHA0,6); // 4MHz for Active mode spiBegin(AUXIO_SPI_CSN_CHIPSELECT); spiTx8bit(0x54); // T spiTx8bit(0x65); // e spiTx8bit(0x78); // x spiTx8bit(0x61); // a spiTx8bit(0x73); // s spiTx8bit(0x20); // spiTx8bit(0x49); // I spiTx8bit(0x6E); // n spiTx8bit(0x73); // s spiTx8bit(0x74); // t spiTx8bit(0x72); // r spiTx8bit(0x75); // u spiTx8bit(0x6D); // m spiTx8bit(0x65); // e spiTx8bit(0x6E); // n spiTx8bit(0x74); // t spiTx8bit(0x73); // s spiTx8bit(0x21); // ! spiEnd(AUXIO_SPI_CSN_CHIPSELECT); fwScheduleTask(1);
  10. Set the SPI pins to DIO25, DIO26, DIO27 and DIO28 to make sure no pins interface with other SPI devices on the Launchpad.
  11. Generate the code for the Sensor Controller.
  12. Delete “main_tirtos.c” and replace empty.c with the following code:
  13. /* TI-RTOS Header files */ #include <xdc/std.h> #include <ti/sysbios/BIOS.h> /* Example/Board Header files */ #include "ti_drivers_config.h" #include "scif.h" #define BV(x) (1 << (x)) /* ======== main ======== */ int main(void) { Board_initGeneral(); // Initialize the Sensor Controller scifOsalInit(); scifInit(&scifDriverSetup); // Set the Sensor Controller task tick interval to 0.1 second // This variable controls how often the wakeup is triggered uint32_t rtc_Hz = 10; // 10 Hz RTC ticks scifStartRtcTicksNow(0x00010000 / rtc_Hz); // Start Sensor Controller task scifStartTasksNbl(BV(SCIF_SPI_TASK_ID)); /* Start kernel */ BIOS_start(); return (0); }