how to generate signals arduino?

  uhi i want to generate 3 equal variable pulse high with constant pulse low signal that vary with potentiometer and asume it repeat it self every  10us and pulse min is constant 2u and pulse high vary betwwen 5-8u and i want it to carried at specific frequency? i attach the signal i want to generatel 

3617.mp4(516x290) 14 KB
sort by: active | newest | oldest
The arduino PWM clock can be varied.
Download the l;ibrary "timer3.zip" from here
In the timer3 code you will find a new option

pwm(pin, duty, period)
Generates a PWM waveform on the specified pin. Output pins for Timer1 are PORTB pins 1 and 2, so you have to choose between these two, anything else is ignored. On Arduino, these are digital pins 9 and 10, so those aliases also work. Output pins for Timer3 are from PORTE and correspond to 2,3 & 5 on the Arduino Mega. The duty cycle is specified as a 10 bit value, so anything between 0 and 1023. Note that you can optionally set the period with this function if you include a value in microseconds as the last parameter when you call it.

This should give you the control you need.
britich (author) 3 years ago
framistan3 years ago
I had some experience making an arduino put out a 512 hertz signal. We discovered that the ACTUAL frequency coming out could be PLUS or MINUS about ten hertz from chip to chip. So, I don't think you can depend on extreme accuracy unless you are making a "ONE-OFF" and can fine-tune it. Also, we discovered just SOLDERING the pins could alter the output frequency if you got the pin too hot for too long.
All depends on the clock source. If you use the on-chip RC oscillator, you will get the behaviour you observe.

Use a resonator and it will be better, use a crystal and you'll be in the 20PPM level.
britich (author) 3 years ago
variable frequency and variable dutycycle(high time increase )
britich (author)  britich3 years ago
this is output on throttle stick directly
Variable frequency, fixed duty cycle, fixed amplitude ?