Hi, I'm using mega2560 and needed to implement a complementary pulse with deadtime. Currently, I have an issue in implementing deadtime for the first pulse which is cleared when compared. I've manage to implement deadtime for the second pulse. Is there any way that I could solve this issue?
What initial compare values do you use for OCR1A and OCR1B which will trigger on the initial timer cycle before the first overflow interrupt starts picking from the table?
If they are both 0, then one wave form will be 100% on for the first cycle. Perhaps one should be 0 and the other 1600.
If working with the initial values doesn't fix your issue, perhaps you could start with both outputs in non inverted mode, set them both to 0, and change over one mode on the first overflow interrupt.
I tried using phase correct mode but I couldn't get the right duty cycle for both pulses (e.g. OCR1A = 40% duty cycle, OCR1B=60% duty cycle). since I only modified OCR1B and didnt do anything on OCR1A. If I add a -3 to OCR1A then no deadtime would be introduced.There would be a small difference in the duty cycle with OCR1B having a lower cycle.
Is there any way that I could do when pwm is doing
up-counting:
OCR1A=sinPWM*;* OCR1B=sinPWM*+3;* down-counting: OCR1A=sinPWM*-3;* OCR1B=sinPWM*;* Or is there any way that I could access to the carrier signal function (i.e. the triangular waveform) of the pwm? I tried using TCNT to find whether it is up/down counting but it's don't work too.
Or is there any access to the TOVn and ICFn flag? so I could know whether it is up/down counting.
Or is there any way to invert OCR1A? where I use the inverted setting and +3 and then invert again to get non-inverting output?