TWI interface locks up when MCLK on I2S is activated

I have an nRF52840 design that uses I2C to communicate with a SGTL5000 CODEC as well as a U-blox SAM8 module. Once MCLK on the I2S is turned on and running, if I try and talk to the SAM-8 module, the I2C bus will lock up and require a power cycle to reset. This is never an issue without the MCLK running and if I turn off the MCLK, talk to the SAM-8 and then turn the MCLK back on it also works. It's a workaround, but causes all kinds of clicks and pops on my audio so not a good one. The 2 interfaces are not related, so the correlation is a bit odd, but repeatable.

Parents
  • Hi,

    Like you said, the I2S and TWI peripherals are not related or have shared resources (apart from GPIOs), so there should not be any issues using both the the same time. 

    Can you post more details about your setup?

    • Which SDK are you using?
    • Which GPIOs are you using for the two peripherals?
    • Can you post your code for initializing/configuring the peripherals?
    • Do you have other modules enabled in the application? E.g. UART/logger, BSP (buttons/LEDs), etc?
    • Have you checked the TWI bus with a logic analyzer, to see if there are any noise/interference that can explain why this issue occurs?

    Best regards,
    Jørgen

  • We are using SDK 15.2

    The I2C is on P0.14 and P0.15

    The I2S is on P0.20, P0.21, P0.22 and P0.23. I'm only using the data out since we aren't using the CODEC to sample, only generate.

    I'm also using a UART for communications with another processor and a SPI for flash. Everything else is just I/O

    I've scoped the TWI lines along with the MCLK and I'm not seeing any noise that would explain the problem. My 16MHz MCLK is clean and my 100KHz I2C shows no sign of crosstalk or interference. I also turned on the bus translator and it is able to decode the bus without any problem

    I'll see if I can get a code snippet from my software guy.

Reply
  • We are using SDK 15.2

    The I2C is on P0.14 and P0.15

    The I2S is on P0.20, P0.21, P0.22 and P0.23. I'm only using the data out since we aren't using the CODEC to sample, only generate.

    I'm also using a UART for communications with another processor and a SPI for flash. Everything else is just I/O

    I've scoped the TWI lines along with the MCLK and I'm not seeing any noise that would explain the problem. My 16MHz MCLK is clean and my 100KHz I2C shows no sign of crosstalk or interference. I also turned on the bus translator and it is able to decode the bus without any problem

    I'll see if I can get a code snippet from my software guy.

Children
No Data
Related