I want to caputre a PWM signals having varying duty cycle (0-50% & range from 1-160KHz) from function generator and then generate the same PWM signals into two (inverting and non inverting) with varying duty cycle . Also there must be a deadband & duty cycle configurable settings in the code while generating the signals so that i can read it again on the oscilloscope. Please suggest the code accordingly.
Sorry about this not to inform fully about the specs. But now i guess i have mentioned everything here. If more information is required then i can explain it further. Please suggest accordingly
Why don't you try the button code to demonstrate the logic of the inverse and deadband behavior you want at lower speeds, and then we could see about optimizing speed.
I imagine you want some break-before make logic between the inverted signals, and the constraints that would add, as well as the resolution of the duty cycles would help indicate if it is feasible on an Uno.
Button, modified to write to two pins, to use fastDigitalWrite, and ordering the writes to break before make, with a possible delay between the two seems like it would meet the specs as far as you have described.
So, you need to measure the frequency of the input signal, and then generate another one with the same frequency but different duty cycle, right?
Start by creating a program that calculates the time between one rising edge and the next one, you should be able to find examples (button one is not far away). Then based on that period calculate the time needed for your falling edge.
Have you tried generating 160 kHz PWM with that board? If so, you will notice that due to hardware limitations, the PWM resolution is very poor at such high frequencies.
Hi you were right about the poor resolution of the PWM signals at 160Khz. I would like to ask whether any other version of Arduino can provide the 160Khz good resolution of PWM signals. Please suggest accordingly.