Nirav Bhatt wrote:
> Is there a way where i can use a vary the duty cycle (input) with the
> help of potentiometer or ADC converter ?
1. use an external ADC.
1a. use an ADC with parallel output (e.g. TLV571)
1b. use an ADC with serial output (e.g. MAX11639)
Here you must implement some FSM to generate control signals for the
ADC. And for 1b you must implement a interface engine (SPI or I²C) also.
Keep an eye on the interface/supply voltage, it should be no more than
2. use an RC combination and measure the charging time.
This is easily done with two FPGA pins this way:
CTRL -------->| | 10k
| | P
| | 100R
| | R
Set CTRL to low for "enough" time to ensure discharching of C. Then set
CTRL to high and start a counter. Count until ADIN is high. Do some
scaling on the counters value to get 8 bit result.
Then from the beginning: set CTRL low to discharge C...