Hello, I wanted to ask how I can monitor or look up the tdc value on the CODE COMPOSER STUDIO below is the code I wrote in SCS.
and the jpeg I attached explains the use of the timer to read the length of the IR signal(yellow SIG the comparator output is the blue SIG) to determine which button was pressed on the remote control.
INIT CODE
// Select Compa Inputs
U16 n = 0;
compaSelectGpioInput(cfg.pAuxioACompa[n]);
n = 1;
compaSelectGpioRef(cfg.pAuxioACompa[n]);
compaEnable();
evhSetupCompaTrigger(0, 1, EVH_GPIO_TRIG_ON_MATCH);
// Select 2 x 48 MHz from RCOSC_HF as TDC counter clock source
tdcSetCntSource(TDC_CNTSRC_96M_RCOSC);
//tdcSetTriggers(TDC_STOPTRIG_COMPA_LOW, TDC_STOPTRIG_COMPA_LOW, 1);
tdcSetTriggers(TDC_STARTTRIG_COMPA_HIGH, TDC_STOPTRIG_COMPA_LOW, 1);
tdcEnable();
// Prepare the TDC and trigger pulse
tdcArm(TDC_START_SYNC);
fwScheduleTask(1);
EXECUTION CODE
// Schedule the next execution
fwScheduleTask(100);
EVENTHANDLER CODE
U16 value;
U16 done;
U16 tdcValueL;
U16 tdcValueH;
compaGetOutput(value);
if(value == 0){
gpioClearOutput(AUXIO_O_LED);
evhSetupCompaTrigger(0, 1, EVH_GPIO_TRIG_ON_MATCH);
tdcWaitUs(100);
tdcCheckDoneEv(done);
if(done == 1){
tdcGetValue(tdcValueH, tdcValueL);
output.tdcValue = tdcValueL;
}
}else{
tdcArm(TDC_START_SYNC);
gpioSetOutput(AUXIO_O_LED);
evhSetupCompaTrigger(0, 0, EVH_GPIO_TRIG_ON_MATCH);
}
QUESTION RELATED TO THE CODE ABOVE
DO I NEED TO RESTART THE TIMER AFTER A STOPTRIGGER IS REACHED. IF YES DOES IT IMPLY ALSO A NEW TDC TRIGGER SETTING ? thanks
one last question is there a uDMA example either on the CCS or the SCS ?
thank you