9SC08QG4 TPM input capture and general input.

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

9SC08QG4 TPM input capture and general input.

跳至解决方案
2,016 次查看
viking01
Contributor I

Hi

 

I'm using CodeWarrior in C to develop my software.

 

I've configured PTA0 on the 8pin device as an input capture (TPMCH0) input.  Can I still test the logic level on this pin by testing PTAD_PTA0 without having to change it to a General I/O first?

 

Also, I'm using interrupts to capture an input event, and saving the timer value to a variable (when the CH0F flag is set).  What is the difference between reading the TPMC0VH/L registers and TPMC0TH/L registers they appear to me to have the same information in them.  Is it a case that TPMC0VH/L is used for CH0F, and TPMC0TH/L is best used for T0F?

 

Thanks

viking01

标签 (1)
0 项奖励
回复
1 解答
915 次查看
viking01
Contributor I

Thanks bigmac,

 

Your assumption was correct, I did mean TPMCNT.  Thanks for your info and assistance.

 

Cheers

viking01

在原帖中查看解决方案

0 项奖励
回复
2 回复数
915 次查看
bigmac
Specialist III

Hello Viking01, and welcome to the forum.

 

In general, when a peripheral module is enabled, it will over-ride GPIO functionality.  I suspect this will also be the case for the input capture pin.

 

I think that you mean the TPMCNT (16-bit) register, compared with the TPMC0V register.

 

An input capture event will write the current contents of TPMCNT into the TPMC0V register, at the instant of the event.  Interrupt latency may then cause the two values to slightly differ at the time the interrupt is processed.  The true timer value for the capture event will therefore be that within TPMC0V.

 

Regards,

Mac

 

0 项奖励
回复
916 次查看
viking01
Contributor I

Thanks bigmac,

 

Your assumption was correct, I did mean TPMCNT.  Thanks for your info and assistance.

 

Cheers

viking01

0 项奖励
回复