How to route multiple PWM overflow triggers to single DMA channel

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
OnPi_2263161
Level 4
Level 4
First like received Code Expert

Hi,

I would like to connect 4 PWM counter overflow triggers to a single DMA channel. PDL documentation and TRM don't describe intermediate signals deeply. I am able to create 1:1 connection but not 4:1.

status = Cy_TrigMux_Connect(TRIG11_IN_TCPWM1_TR_OVERFLOW13, TRIG11_OUT_TR_GROUP0_INPUT11,

    CY_TR_MUX_TR_INV_DISABLE, TRIGGER_TYPE_TCPWM_TR_OVERFLOW);

Cy_TrigMux_Connect(TRIG0_IN_TR_GROUP11_OUTPUT2, TRIG0_OUT_CPUSS_DW0_TR_IN0,

    CY_TR_MUX_TR_INV_DISABLE, TRIGGER_TYPE_TR_GROUP_OUTPUT__EDE);

The use case is:

  1. Interconnect 4 PWM triggers with one DMA channel
  2. Fill array Periods with different periods {10,20,30...100}
  3. For pwm in PWM run
    1. setup DMA channel to update pwm period on each overflow from Periods
    2. enable DMA channel
    3. start PWM
      1. if all periods were written stop pwm
  4. Goto 3

How should multiplexer triggers be set up to achieve such behavior?

Regards

Ondrej Pilat

1 Solution
Yeshwanth_KT
Employee
Employee
50 replies posted 25 replies posted 10 likes received

Hello Ondrej,

The input and output of the distribution multiplexers can only be connected in 1:1 fashion. So its directly not possible to route 4 trigger output signals to a single line. If you have a PSoC 6 device that has a UDB block then by using a 4 input OR-gate this can be achieved.

Steps:

1) Connect 4 overflow outputs to 4 inputs of the OR-gate.

2) Connect the output of the OR-gate to trigger input of DW channel.

PSoC Creator will automatically take care of calling APIs to make proper DSI and Trigger mux connections to achieve this.

Regards,

Yeshwanth

View solution in original post

0 Likes
3 Replies
Yeshwanth_KT
Employee
Employee
50 replies posted 25 replies posted 10 likes received

Hello Ondrej,

The input and output of the distribution multiplexers can only be connected in 1:1 fashion. So its directly not possible to route 4 trigger output signals to a single line. If you have a PSoC 6 device that has a UDB block then by using a 4 input OR-gate this can be achieved.

Steps:

1) Connect 4 overflow outputs to 4 inputs of the OR-gate.

2) Connect the output of the OR-gate to trigger input of DW channel.

PSoC Creator will automatically take care of calling APIs to make proper DSI and Trigger mux connections to achieve this.

Regards,

Yeshwanth

0 Likes

PSoC63 isn't able to make 4:1 connection between reduction and distribution multiplexers without UDB blocks, is it?

PSoC63 TRM:

Activation of a specific input trigger, will result in activation of all output triggers that have the

specific input trigger selected through their TR_OUT_CTL.TR_SEL field.

TRM says that it is possible to activate multiple output triggers for one input.

Do we need UDB to interconnect

TRIG11_IN_TCPWM1_TR_OVERFLOW14

TRIG11_IN_TCPWM1_TR_OVERFLOW13     with     TRIG0_OUT_CPUSS_DW0_TR_IN0 ?

TRIG11_IN_TCPWM1_TR_OVERFLOW12

TRIG11_IN_TCPWM1_TR_OVERFLOW11

Regards,

Ondrej

0 Likes

The mux marked in red is a distribution multiplexer. It is a 50:16 mux, Each output line can only be connected to one of those 50 inputs. For example Tr_in[0] can only be connected to one of the 50 inputs. It is not possible to route more than one trigger input to a output line. The other way is true where you can make 1:m connections. That is a single trigger input can be routed to all the 16 lines of Tr_in[0:15].

triggermux1.png

Yes, UDB is required to logically OR the incoming trigger lines and route it to one DW channel.

Regards,

Yeshwanth