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 switch from 3-pole to Standard (CTIA) mode

Part Number: TS3A227E
Other Parts Discussed in Thread: TS3A225E

Hi,

I have a headset which is not properly working with the TS3A227E. Tip-to-Sleeve resistance is 1.46 kOhm and Tip-to-Ring2 is 18 Ohm. According to this post it should be a standard (CTIA) headset:

However, its only detected as 3-pole. I also managed to setup some resistors on a 4-pole plug for simulating a headset and I have similar problems. Although this setup will be most of the times be recognized as a standard (CTIA) headset, sometimes the TS3A227E states it is only a 3-pole.

What could be the problem?

Best regards, Thorben

  • Thorben,

    The post you referenced shows how the detection scheme works and that resistance between tip and Ring2/sleeve is what the audio jack IC uses to determine 3-pole or 4-pole. Since you measured a difference impedance between the tip and ring2/sleeve it should be detected as a 4 pole.

    Do you have the model of the headset that is being detected incorrectly?

    Which resistor values are being detected incorrectly?

    Can you quantify how many times you mean sometimes?

    How are you monitoring the TS3A227E to know if 3-pole or 4-pole is recognized by the part?

    Adam
  • Dear Adam,
    thank you for your answer.

    Adam Torma said:

    Do you have the model of the headset that is being detected incorrectly?


    It's an "ISY IIE 1101 be" headset.

    Adam Torma said:

    Which resistor values are being detected incorrectly?


    I used 22 Ohms on the right and 22 Ohms on the left speaker channel. For the Mic I used 680 Ohms.

    Adam Torma said:

    Can you quantify how many times you mean sometimes?


    It's about 1 out of 10 times.

    Adam Torma said:

    How are you monitoring the TS3A227E to know if 3-pole or 4-pole is recognized by the part?


    I'm reading register 0x0B and returns 0x09 for 3-pole and should return 0x0C wich it does most of the time but not always.
    Register 0x4 is set to 0x27 (de-bounce time = 2 seconds).

    Regards, Thorben

  • Thorben,

    My first thought is that internal ADC resolution might be at the edge of detecting the difference in the impedance. I have confirmed that 1.46 kOhm and Tip-to-Ring2 is 18 Ohm are well within the ADC resolution and should not be an issue. The 680 and 22 ohms is closer to the limit of the ADC capability but should not be an issue either.

    The next thought is that there is timing issue with the detection sequence and that it is finishing before the headset in fully inserted but 2 second debounce should take care of that.
    How are you initiating the detection sequence in your testing? Are you using the automatic detection and pluging in and out the headset multiple times? Are you using the I2C commands to initiate the detection algorithm?

    The third thought is that the connection of the headset to the jack is not great. If there is high impedance >~1.5k on both tip to sleeve and tip to ring2 the TS3A227E would detect as a 3-pole because the ADC would max out and the device will declare the impedance equal to each other.

    Do you have a picture of your board or set up?

    Thank you,
    Adam
  • Adam Torma said:

    How are you initiating the detection sequence in your testing?



    I primarly tried auto detection for all my test by pluging in and out but I also tried the procedure on page 22 (sequence 2) for manual triggering.

    Adam Torma said:

    The third thought is that the connection of the headset to the jack is not great.


    I think, I can figure that out within one or two days.

    Adam Torma said:

    Do you have a picture of your board or set up?


    Please find the schematic in the image attached to this post. It also includes another IC which caused some problems. See this post for details:

    e2e.ti.com/.../663072

    Regards,
    Thorben

  • Thorben,

    In the attached schematic I see you are properly using the SJ-435107RS isolating switch on pins 5 and 6 of X1502.  When a headset is inserted into X1502, the pull down resistor on pin 6 will connect and pull down the TS3A227E det_trigger pin to initiate the detection sequence.  Using the 2 second debounce setting should account for any issues with slow plugging an audio jack.

    With the 4-pole headset permanently plugged into the audio jack and you manual trigger the detection sequence does this always detect as a 4-pole headset? 

    How many times does this incorrectly detect as a 3-pole? 

    When it incorrectly detects as a 3-pole, without doing another manual detection, does reading 0x0B again fix the issue or does register 0x0B always return 3-pole once it incorrectly detects?  I'm trying to see if maybe you are reading the register before the detection is complete and the 0x0B register is updated.

    Thank you,

    Adam

     

      

  • Dear Adam,

    good to hear that the hardware looks fine.

    I tried a lot of different things to track it down a bit further. It somehow seams to be a problem with the 4-pole plug of the headset. Plugging the headset in an short selfmade extension cable and connecting this to my device doesn't cause any problems. Besides that I also tried your approach of manually triggering the detection sequence. See the attached scripts for details.

    man_trigger.sh is basically sequence 2 on page 22 of the manual and I used it as well as it is intended by having nothing plugged in at first and pluggin in the headset after event 2. I also used it while leaving the headset attached and ran the script several times.

    I've done the same for the re_trigger.sh script and it looks like that, once one type is detected, it does not change by triggering the detection again. Only unplugging and plugging it back again changes the type.

    Adam Torma said:

    How many times does this incorrectly detect as a 3-pole?


    Like I said, once it's plugged in, none of the scripts can change the 0x0B status to something else.

    Regards, Thorben

    man_trigger.txt
    #!/bin/bash
    
    
    ###################################
    # no headset should plugged in
    ###################################
    
    # reset
    i2cset -y -f 1 0x3b 0x4 0x87
    sleep 0.5
     
    
    # register 0x04 should be 0x27 
    i2cset -y -f 1 0x3b 0x4 0x27
    sleep 0.5
    
    # User sets Auto DET Enable = ‘0’
    i2cset -y -f 1 0x3b 0x4 0x07
    
    ###################################
    # plugin headset
    ###################################
    
    echo "headset?"
    read -n 1
    sleep 3
    
    
    echo "System sets Manual Switch Control = 1"
    i2cset -y -f 1 0x3b 0x4 0x47
    sleep 0.1
    
    
    echo "System sets switch control registers = 0xFF"
    i2cset -y -f 1 0x3b 0x7 0xFF
    sleep 1
    i2cset -y -f 1 0x3b 0x8 0xFF
    sleep 0.1
    
    
    echo "System sets DET Trigger = 1"
    i2cset -y -f 1 0x3b 0x4 0x57
    sleep 3
    
    
    echo "System sets Manual Switch Control = 0"
    i2cset -y -f 1 0x3b 0x4 0x17   
    sleep 3
     
    
    
    
    
    
    echo "read headset status"
    i2cget -y -f 1 0x3b 0xb
    sleep 3
    
    
    
    

    re_trigger.txt
    #!/bin/bash
    
    
    i2cset -y -f 1 0x3b 0x4 0x23
    sleep 0.5
    
    
    counter=1
    while [ $counter -le 10 ]
    do
        # trigger DET_TRIGGER
        i2cset -y -f 1 0x3b 0x4 0x33
        sleep 0.5
        i2cget -y -f 1 0x3b 0xb
    
        ((counter++))
    done
    
    
    
    

  • Thorben,

    Do I understand you correctly that you think the headset is causing your issue and that the TS3A225E is behaving as expected?

    You confirmed this by creating your own extension that you don't have any issue?

    I have gotten in samples of this device and put it on a board and can try and recreate the problem if you are still having issues with the IC.

    Thank you,
    Adam
  • Dear Adam,

    it looked like the headset is causing trouble. Today, I had my setup disassembled in between, I saw 3-4 false detections even with the extension cable. It's strange, because it doesn't add that much of extra impedance to the setup. So I wouldn't blame the headset for the issue since I've now seen the issue with the extension cable as well and also some customers complaining about that issue with their smartphone headsets.

    In previous test I noticed some significant crosstalk during simultaneous playback and recording with this headset. By adding the extension cable, the crosstalk increases by ~13 dB because the wires are not bundled. Is it possible that this somehow improves the detection mechanism?

    Please try to reproduce the error on your side.

    Regards, Thorben

  • Dear Adam,

    have you been able to reproduce the error?

    Regards, Thorben

  • Hi Adam,

    if you're unable to reproduce it, could you please tell me, how I can change the detection state of TS3A227E via software/register settings? Refering to SCDA014 it should be possible to change the state from 3-pole to 4-pole or from OMTP to CTIA but I don't know how. Please tell me the exact register settings I have to set because all of my previous attempts failed.

    Regards, Thorben

  • Thorben,

    What register settings are you changing that you are not able to manually control the switch? 

    Here are some sections of the datasheet that might help you with setting up manual mode

    These are the bits that need to be set for the different switch configurations to support 3-pole or 4-pole headsets.

    These are the different switch configurations that need to be set to support each type of headset.

    Thank you,

    Adam

  • Hi Adam

    I tried the following:

    1. Reset the chip and set the the detection time to 2 seconds
    2. set Manual Switch Control = 1
    3. set switch control registers 0x7 to 0x28
    4. set switch control registers 0x8 to 0x06
      •    (this should be the right settings for OMTP mode)

    5. set Manual Switch Control = 0
    6. Plug in CTIA headset
    7. read headset status which is 0xC
    1. Reset the chip and set the the detection time to 2 seconds
    2. Plug in CTIA headset
    3. set Manual Switch Control = 1
    4. set switch control registers 0x7 to 0x28
    5. set switch control registers 0x8 to 0x06
      •    (this should be the right settings for OMTP mode)

    6. set Manual Switch Control = 0
    7. read headset status which is 0xC
    1. Reset the chip and set the the detection time to 2 seconds
    2. Plug in CTIA headset
    3. set Manual Switch Control = 1
    4. set switch control registers 0x7 to 0x28
    5. set switch control registers 0x8 to 0x06
      •    (this should be the right settings for OMTP mode)

    6. Call manual trigger
    7. set Manual Switch Control = 0
    8. read headset status which is 0xC


    I also tried following the steps on page 22 but with the 0x28 and 0x06 instead of 0xFF in step 5.
    Headphone status is again 0xC.

    Please tell me the correct order of sending I2C commands and when to plug or unplug my headphones.

    Regards, Thorben

  • Thorben,

    1. Reset the chip and set the the detection time to 2 seconds
    2. set Manual Switch Control = 1
    3. set switch control registers 0x7 to 0x28
    4. set switch control registers 0x8 to 0x06

    (this should be the right settings for OMTP mode)

    This is the correct setting for OMTP.  You can confirm this by checking the low impedance path from sleeve to GND and from RING2_SENSE to MICP.    

    1. set Manual Switch Control = 0
    2. Plug in CTIA headset
    3. read headset status which is 0xC

    This is correct and you can confirm by checking the low impedance path from SLEEVE_SENSE to MICP and from RING2 to GND.

      1. Reset the chip and set the the detection time to 2 seconds
      2. Plug in CTIA headset
      3. set Manual Switch Control = 1
      4. set switch control registers 0x7 to 0x28
      5. set switch control registers 0x8 to 0x06

    (this should be the right settings for OMTP mode)

    This is the correct setting for OMTP but you plugged in a CTIA headset

    1. set Manual Switch Control = 0
    2. read headset status which is 0xC

    0Cxh is correct reading for CTIA headset

      1. Reset the chip and set the the detection time to 2 seconds
      2. Plug in CTIA headset
      3. set Manual Switch Control = 1
      4. set switch control registers 0x7 to 0x28
      5. set switch control registers 0x8 to 0x06

    (this should be the right settings for OMTP mode)

    This is the correct setting for OMTP but you plugged in a CTIA headset

    1. Call manual trigger
    2. set Manual Switch Control = 0
    3. read headset status which is 0xC

    0Cxh is correct reading for CTIA headset

    1. Reset the chip and set the the detection time to 2 seconds
    2. set Manual Switch Control = 1
    3. set switch control registers 0x7 to 0x28
    4. set switch control registers 0x8 to 0x06
    5.    (this should be the right settings for OMTP mode)

    This is the correct setting for OMTP

    1. set Manual Switch Control = 0
    2. Plug in CTIA headset
    3. read headset status which is 0xC

    0Cxh is correct reading for CTIA headset

    1. Reset the chip and set the the detection time to 2 seconds
    2. Plug in CTIA headset
    3. set Manual Switch Control = 1
    4. set switch control registers 0x7 to 0x28
    5. set switch control registers 0x8 to 0x06
    6. (this should be the right settings for OMTP mode)
    7. This is the correct setting for OMTP

    8. set Manual Switch Control = 0
    9. read headset status which is 0xC
    10. Reset the chip and set the the detection time to 2 seconds
    11. Plug in CTIA headset
    12. set Manual Switch Control = 1
    13. set switch control registers 0x7 to 0x28
    14. set switch control registers 0x8 to 0x06
      •    (this should be the right settings for OMTP mode)

    15. Call manual trigger
    16. set Manual Switch Control = 0
    17. read headset status which is 0xC

    0Cxh is correct reading for CTIA headset

     

    What other issues are you having?

     

    Adam

  • Hi Adam,

    Adam Torma said:

    This is the correct setting for OMTP but you plugged in a CTIA headset

    What other issues are you having?

    My issue is that I do plug in a CTIA headset but I want the TS3A227E to recognize it as OMTP and vice versa. Or, speaking more general, whatever I plug in, I want to be recognized as whatever I want it to be. Having speakers recognized as a headset or an OMTP headset as only speakers. How do I do that?

    Regards, Thorben

  • Thorben,

    To achieve the above function you will need to manually control the TS3A227E switch matrix and prevent the device from running the automatic detection.  

    Page 21 and 22 of the datasheet goes into detail on how to set up the registers for this operation.

    You will need to set the manual switch control (1), Auto DET EN (0), and DET_TRIGGER (SW) (0).  When you set these registers the switch matrix will configure itself to its last detection state.  Then you can set the switch matrix how you would like.

    Let me know if this information helps you.

    Thank you,

    Adam

  • Hi Adam,

    thanks again for your answer. I tried the following:

    1. Disconnect the headset
    2. Reset TS3A227E
    3. Set detection time to 2 seconds (write 0x27 to 0x04)
    4. Disable Auto DET (write 0x07 to 0x04)
    5. Enable Manual Switch Control (write 0x47 to 0x04)
    6. Setup the control registers for OMTP
      1. write 0x28 to 0x7
      2. write 0x06 to 0x8
    7. Insert CTIA headset
    8. Read 0x08 from 0xB after 3 seconds

    I've also tried the same procedure with the headset already connected before calling the first step. Still reading 0x08 at the end.

    Am I missing something?

    Regards, Thorben

  • Hi Adam,

    could you please provide further information? Please have a look at my last post

    Regards, Thorben

  • Thorben,

    I think you may be overwriting your own settings in this procedure if I'm interpreting this correctly.  You write to the 0x04 register several times with different values.  I think if you write 0x67 to 0x04 the TS3A227E will behave the way you want.  This will give you manual control of the switch and automatic detection so that when you insert the headset into the jack the TS3A227E will go through its detection sequence and update register 0x0B.   

    1.Disconnect the headset

    2.Reset TS3A227E

    3.Set detection time to 2 seconds (write 0x27 to 0x04) Correct

    4.Disable Auto DET (write 0x07 to 0x04) OK, but you also overwrote the detection time to 120ms because you changed bits 0-2 to 010.  The 0x04 register only holds the last value written to the register.  

    5.Enable Manual Switch Control (write 0x47 to 0x04) OK, you overwrote bits 0-2 of 0x04 again to be 2s debounce.  You also overwrote bit 5 of 0x04 to disable automatic detection.   The 0x04 register only holds the last value written to the register.  

    6.Setup the control registers for OMTP You would need to write 0x28 to 0x07 switch control 1 and  0x06 to 0x08 switch control 2

    a.write 0x28 to 0x7 Correct

    b.write 0x06 to 0x8 Correct

    7.Insert CTIA headset

    8.Read 0x08 from 0xB after 3 seconds This is correct since you have a an accessory inserted in to the jack. 

    How are you initiating the detection sequence since you disabled the automatic detection on step 5?

     

    If after step 8,  you write  0x57 to 0x04 to manually trigger the detection sequence will the 0x0B register read 0x09 for OMTP


     

    Thank you,

    Adam

  • Thank you for your help, it works.

  • Hi Adam, I got one last question.

    You wrote:

    > If after step 8,  you write  0x57 to 0x04 to manually trigger the detection sequence will the 0x0B register read 0x09 for OMTP.

    Don't you mean 0x0A for OMTP? 0x09 Should be normale 3 pole.

    Regards, Thorben

  • Thorben,

    In step 7 I assumed inserting an CTIA headset.  So the register 0x0B register read should read bit 3 = high for accessory in the jack and bit 2 = high for CTIA headset detected.    


     

    Thank you,

    Adam

     

  • Hi Adam,

    your assumption is correct. However, in step 5 and 6a+b we did setup everything to get, whatever gets connected, to be recognized as OMTP which should be 0x0A and not 0x09.

    Regards, Thorben

  • Thorben,

    It is an unusual way to use this device but it offers that flexibility if you need it in your application.

    Let us know if there is anything else we can help with.

    Adam
  • Adam,

    I'm sorry, but I don't seem to understand your answer in the context of my previous question.

    Regards, Thorben

  • Thorben,

    I think I have misunderstood your question then. Since this thread is very long and to avoid confusion would you mind starting a new thread asking your next question so I can have the right context.

    Thank you,
    Adam
  • I did. Please take a look:

    e2e.ti.com/.../720693

    Thank you, Thorben