Hi,
I want to generate the two square waveforms with two different frequency
Both should run simultaneously, so that I can compare the states of two at that instant.
Issue -
Because of sequential flow loop, I'm able to write pin HIGH and LOW ( for f1 - 100hz and f2 - 200 Hz ).
Two functions I have written, sequential execution results into state of both signal as LOW.
How I can solve this issue.
Both wave should run independent of each other.
This is for testing purpose So generating two waves internally .
Has the use of one or 2 of a MCU timers been considered?
An ESP32 has 4 timers that produce square waves without CPU intervention and sends those square waves to GPIO pins. Perhaps the MCU being used has timers as well?
How, incidentally, are you able to verify the results? Have you got an oscilloscope or logic analyser?
Does this exercise also involve changing the dutyCycle and phase of the square wave signals as well as its frequency?
???!?
Since the two DIFFERENT frequencies are not synchronized, the phase is shifting all the time. Adding a value to T1 or T2 will lower the frequency, not change the phase difference .
This would not change my advice in post #6
Also this suggests to me this is a class assignment and you want us to do it for you.
On the same pin or different pins?
Ok a step closer but still rubbish in describing what you want to do. Is it a big secrete?
Absolutely no idea what that means.
A PLL implies you have a fixed frequency output and you are trying to synchronise a free running voltage controlled oscillator to that or to a sub multiple of that. So I don't see where two oscillators in the Arduino come into that, unless you want to make one of them a voltage controlled oscillator. Something you have not mentioned before.
The good people who are supplying you with code are only guessing at what you want based on what you say. But what you say is not making any sense because you are NOT telling us what the hell you want to do.