2019-08-09 07:12 AM
This is probably more of a wish list item than a question that can be solved - I'm using an STM32L4 chip's SAI to interface to an I2s microphone (SPH0645lm4h Knowles microphone). It works well.
But things would be even better if the I2s reception could be somehow synchronised to an LSE derived clock. eg. 32768Hz/2 = 16384Hz. That way I would be able to get the full accuracy of the LSE crystal for pitch analysis. Maybe there is a way but I haven't figured it out yet....
By the way, there seems to be a few errors in the SAI section of the Reference manual eg. in the register section, I think Fsck_x = Fsai_x_ker_ck / MCKDIV x 2 should be Fmclk = ....
Solved! Go to Solution.
2019-09-29 04:44 AM
what was the silly mistake? unfortunately I can't remember now. I write direct to registers for all my software, so it is easy to make silly typo/initialisation mistakes (but I enjoy the compactness, simplicity and freedom of this method). I can now detect a pitch with 0.2 Hertz accuracy using my FHT routine - so I'm very happy with that result.
2019-08-09 11:48 PM
Well, the PLL doesn't work with such a low frequencies as LSE have, therefore HSE must be used if accuracy is needed. Is this wish because You want to run on HSI/MSI without that HSE crystal?
2019-08-11 03:49 AM
I may eventually have to resort to using the HSE, I was trying to avoid that ... but I had a cunning plan of managing with the LSE alone -
Unfortunately DMAing from a single location to a buffer (step 2) doesn't seem to work. Maybe the hardware doesn't allow it or I have made a mistake in the programming... I will keep trying... must be a way
2019-08-11 07:04 PM
...found the silly mistake that prevented my plan working - so now have a workable method of getting wave data synchronised to the LSE.
2019-09-03 08:32 AM
and what was the issue?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2019-09-29 04:44 AM
what was the silly mistake? unfortunately I can't remember now. I write direct to registers for all my software, so it is easy to make silly typo/initialisation mistakes (but I enjoy the compactness, simplicity and freedom of this method). I can now detect a pitch with 0.2 Hertz accuracy using my FHT routine - so I'm very happy with that result.