This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TS3A227E: TS3A227E I2C Script Review to Manual Select OMTP/CTIA Switches

Part Number: TS3A227E

Hi Sirs,

My customer would select OMTP/CTIA switches of TS3A227E manually by I2C. Would you please review our proposal below
(we don's have an EVM to verify the commands, hence we need product line's suggestion before customer's implementations)

# OMTP
w 76 04 13 # Auto Detect Disabled, Manual DET Trigger
w 76 07 28 # 00101000
w 76 08 06 # 00000110

# CTIA
w 76 04 13 # Auto Detect Disabled, Manual DET Trigger
w 76 07 14 # 00010100
w 76 08 09 # 00001001








Thank you and Best regards,

Wayne Chen
06/07/2021

  • Hi Wayne,

    First off it is recommended to have the desired switch states set before manual control is asserted. This is because that as soon as manual control is set the switch is going to route signals through it based what is set in the control registers. For a detailed list of Manual Control use cases please see below:

    Also when writing commands to the registers I recommend using a mask to ensure that only the data you want changed is. So as an example:

    reg_val(new) = reg_val(old) ^ bitmask. Where bitmask = binary string with a '0' in the place of values to remain unchanged in the register and a '1' in place of values that you wish to change.

    For autodection disabling see the following psuedo code

    write(i2c_addr, reg_addr, bitmask)

    {

    device = find_device(i2c_address)

    register = read_register(reg_addr)

    new_value = bitmask ^ register

    write_register(new_value)

    }

    so to disable auto detection it would look like:

    write(76, 4, 0b00100000)

    So for a manual switch case control the following string of commands should help - I have listed a few scenarios - ones where manual switch control hasn't been asserted yet - so at the startup of the application before any commands are launched the first 2 scenarios should be looked at, however if manual switch control has already been configured and the accessory type needs to change during operation scenarios 3 and 4 look into that. 

    Scenario 1: Entering Manual Switch Control (start up scenario - OMTP (4-pole) ) 

    1. Disable Autodetection - write(76, 4, 0b00100000)

    2.  Set Switch  Control Registers - write(76, 7, 0b00101000), write(76,8,0b00000110)

    3. Enable Manual Detection - write(76, 4, 0b01000000) - This will route the switch to OMTP

    Scenario 2: Entering Manual Switch Control (start Up Scenario - 4 pole standard)

    1. Disable Autodetection - write(76,4, 0b00100000)

    2. Set Switch Control Registers - write(76, 4, 0b00010100) , write(76,8,0b00001001)

    3. Enable Manual Detection - write(76, 4, 0b01000000) - This will route the switch to 4-pole Standard

    Scenario 3 / 4: Already in Manual Switch Control - switching accessories 

    1. Change Control Registers to the needed configuration:

    1a) To Switch to OMTP use commands in scenario 1 step 2

    1b) to Switch to Standard use commands in scenario 2 step 2

    2. Send a Manual Detection Trigger - write(76, 4, 0b00010000)

    The register values that you are writing and the data is correct - but this flow of commands should work the best without causing issues and help you with the implementation of this device. If you have any other questions please let me know!

    Best,

    Parker Dodson

  • Thank you for your reply, Parker...Wayne Chen