How to check if clock for the PSOIF module is running?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I have a XMC4400 hexagon development board.

I like to be able to confirm that the clock for the POSIF is running.

I have code that inits the clock for the CCU which is called from DAVE_Init()

/* Function to enable the CCU Clock based on UI configuration */
CCU_Clock_init();

/**
* @brief Function to enable the CCU4 and CCU8 clock
* @note -
* @param None
* @retval None
*/
static void CCU_Clock_init(void){
/* Enable CCU Clock */
SCU_CLK->CLKSET |= (uint32_t)SCU_CLK_CLKSET_CCUCEN_Msk;
}


Technical referenece manual states in the sCU chapter that the fCCU clock supplies CCU4, CCU8 and POSIF. So I am assuming the above code starts the clock for the POSIF. But how can I tell the clock is actually driving the PSOIF at run time?

Thanks,

Steve
0 Likes
5 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
1. The fastest way is to check on the CCU timer register (eg. CC40Timer), if it is always showing the same value which means the CC40Timer is not running. Alternatiivly you can also check on the status of the "timer run bit" found in CC4yTCST.

2. If the "timer run bit" is not set pls set it at CC4yTCSET = 1
0 Likes
Not applicable
Travis,

thank you for your answer. I will give that a go.

Regards,

Steve
0 Likes
Not applicable
Travis,

observing CCU40_CC41.TCSET.TRBS at run time I see it is 0x0 also CCU40_CC41.TCST.TRB = 1 (T'imer is running).

So presumably the timer is not running, however, this piece of DAVE code should be setting the TRBS bit to 1:

CCU4SliceRegPtr->TCSET = CCU4_CC4_TCSET_TRBS_Msk;

in POSQE001_lStartCCUSlice(const POSQE001_SliceConfigType* SliceConfigPtr)

At run time if, I break the code, I write 1 directly to TRBS (using the registers pane) it is immediatley set back to 0 when resuming.

This is not what I am ecpecting. Surely, once set TRBS should remain as 'Timer is running' (1).

Can you explain this?

Regards,

Steve
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
AlliedSteve wrote:
Travis,

observing CCU40_CC41.TCSET.TRBS at run time I see it is 0x0 also CCU40_CC41.TCST.TRB = 1 (T'imer is running).



The timer status shows that it is running. In actual fact the timer should be running.

1. Reset and run the software.
2. Execute a software break and check on CC40TIMER register. It should be non zero if the timer is running.


AlliedSteve wrote:
Travis,

At run time if, I break the code, I write 1 directly to TRBS (using the registers pane) it is immediatley set back to 0 when resuming.

This is not what I am ecpecting. Surely, once set TRBS should remain as 'Timer is running' (1).

Can you explain this?



This is normal, as a read to this register will always returns 0.
0 Likes
Not applicable
Travis,

OK, I now understand.

Thanks,

Steve
0 Likes