Input Capture/Output Compare

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

Input Capture/Output Compare

1,746 次查看
AndreiLuchuk
Contributor I

The HC05 had this feature, where a preset state was set out on a pin once a timeout or an edge event occurs on another pin:

 

BSET      IEDG1,TCR           ;SET INPUT CAPTURE 1 FOR POSITIVE EDGE SENSITIVITY

BSET      OLVL1,TCR          ;AT TIMEOUT, WRITE A 1 TO OUTPUT COMPARE 1

 

The user can also force the Output Compare:

BCLR      OLVL1,TCR          ;SET BIT LOW

BSET      FOLV1,TCR          ;FORCE BIT OUT

 

The HCS08 I'm using has this complicated FTM module, which does A LOT, but there is no simple way to replicate this feature. 

Moving up from HC05 to S08 is complicating things for me. Is there a trick to this on the S08?

 

The closest thing I can think of is using interrupts, but that requires a lot of time between the external interrupt and output signal.

标签 (1)
0 项奖励
回复
1 回复

894 次查看
bigmac
Specialist III

Hello,

 

I have not used a device containing a FTM module, but this module is said to be backward-compatible with the TPM module.

 

The timer module within the HC05 device has dedicated input capture and output compare pins.  For the FTM module (and TPM module), each channel is associated with a specific GPIO pin, which is used for timer operation whenever the channel is enabled for input capture, output compare or PWM operation.

 

Each channel may be configured for input capture on positive edges, negative edges, or on both edges of the input waveform.  For output compare mode, you may set, clear or toggle the channel output on each compare.  When the timer channel is disabled, the pin will assume the GPIO setting.

 

Regards,

Mac

 

0 项奖励
回复