Timer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer

1,452 Views
syedhashmiraza
Contributor III

hello iam using MCXA153 in this there is no mrt what is the repalcement of mrt ?this is my code and i want to build this in MXCA153 what is the replacemnet of MRT?

void Timing_StartCardClk(uint32_t cardClk) {
startTimer(CARD_CLK_DIV * cardClk);
}
 
static inline void startTimer(uint32_t value) {
MRT_StartTimer(MRT0, 0, MRT_CHANNEL_INTVAL_LOAD_MASK | value);
 
triggered = false;
}
 
void Timing_Init() {
// Setup MRT in One-Shot mode
RESET_PeripheralReset(kMRT_RST_SHIFT_RSTn);
const mrt_config_t conf = {false};
MRT_Init(MRT0, &conf);
MRT_SetupChannelMode(MRT0, 0, kMRT_OneShotMode);
 
MRT_EnableInterrupts(MRT0, 0, kMRT_TimerInterruptEnable);
NVIC_EnableIRQ(MRT0_IRQn);
}
 
Labels (1)
0 Kudos
Reply
5 Replies

1,427 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @syedhashmiraza 

The MCXA153 does not include an MRT peripheral. To achieve similar functionality, you can use the CTIMER available on the MCXA153.

CTIMER can operate in various modes, including timer mode, which is suitable for generating delays or triggering events like the MRT.

You can refer to the MCXA153SDK ctimer example.

Harry_Zhang_0-1734401158930.png

BR

Harry

0 Kudos
Reply

1,334 Views
syedhashmiraza
Contributor III

"Hello, can I use LPTMR as a replacement for MRT?"

0 Kudos
Reply

1,318 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @syedhashmiraza 

If you want to use LPTMR,

You can refer to the SDK LPTMR examples.

Harry_Zhang_0-1735783088744.pngHarry_Zhang_1-1735783175769.png

BR

Harry

0 Kudos
Reply

1,415 Views
syedhashmiraza
Contributor III

"Hello, can I use OSTIMER as a replacement for MRT?"

Tags (1)
0 Kudos
Reply

1,403 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @syedhashmiraza 

Yes, you can.

BR

Harry

0 Kudos
Reply