0
\$\begingroup\$

A sample picture of how the output should be is given below(in figure top square pulse has 50 percent duty and bottom one has 60 percent duty, 50 kHz is frequency).

required output

Where should I start looking or which controller can be used to achieve this? (Can I code these output directly?)(should I include more info?)

\$\endgroup\$
5
  • \$\begingroup\$ How would you control the duty of each? Are both totally independent? \$\endgroup\$
    – Andy aka
    Commented Apr 12, 2021 at 13:41
  • \$\begingroup\$ How accurate do you need the 180 degree phase shift to be? What kind of resolution do you require for the duty factor? \$\endgroup\$ Commented Apr 12, 2021 at 13:45
  • \$\begingroup\$ @Andyaka set duty in code, duty are totally independent \$\endgroup\$
    – swagathu
    Commented Apr 12, 2021 at 13:48
  • \$\begingroup\$ @ElliotAlderson Both pulses here should be having greater than or equal to 50% duty factor(no gap between them if one is place above other). Is 9bit resolution possible? \$\endgroup\$
    – swagathu
    Commented Apr 12, 2021 at 14:43
  • \$\begingroup\$ 9-bit resolution should be possible if the processor's system clock is greater than 50MHz. \$\endgroup\$ Commented Apr 12, 2021 at 17:38

1 Answer 1

2
\$\begingroup\$

You can use any microcontroller with 2 independent PWM interfaces.

Program the hardware registers of the 2 interfaces in order to get the desired PWM period and Ton.

The values that you will program in the registers will depend on the clock frequency that drives the PWM interface.


Don't do it in software (delay loop). Use the hardware registers.

\$\endgroup\$
4
  • \$\begingroup\$ Can you suggest a controller for me to learn. \$\endgroup\$
    – swagathu
    Commented Apr 12, 2021 at 15:28
  • \$\begingroup\$ Many microcontroller PWM peripherals will run multiple outputs off of one counter. This lets you have two outputs in lock-step, but with different duty cycles. This is particularly prevalent in peripherals designed to drive 3-phase motors. \$\endgroup\$
    – TimWescott
    Commented Apr 12, 2021 at 15:28
  • \$\begingroup\$ Swagath: do you need a finished board ready to be programmed or you want to design your own board? Arduino board are off-the-shelf finished products. \$\endgroup\$ Commented Apr 12, 2021 at 18:02
  • \$\begingroup\$ @EnricoMigliore A finished board would be nice. \$\endgroup\$
    – swagathu
    Commented Apr 13, 2021 at 4:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.