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 ?
Yes.
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
3,3V.
2. use an RC combination and measure the charging time.
This is easily done with two FPGA pins this way:
1 | FPGA Pins
|
2 | -
|
3 | CTRL -------->| | 10k
|
4 | | | P
|
5 | -
|
6 | |
|
7 | -
|
8 | | | 100R
|
9 | | | R
|
10 | -
|
11 | |
|
12 | ADIN ----------o
|
13 | |
|
14 | | C
|
15 | === 1u
|
16 | |
|
17 | |
|
18 | GND ----------'
|
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...