Skip to main content
Arduino

Timeline for Phase and frequency correct PWM mode Arduino Mega 2560

Current License: CC BY-SA 4.0

8 events
when toggle format what by license comment
Jul 5, 2019 at 16:59 comment added Vivek Vijayan Thanks for your time. I am proceeding with it. Will try some RC filters to identify the output waveform.
Jul 5, 2019 at 16:47 comment added Edgar Bonet @VivekVijayan: Your phase correct waveform is fine. It looks wrong to you only because you don't understand how your DSO sets its time axis.
Jul 5, 2019 at 16:25 comment added Vivek Vijayan I don't know much about CRO. I am using an electronic module called Expeyes which basically acts as a DSO. I used the time reference axis to determine the triggering points. Expeyes doesnt have any option to control triggering. I generated Fast PWM using different code and compared it with the output from the above mentioned code.
Jul 5, 2019 at 15:47 comment added Edgar Bonet @VivekVijayan: You would not get 1 kHz in fast PWM mode. Re "different starting points (in time)": What is your time reference for defining the starting points? Are you using an oscilloscope? If so, how did you configure its trigger?
Jul 5, 2019 at 14:42 comment added Vivek Vijayan @Edger Bonet: I am getting the expected frequency. But when I observe the waveform all the waves with different duty cycle starts from the same point. I believe in phase correct pwm mode the OCnA or OCnB pins are set during upcounting. So I could expect different starting points(in time) for waves with different duty cycles
Jul 5, 2019 at 14:19 comment added Edgar Bonet @VivekVijayan: Do you get the expected frequency? If so, how do you tell it is not phase correct?
Jul 5, 2019 at 13:47 comment added Vivek Vijayan When I added interrupt service routine (ISR(TIMER4_COMPA_vect)) the output waveform acts exactly like fast PWM. It does not provide phase correct wave
Jul 5, 2019 at 10:08 history answered Edgar Bonet CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /