Input Capture/Output Compare

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Input Capture/Output Compare

1,759件の閲覧回数
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 返信

907件の閲覧回数
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 件の賞賛
返信