With a handful of PSoC3 resources and an external capacitor, a Voltage controlled oscillator can be created.
Pin "Cint" is configured as both Digital and Analog pin with a drive mode Open Drain drives low. When output of Comparator is High, IDAC output is connected to the pin. When comparator output is Low, the pin shorts to Ground.
IDAC – configured as a source – charges an external capacitor connected to "Cint". When the capacitor voltage crosses input voltage Vin, comparator output becomes low (comparator is set for inverted logic) and discharges the capacitor. As capacitor voltage becomes zero, the comparator output becomes high and IDAC starts charging the capacitor. The cycle continues and we get an oscillator whose frequency is inversely proportional to Vin. The circuit has excellent “Period vs. Vin” linearity.
For a given input voltage, the combination of IDAC value and external capacitor determines the maximum Period (1/f) of the output. We know that when a capacitor is charged using a constant current, the time taken to charge to a known voltage is
t = C * V / I
For example, if the maximum period value is desired to be 500uS for an input voltage of 2.5V, for an IDAC value of 1uA, the value of C can be calculated:
C = (500uSec * 1uA) / 2.5V = 200pF