Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I've attached my project for perhaps a bit more ease of communication here. The application of the PROC CYBLE222014-01 chip I am using it for measuring audio samples from a microphone on the chip.
If you take a look, you will see that I am using 2 blocks: an I2S Master, and two DMA blocks. All pins are connected to the appropriate hardware terminals in the .cydwr file.
Now, my trouble lies in processing the data read from the DMAs. I have only one channel mono left configuration and I wish to store the incoming data in two buffers,i2sBuffer and i2sBufferCopy. For each sample i2sBuffer receives the data directly from I2S and transfers in into the second buffer i2SBufferCopy, where all samples (in total 1000) are collected. However, when I debug (I am using the MiniProg3), and view the buffers in my 'Watch' window, the data that comes through is not as expected; the input to my tuner is a function generator producing a sine wave of 1250 Hz, and the data coming through in the end does not seemingly refer to those a sine wave. Is there something missing in my code or should I also configure other parameters? The following specs are probably relevant:
Another problem is the order, on which the bytes are copied from the first to the second. As example the first DMA transfers the following sample: 0xFAF7C000 and saves it in i2sBuffer.
Then the copied sample appears in i2sBufferCopy in inverted order: 0x00C0F7FA. Is there a possibility to enable swapping between DMAs? The I2S has "Byte Swap" functionality, but it is disabled in case of considering 32-bit samples.
I am hoping that someone can help me identify what mistakes I am making in my configuration functions;
Thank you in advance for the invested time. Hope to hear from you soon!