nRF5340 Audio DK: Auto-Switch Input Between UART (USB) and BLE

Hi,

We are working on a project using the nRF5340 Audio DK. We want to take user input either from UART or BLE, and switch between them based on the connection status.

Here’s what we want to do:

  1. If the USB is connected to a PC, the device should automatically detect it and use UART for user input.

  2. If the USB is not connected (running on battery), it should automatically switch to BLE for user input.

How can we make this work?
Can we start with the USB CDC ACM example?
Also, how can we use USBREG on the nRF5340 Audio DK?

Thanks,
Aditya

Parents
  • Hi,

    Can you provide more information on the type of input in your case? Do you want to use audio or control commands as input?

    Best regards,
    Dejan

  • I want to send audio control commands as input. I am trying this on both nRF5340 Audio DK and nRF52832 DK, but not able to detect the USB when plugged. So, because of that, we are not able to switch to UART mode for user input.

  • Hi,

    Do you use LE Audio?
    Can you describe your use case in more detail? What is user scenario in your case?
    What kind of features are you trying to achieve?
    What do you refer to as "audio control commands"?

    Best regards,
    Dejan

  • No, I am not using LE audio. I am working on an audio project, and I am interfacing an external CODEC to produce sound/audio at different frequency and volume (dB). So, I want to implement a feature that can automatically switch between BLE and UART to take user based audio commands. 

    User input parameters:
    1. Frequency
    2. Volume level 

    These parameters can be passed via UART/BLE. Whenever the device works on battery, it should take user I/P using BLE. When the device is connected to a computer, the device should automatically turn off its BLE and start taking user input from UART (USB) 

    "audio control commands" refers to frequency and volume level. We have implemented an algorithm in software to produce audio with different frequency and volume as per the user's input.

Reply
  • No, I am not using LE audio. I am working on an audio project, and I am interfacing an external CODEC to produce sound/audio at different frequency and volume (dB). So, I want to implement a feature that can automatically switch between BLE and UART to take user based audio commands. 

    User input parameters:
    1. Frequency
    2. Volume level 

    These parameters can be passed via UART/BLE. Whenever the device works on battery, it should take user I/P using BLE. When the device is connected to a computer, the device should automatically turn off its BLE and start taking user input from UART (USB) 

    "audio control commands" refers to frequency and volume level. We have implemented an algorithm in software to produce audio with different frequency and volume as per the user's input.

Children
Related