Tone generation using FTM2 of KEA-128

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

Tone generation using FTM2 of KEA-128

783件の閲覧回数
vignesh_vb_7
Contributor IV

Hi,

I want to generate simple musical tones using FTM2 of KEA-128.Is there any reference or sample code for it?

0 件の賞賛
返信
1 返信

650件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Vignesh,

I do not think we have the code to generate simple musical tone. But I think you can do the following:

1)use ADC to sample the mic signal with 8KHz or more sampling frequency.

2)save the PCM to an array or even into flash.

3)based on the sampling frequency, you can compute the FTM_MOD value.

4)covert the ADC sample to the duty cycle, I do not suggest you change the sampling frequency, in mother words, the FTM_MOD register is constant.

5)in the FTM overflow ISR, update the FTM_CnV register to change the PWM duty cycle.

For the hardware filtering with inductor/capacitor, I suggest you search on Google with keywords "D-Type AMP"

Hope it can help you

BR

Xiangjun Rong

0 件の賞賛
返信