Single Output through ADC to I2S

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
VRDE_4728046
Level 1
Level 1

Hi everyone!

I have a project where i want to hook up a single electret microphone to a raspberry pi via the psoc i2s interface.

I built a analog preamp circuit for the mic which seems to be noisy but working so far, fair enough. I have a single output that gives me 0.6-2v DC.

I hooked the thing up to an ADC and read the values via UART.

i used the following code:

x = Cy_SAR_GetResult16(SAR,0);

v = Cy_SAR_CountsTo_Volts(SAR,0,x);

printf("v = %fv \r\n",v);

CyDelay(50);

that spits out volts in my terminal. So far so good, it seems like the analog to digital conversion worked, but now i want to send this data to another System, and i'd like to use I2S (or I2C if that is more reasonable, but i researched a bit and it looks like i2s is made for digital audio transmission, so i guess thats the right one.)

And now i'm stuck on the i2s part. i tried hooking "sdone" up to "rx_sdi" (i'm guessing both are serial data?). Notice list says "routing failed". If someone could direct me to a solution or a better way to do this, i would greatly appreciate it.

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello VRDE_4728046

All the errors in the routing that you are observing is because there is no direct routing from the ADC to the I2S input.

Also, can you please let me know why are you trying to connect the "sdone" pin of the ADC to the "rx_sdi" input of the I2S? The sdone signal goes high for two ADC clock cycles to indicate that the ADC has sampled the current input channel. ADC does not have serial data output.

In order to transfer data from the ADC to I2S you can use DMA.

Please refer to the following Code example: https://www.cypress.com/documentation/code-examples/ce220762-psoc-6-mcu-pdm-i2s-example - The example uses DMA to transfer data from the PDM/PCM hardware block, which interfaces with a microphone, to SRAM. Once the recording is complete, another DMA transfers the recorded data to the I2S hardware block, which interfaces with an audio codec chip.

In your case also, you can use DMA to transfer data from the ADC output buffer to I2S TX buffer.

Please let me know if you have any further queries.

Best Regards

Ekta

View solution in original post

1 Reply
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello VRDE_4728046

All the errors in the routing that you are observing is because there is no direct routing from the ADC to the I2S input.

Also, can you please let me know why are you trying to connect the "sdone" pin of the ADC to the "rx_sdi" input of the I2S? The sdone signal goes high for two ADC clock cycles to indicate that the ADC has sampled the current input channel. ADC does not have serial data output.

In order to transfer data from the ADC to I2S you can use DMA.

Please refer to the following Code example: https://www.cypress.com/documentation/code-examples/ce220762-psoc-6-mcu-pdm-i2s-example - The example uses DMA to transfer data from the PDM/PCM hardware block, which interfaces with a microphone, to SRAM. Once the recording is complete, another DMA transfers the recorded data to the I2S hardware block, which interfaces with an audio codec chip.

In your case also, you can use DMA to transfer data from the ADC output buffer to I2S TX buffer.

Please let me know if you have any further queries.

Best Regards

Ekta