Accurately compute circuit resistance values fast.
The Parallax Propeller microcontroller measures RC charge or discharge duration using the RCTIME command, counting system clock ticks. The time ($T$) in seconds is derived from the tick count based on the system clock frequency and instruction cycles per loop. Resistance ($R$) is then computed using the standard exponential RC charging formula:
$$T = R \cdot C \cdot \ln\left(\frac{V_{cc}}{V_{cc} - V_{thresh}}\right)$$
By rearranging this equation, we solve for resistance:
$$R = \frac{T}{-C \cdot \ln\left(1 - \frac{V_{thresh}}{V_{cc}}\right)}$$
The Parallax Propeller chip provides a unique built-in command called RCTIME, which allows developers to interface analog resistance elements—such as photoresistors, thermistors, and variable potentiometers—without requiring an external Analog-to-Digital Converter (ADC). By charging or discharging a capacitor through an unknown resistor and counting the clock cycles it takes for the input pin to change logic states, the microcontroller can approximate time intervals with high resolution.
Although RCTIME offers a cost-effective alternative for simple sensor integration, factors like supply voltage fluctuations, temperature variations, and internal pin threshold discrepancies can introduce minor measurement errors. Compensating for these variables using advanced calculator parameters ensures that your derived resistance values remain accurate across various hardware setups and operating environments.
Mastering microcontroller timing commands unlocks numerous possibilities for embedded hardware design, enabling robust sensor reading routines using minimal external components.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.