Variating frequency of the sine wave generated on LPC54628.

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

Variating frequency of the sine wave generated on LPC54628.

跳至解决方案
1,246 次查看
Rutvikk
Contributor I
I have been working on a project that requires generation of a Sine wave and variation of frequency and amplitude. I am using the example i2s_dma_transfer from the driver_example included with the SDK but cannot understand how I should manipulate the clocks to variate the frequency. The variation of the frequency has to be in the range of 3.00 Hz to 400.00 Hz. Here I am using the pre-written sine table and also want to change the sine table for 24 bit. But I cannot figure out how to change the values as the normal sine table generator values, when fetched to the array gives an erroneous output. Please if someone can solve my query and guide me to figure out how to go about with this task. If someone has an experience working on the similar project please guide me on how you carried the task out. Thanks.
0 项奖励
回复
1 解答
1,234 次查看
frank_m
Senior Contributor III

I hade done a somehow similar project years ago. But with a DAC as direct output, and not I2S.

The DAC output was served from a timer interrupt at a 100kHz rate. Within the interrupt, I calculated the sine table index from the current requested output frequency and the timer period, and wrote this value to the DAC. The latter was internal, and thus just a simple 16-bit write. Two ADC channels with attached potentiometers served for frequency and amplitude adjustment in realtime.

Run on a first-generation M3 with 72MHz core clock, it worked sufficiently well up to about 40kHz output frequency.

I suppose this does not really well apply to your case. I am not sure about manipulating the I2S clock, and how an attached device would handle  that.

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,220 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

 

The Integrated Inter-IC Sound Bus (I2S) is a serial bus interface standard used for connecting digital audio devices together, not used to generate sine wave. 

 

BR

Alice

0 项奖励
回复
1,235 次查看
frank_m
Senior Contributor III

I hade done a somehow similar project years ago. But with a DAC as direct output, and not I2S.

The DAC output was served from a timer interrupt at a 100kHz rate. Within the interrupt, I calculated the sine table index from the current requested output frequency and the timer period, and wrote this value to the DAC. The latter was internal, and thus just a simple 16-bit write. Two ADC channels with attached potentiometers served for frequency and amplitude adjustment in realtime.

Run on a first-generation M3 with 72MHz core clock, it worked sufficiently well up to about 40kHz output frequency.

I suppose this does not really well apply to your case. I am not sure about manipulating the I2S clock, and how an attached device would handle  that.

0 项奖励
回复