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.

PRU-SWPKG: is there any example about pruss-iep0 timer of am62x?

Part Number: PRU-SWPKG

Tool/software:

Hi TI engineer,

is there any example about pruss-iep0 timer of am62x? 

just keep checking the IEP0/timer time out status flag. 

thanks,

James

PS,  in AM335x the timer works fine, and I want to port it to  the am62xx,

here is pieces of code,

void timer_init()
{
/* set default inc to 1, set compensation inc to 1 (though this is never used)*/
global_cfg = GLOBAL_CFG_DEFAULT_INC(1) | GLOBAL_CFG_CMP_INC(1);

/* Enable interrupts from cmp1 */
PIEP_CMP_CFG = CMP_CFG_CMP_EN(0) |1; // '|1' is clear counter0 auto,but test not work

/* set the value of cmp1 = (time_unit in us) * (no. of clk cycle for 1 us) */
PIEP_COUNT = 0; //write clear counter
PIEP_CMP_CMP0 = timeout;

/* clear the interrupt from cmp1 in case it has been set by mistake */
PIEP_CMP_STATUS = CMD_STATUS_CMP_HIT(0);

/* start the timer */
global_cfg |= GLOBAL_CFG_CNT_ENABLE;
PIEP_GLOBAL_CFG = global_cfg;
}

void timer_loop_checking() 

{ while(!( PIEP_CMP_STATUS & 1 ));
 PIEP_CMP_STATUS = CMD_STATUS_CMP_HIT(0);

}