cancel
Showing results for 
Search instead for 
Did you mean: 

How can I determine that the values am reading from the CODEC actually represent the input signal?

DCont.1
Associate II

I am currently using the HAL function 

```

HAL_I2S_Receive (I2S_HandleTypeDef * hi2s, uint16_t * pData, uint16_t Size, uint32_t Timeout)

```

in order to collect an input signal (currently being tested with a function generator 440 Hz sine wave). However, we noticed a couple of things: 

1) The data being stored in every index of our uint16_t * pData buffer is radically different. The values do not follow a trend. We expected to see an increase and a decrease in the values as it reads sine wave, however, we just see random values ranging from 0 - (2^16).

2) When we stop the signal from the function generator the buffer continues to get filled up. This behavior continues even after unplugging the function generator line from the input to the codec.

MCU  - STM32F446RE

CODEC - PCM3060

Why would the values in the buffer continue to be filled up, and why are they not showing a trend that would represent reading a sine wave?

A lot of these concepts are new to me so I don't really know if these is the expected behavior when using I2S.

NOTE: I have made sure that the CODEC is processing the signal correctly and that its clock is working properly. Also, I attached my code to this post.

Thank you in advance,

DC

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
0 REPLIES 0