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.

CC1312R: Data exchange between SCIF&ARM

Part Number: CC1312R


Hi Team,

A customer uses SCS to do some test about DAC output from analog pin, please check his problem below:

CCS  930 

SDK  simplelink-cc13x2-26x2sdk-3-40-00-02

SCS setup_sensor_controller_studio_2_6_0_132

1. The output level could change with input.DACLEVELSET while similating with SCS, but it was a square wave of 330HZ,90% duty cycle.

Here is some snippet of his code:

#include "mySCIFapp.h"  //
//#include <unistd.h>
//#include <stddef.h>

// SCIF driver callback: Task control interface ready (non-blocking task control operation completed)
void scCtrlReadyCallback(void)
{
 }

// SCIF driver callback: Sensor Controller task code has generated an alert interrupt
void scTaskAlertCallback(void)
{
}

void MySCInit()
{
    // Initialize the SCIF operating system abstraction layer
    scifOsalInit();
    scifOsalRegisterCtrlReadyCallback(scCtrlReadyCallback);
    scifOsalRegisterTaskAlertCallback(scTaskAlertCallback);
    // Initialize the SCIF driver
    scifInit(&scifMyDriverSetup);
   // scifMyTaskData.dactast.input.DACLEVELSET =200;
    scifStartTasksNbl(1 << SCIF_MY_DACTAST_TASK_ID);
}

void MyDACValueSet(uint16_t value)
{
    //uint16_t temp=0;
    // Stop the "DACTAST" Sensor Controller task
    if (scifWaitOnNbl(20000) != SCIF_SUCCESS) {
    }
    else if (scifStopTasksNbl(1 << SCIF_MY_DACTAST_TASK_ID) != SCIF_SUCCESS) {
    }

   scifMyTaskData.dactast.cfg.DACLEVELINITVALUE = value;
   scifMyTaskData.dactast.input.DACLEVELSET =value;
    // (Re)start the "DACTAST" Sensor Controller task
    if (scifWaitOnNbl(200000) != SCIF_SUCCESS) {

    }
    else if (scifStartTasksNbl(1 << SCIF_MY_DACTAST_TASK_ID) != SCIF_SUCCESS) {
    }
    //temp=scifMyTaskData.dactast.input.DACLEVELSET;
}

 

BR,

Viki Shi

  • Hi Viki,

    It is not entirely clear what the problem is. Could you please elaborate more on what the customer expected to see, and what actually happens? And, is there steps for us to reproduce this issue?

  • Hi,

    Sorry for the delay.

    He wants to output a level from a analog pin, he tested with io23,which was connected to an oscilloscope.

    Hardware: LAUNCHXL-1312R1     REV:D 

    Code is posted before.

    TASK RESOURCES setting: (run-time logging)        (analog pins (dio/aio  23))    (compa)     (reference DAC)     (RTC_Based excution scheduling)

    Task Testing: Add  run execution code, and the oscilloscope showed that the amplitude was adjustable, but it was a square wave. The above (run-time logging) and (RTC based extracting scheduling) had no effect for the results.

    BR,

    Viki Shi

  • Hi Viki,

    The code you posted has no context. It is a set of functions that is never called (at least you have not shared any such code). To help you we would also need to know how he interacts with the SC from the ARM CPU. The fact that it works in Task Testing and not CM4 I would guess means there is something lacking on the CM4 side.

    SCS code would also be helpful.

  • Hi,

    The SCS initiation code is as follows:

    compaSelectGpioInput(AUXIO_A_DACOUTPUT);

    compaEnable(COMPA_PWRMODE_ANY);

    refdacEnable(REFDAC_PWRMODE_ANY, REFDAC_REF_VDDS);

    refdacStartOutputOnCompaIn(cfg.DACLEVELINITVALUE);

    refdacWaitForStableOutput();

    The SCS excution code is as follows:

    refdacChangeOutputValue(input.DACLEVELSET);

    refdacWaitForStableOutput();

    These are the codes in SCS, and output to IO23. The software setting results in an oscilloscope is a square wave.

    BR,

    Viki Shi

  • Hi Viki,

    Have you set any power constraints in the CM4 application? Note that the DAC will stop operating when in low-power modes.

    Could you for example try to call "Power_setConstraint(2)" (2 is disallow standby, there is a define for that as well) and see if it changes anything for you?

  • Hi,

    Thanks for your comment.

    Adding this function to code has no effect. And the result was a square wave if used SCS directly. 

    If set "Power and Clock settings"----"inital power mode" in SCS to low power, the output was a DC with ripple.

    BR,

    VIki SHi

  • Hi Viki,

    For the sake of simplicity, could you share the complete SCS project with me so that I can look closer at all settings and try it myself?