Tone generation using FTM2 of KEA-128

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tone generation using FTM2 of KEA-128

764 Views
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 Kudos
Reply
1 Reply

631 Views
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 Kudos
Reply