we will be giving a frequency of range 100hz-1Mhz from the signal generator to the interrupt pin of atmega8 microcontroller , we need measure the frequecny and inturn the duty cycle as the output form any other pin of the controller , and the o/p dutycycle should be given to the cro.
If frequency of input pulse changes, duty cycle also changes. can't you calculate duty cycle from frequency? What do you mean by giving o/p duty cycle to CRO. Do you generate pulse for changing duty cycle and give it to CRO?
If frequency of input pulse changes, duty cycle also changes. can't you calculate duty cycle from frequency? What do you mean by giving o/p duty cycle to CRO. Do you generate pulse for changing duty cycle and give it to CRO?
Measure the pulse width of the transmitted signal. If you do not know it, connect the output of the signal to the input of an oscilloscope. The oscilloscope screen will show a series of pulses oscillating at the frequency of the signal. Note the width, in seconds or microseconds, of each pulse. This is the pulse width, or PW, of the signal.
2
Calculate the period, or "T", of the frequency, or "f," using the formula: T = 1/f. For example, if the frequency is 20 hz, then T = 1/20, with a result of 0.05 seconds.
3
Determine the duty cycle, represented by "D," through the formula D = PW/T. As an example, if PW is 0.02 seconds and T is 0.05 seconds, then D = 0.02/0.05 = 0.4, or 40%.
Duty cycles can be measured with input capture unit by determing both low and high period, but only within the timing resolution given by the processor clock. Duty cycle infomation at 1 MHz will be respectivly coarse.
Outputs of ATmega are exclusively digital (0/1), so I wonder how you want to output the duty cycle by a single pin?