• AVR Freaks

Hot!Synchronize a PWM to a another Signal with PIC16F18855

Author
backbone
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2006/10/06 07:21:08
  • Location: 0
  • Status: offline
2019/07/17 08:36:13 (permalink)
0

Synchronize a PWM to a another Signal with PIC16F18855

Hello together,
I`ve generated a 100Hz PWM with the PIC16F18855. This works well so far.
I`d like to synchronize the PWM with the 50Hz of the mains. I've thought this quite simple with this PIC.
The 50Hz is generated by the Comparator and works well to.
The next step to synchronize was to synchronize the TMR2, wich is the source of the PWM.
T2HLT=0x03; //each edge resets TMR2
T2RST=0x0B; // Source to reset ist CM1OUT
The result is a signal with sporadically missing PWM pulses.
How can I fix this matter?
Thank you in advance.
Best regards
Armin
#1

1 Reply Related Threads

    coffee critic
    Super Member
    • Total Posts : 377
    • Reward points : 0
    • Status: offline
    Re: Synchronize a PWM to a another Signal with PIC16F18855 2019/07/17 09:00:05 (permalink)
    0
    Have you thought about using the zero cross detection (ZCD) pin instead of the comparator?

    n_*$
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5