9 years, 4 months ago.

Waveform's frequency

Hey it's Florent!

I don't understand in your code how you set the frequency of the output: the DMA word transfer is triggered at I2S rate right?

Question relating to:

Simple Exmple DMA, F401RE, I2S, Nucleo

1 Answer

9 years, 4 months ago.

Hi Florent, Nice to meet you again )

main.cpp

struct
I2S_InitTypeDef my_I2S_InitType 's member
 I2S_AUDIOFREQ_44K,

is Frequency of I2S output.

But It's depend on I2S PLL Setting,
#define PLLI2S_N  271
#define PLLI2S_R  2

pls refer to STM32CubeMX.

Hey! It's sampling frequency, but I'm talking about waveform frequency. For exemple for your synthesizer, how do you output a 440Hz sinewave and then a 780Hz sinewave?

For example, with STM32F334's internal DAC, you can use TIM6 to trigger DMA transfer to the DAC for setting the frequency of the output. But I don't know how to do it with I2S DAC

posted by florent Ecochard 18 Aug 2015

This Sample is not Synthesizer.

Output wave is 
Lch - Sinewave 44.1k/256 = 172Hz
Rch - SawWave 44.1k/256 = 172Hz

I2S MCK = 44.1kHz * 256
I2S SCK = 44.1KHz * 32
I2S WS = 44.1kHz

If you want to make Synthesize Wave,
You must study Interpolation of Wave Data. 

/media/uploads/p_igmon/new_interporation.png

posted by p igmon 18 Aug 2015