What is the issue when I try to divide an integer value in order to scale it and send it to a DAC ?
- June 14, 2022
- 2 replies
- 890 views
Hello,
I have an issue with my DAC. I am using a Nucleo STM32L476RG and my project consist of acquiring data from a mems microphone over i2S using the SAI and then send it to the DAC in order to view it with an oscilloscope.
First I initialize the DAC, SAI and a UART. During the while loop I acquire 6 words of 8 bits from the MEMS and use the first three in order to get my microphone value. I need to offset this data in order to put it in the range of the DAC and it worked too. The issue arrise when I try to divide the peak to peak amplitude by a factor of 10 for example. When not dividing I see my signal clear on the oscilloscope but when I try to divide the signal is unreadable .
So far, i have tried to cast as much as possible the type of my variables, change the DAC alignement but nothing works.
Help appreciated,
Sincerely