Hi,
I have c6678, pdk 1.0.0.17
I am trying to create a simple 64 bit gp timer, I copied from timer_test.c the following code:
CSL_TmrHandle hTmr;
CSL_TmrObj TmrObj;
CSL_Status status;
CSL_TmrHwSetup hwSetup = CSL_TMR_HWSETUP_DEFAULTS;
CSL_TmrEnamode TimeCountMode = CSL_TMR_ENAMODE_ENABLE;
/* Clear local data structures */
memset(&TmrObj, 0, sizeof(CSL_TmrObj));
printf("Debug: Testing 64bit Timer in Single Shot Mode...\n");
hTmr =CSL_tmrOpen(&tmrObj, 0, NULL, &status);
if (hTmr == NULL)
return -1;
/* Set the timer mode to 64bit GP Timer Mode and set the PRD registers */
hwSetup.tmrTimerMode = CSL_TMR_TIMMODE_GPT;
hwSetup.tmrTimerPeriodLo = 0x0f;
hwSetup.tmrTimerPeriodHi = 0x00;
CSL_tmrHwSetup(hTmr, &hwSetup);
/* Reset the Timer */
CSL_tmrHwControl(hTmr, CSL_TMR_CMD_RESET64, NULL);
/* Start the timer in SINGLE SHOT Mode. */
CSL_tmrHwControl(hTmr, CSL_TMR_CMD_START64, (void *)&TimeCountMode);
//First time
CSL_tmrGetTimHiCount(hTmr, &countHi);
CSL_tmrGetTimLoCount(hTmr, &countLo);
//Second time
CSL_tmrGetTimHiCount(hTmr, &countHi);
CSL_tmrGetTimLoCount(hTmr, &countLo);
In the second time I get ountHi=0 and countLo=0, is their an option that the counter will not be stopped and cleared after I read it? and what is the size of the time period?