The LPTMR CNR R/W Question (some one help me lol

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

The LPTMR CNR R/W Question (some one help me lol

656 次查看
Howys_
Contributor II

Hello all,

I found a strange thing recently,

we need to write a data like 0x11 to CNR to read the current value of the LPTMR,

but, usually, we just need to read the CNR register so we can get the current value of the TIMER,

so, i want to know why NXP design CNR as RW instead of  RO,

is there any advantage in doing this?(It's important

Sorry i'm not good at english, but this question does really confused me for a long time,

waitting for your answer...

 

标记 (2)
0 项奖励
回复
6 回复数

639 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @Howys_ 

For better support, could you please specify which MCU, IDE and SDK you are using?

 

B.R.

VaneB

 

0 项奖励
回复

636 次查看
Howys_
Contributor II

Hi,@VaneB 

Thanks for your reply,

i'm very glad,

sorry, seems i don't have permission to upload images,

maybe you can see the "S32K-RM",

in page "1571",you can see there is a description of it: "The CNR returns the current value of the LPTMR counter at the time this register was last written",

and we need to write a data then we can get the current value of the counter,

but usually we just read it, and we can get the value,

so i think it's not a code question, it's more like a design question,

i want to know is there any advantage in doing this?

My friends say it's a NXP's bug, don't care about it, anyway we can get this value, it's fine.

But i don't think so, i believe there must be some reasons for this

MCU: S32K144

IDE: Keil

SDK: v4.0.1

Waitting for your reply,

B.R.

Howys

 

0 项奖励
回复

630 次查看
VaneB
NXP TechSupport
NXP TechSupport

what I understood from your question is that you want to know why the low power timer counter register (CNR) can be written and read instead of just read?
I am right?

0 项奖励
回复

626 次查看
Howys_
Contributor II

Yes!!!

That's what i want to know!

0 项奖励
回复

620 次查看
VaneB
NXP TechSupport
NXP TechSupport

The reason this register is read and write is because on each read of the CNR, the software must first write any value to the CNR. This will synchronize and register the current CNR value to a temporary register. The content of this register is returned on each reading of the CNR.

0 项奖励
回复

614 次查看
Howys_
Contributor II

Thank you for your reply,

From your reply I know the reason why we need to write CNR registers and read the value,

and i still don't know the advantages of writing and reading CNR registers instead of directly reading CNR registers,

when we design the CNR register, why don't we design the CNR register read only?

0 项奖励
回复