Using Arduino for PWM on a square input signal

Hey,

I have a function generator that can control frequency, amplitude, and waveform; but it can't perform pulse-width modulation. I want to use the function generator to form a square wave signal with a certain frequency and amplitude, then input the signal into an arduino uno. I want to use the arduino to change the duty cycle of the input supplied from the function generator. Then, output the signal with a specified duty cycle. I'm completely new to ardunio, so any tips?

Thanks in advance!

Hi, Question: What range of frequencies?? Arduino will (usually) have a single available amplitude (about 0 to 5V). If you need to be able to adjust the amplitude you will need an added attenuator or amplifier..

1 to 10 kHz

Look at the pulseIn() function in the Reference section.

I am assuming when you say "I want to use the function generator to form a square wave signal with a certain frequency and amplitude" that you don't need any help with that part.

...R

Yeah, sorry for the confusion. I know how to use the function generator, and I can output a squarewave signal with a range of frequencies. I want to input this into the arduino, and change its duty cycle.

What controls the duty cycle that the Arduino imposes?

This project is a lot harder than you think. There will be at least one cycle delay between any change in input and a change in the output. It would be much simpler to generate the whole thing with the Arduino.