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.

TAS5825M: PWM physe sync with GPIO

Part Number: TAS5825M

Hi Experts,

Our customer have a concern as shown below:

"I'm developping a multichannel amp for beamforming puposes for a german pro audio equiper.

I want to pwm phase sync 4 TAS5825m with GPIO pin 0 as trigger. I already worked with the phase sync with I2S clocks stop and restart as trigger. See the corresponding e2e thread:

My setup: Housekeeping process flow, with OTFB and hybrid modulation enabled; amps in hiZ. I write the exported c header sequence to the amps and configure the phase sync afterwards.
The amps enter the phase sync mode as expected. They go to HiZ mode and when I trigger the GPIO the amps go to play mode. I configured different phases for every amp.
The problem: all 4 amps have Phase setting 0, although their registers are configured correctly. I checked that by reading back the reg values.
I already checked if the phase sync doesn't work, but if I comment out my sync sequence the amps have a random phase.

See important parts of my code below (example for one amp; all amps are initialised in a loop):

//Definitions --------------------------------------------------
#define GPIO_CTRL_REG       0x60
//all gpio pins are inputs by default, datasheet p. 67
#define GPIO2_INPUT         (0 << 2)
#define GPIO2_OUTPUT        (1 << 2)
#define GPIO1_INPUT         (0 << 1)
#define GPIO1_OUTPUT        (1 << 1)
#define GPIO0_INPUT         (0 << 0)
#define GPIO0_OUTPUT        (1 << 0)

#define GPIO0_SEL_REG       0x61
#define GPIO1_SEL_REG       0x62
#define GPIO2_SEL_REG       0x63
#define GPIO_WARNZ          (0b1000)
#define GPIO_FAULTZ         (0b1011)

#define GPIO_INPUT_SEL_REG  0x64
#define GPIO0_PHASE_SYNC    0b10000
#define GPIO0_MUTEZ         1

#define POWER_STATE_REG     0x68    //datasheet p. 73
#define POWER_STATE_HIZ     2
#define POWER_STATE_PLAY    3

#define PHASE_CTRL_REG		0x6a		//Device to device phase sync reg
//sync trigger set to gpio, sync enabled, datasheet p. 74
#define PHASE0				0b0001
#define PHASE45				0b0101
#define PHASE90				0b1001
#define PHASE135			0b1101


//Init sequence -------------------------------------------------------------

const uint8_t Amp_pwm_phases[4] = {PHASE0, PHASE45, PHASE90, PHASE135};

//set PDN pin high, enable amps

//send basic reg config from PPC3 software
//config: Housekeeping process flow, hybrid modulation, HiZ mode, unmuted
tas5825_send_reg_config(x, registers, sizeof(registers)/sizeof(registers[0]));

uint8_t data[2];

//switch to page 0 and book 0
tas5825_change_page(amp_index, 0);
tas5825_change_book(amp_index, 0);
//Configure GPIOx pin direction
data[0] = GPIO_CTRL_REG;
data[1] = (GPIO0_INPUT | GPIO1_OUTPUT | GPIO2_OUTPUT);    
I2C2_Write(Amp_addresses[amp_index], data, 2);

//Configure GPIO0 to phase sync
data[1] = GPIO0_PHASE_SYNC;
I2C2_Write(Amp_addresses[amp_index], data, 2);
//Select different phase and enable phase synchronization
data[0] = PHASE_CTRL_REG;
data[1] = Amp_pwm_phases[amp_index % 4];
I2C2_Write(Amp_addresses[amp_index], data, 2);
//Set device to play mode
tas5825_set_device_state(amp_index, STATE_PLAY, DSP_UNMUTE, DSP_NORMAL_OP);
//Monitor POWER_STATE register until device changed to HIZ state
uint8_t device_state = 0;
do {
        if (amp_index < 4)  I2C2_Read(Amp_addresses[amp_index], POWER_STATE_REG, &device_state, 1);
        else                I2C3_Read(Amp_addresses[amp_index], POWER_STATE_REG, &device_state, 1);        
while(device_state != POWER_STATE_HIZ);

//set gpio pin high, amps will enter play mode

Are there any special points that are not mentioned in the sequence described in the datasheet? I also tried it with BD modulation, but it is the exact same issue."

I hope you can help us.

Best regards,


  • Hi,

    just to follow up. I am the customer, now with a validated new company mail address.


  • Hello Markus,

    If you added an additional GPIO toggle is it the same behavior? If you added another hi-z to play transition is it the same behavior? I typically don't see as many GPIO PWM sync used so I'll try to confirm internally if there's any additional sequencing required.

    best regards,

  • Hi Luis,

    I'm still waiting for a usefull answer for my problem. As I said, the amp is entering the sync mode as it should. Otherwise it would not enter Hiz after setting it to play mode and go to play mode after the gpio was rised.

    If I reapeat that sequence, nothing will change.


  • Hi Markus

    about the phase sync configuration, it is necessary to halt i2s before configure 4 devices.

    otherwise the config will be fail. random phase will come out.

    you can refer below content in the datasheet.



  • Hi Jesse,

    I can't halt the i2s clocks!

    That is why I want to use the phase sync method described in chapter in the datasheet. The problem is, that the descirbed sequence is partly working. The devices do the phase sync triggered by gpio pin, but the phase settings of all amps are identically (register setting 0), although they are configured different (register values were red back and validated).


  • Hi Markus

    sorry for missing the information.

    please allow me confirm one things:

    You mean the phase sync with GPIO toggle only work 1 time.

    After you toggle again, it will not work? am my understanding correct?



  • Hi Jesse,

    phase sync with gpio works, but all amps have the same phase settting although configured different.
    See the start post and code for detailed description.

    My sequence:

    Loop for every amp:
    1. Download PPC3 register config
    2. Configure GPIOx pin direction
    Configure GPIO0 to phase sync
    Select different phase and enable phase synchronization
    Set device to play mode
    Monitor POWER_STATE register until device changed to HIZ state
    End of loop

    8. Delay 20 ms
    9. Set gpio from 0 to 1
    End of sequence

    All amps enter sync mode correctly and change to HIZ state. When I set the gpio to 1, all amps start playing. Therfore I know, that the sync sequence works. The problem is, that the phase shift which was configured in the registers (which are correctly set, checked by readback) is not accepted by the amp and all phase setting are set to 0.


  • Hi Markus

    thank you very much for your description.

    i will take a try with our EVM board to confirm this function and reply you ASAP.



  • Hi Mwrkus

    I have verified that you can set by this step which needn't halt I2S

    1. set device to deep sleep

    2. configure register 0x6A

    3. set device to HIZ

    4. set device to play mode

    or if you want to use GPIO toggle, you can set by this step:

    1.set device to deep sleep

    2.configure register 0x60, 0x64 and 0x6A

    3. set device to HIZ mode

    4.give a 0 to 1 toggle on SOC GPIO

    5. set device to play mode

  • Hi,

    it is working now. Thanks for your support. Case can be closed.

    However, it is surprising that the sequence in the datasheet is simply not correct...


  • Hi Markus

       Thanks for your feedback, we'll update the datasheet about it.