Tone generation using FTM2 of KEA-128

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

Tone generation using FTM2 of KEA-128

763 次查看
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 回复

630 次查看
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 项奖励
回复