Latest from Analog

Dreamstime_Artinun-Prekmoung_255431692 and LEM
dreamstime_artinunprekmoung_255431692
14418994 © Minyunzhou Dreamstime.com
14418994__minyunzhou__dreamstime
ID 63615675 © Nils Ackermann - Dreamstime.com
promo_id_63615675__nils_ackermann__dreamstime
332860282 © Chonticha Sawangwong | Dreamstime.com
dreamstime_chonticha_sawangwong_332860282
Texas Instruments
autohero1

Hex-Switch Decoder Uses Weighted-Capacitor Network to Reduce I/O Pin Count (.PDF Download)

May 24, 2017
Hex-Switch Decoder Uses Weighted-Capacitor Network to Reduce I/O Pin Count (.PDF Download)

A pulse-width-modulated (PWM) signal and the RC-charging characteristics of a weighted-capacitor network can be used along with a CMOS Schmitt inverter to generate a pulse whose width is linearly proportional to the 16 combinations of a hex (thumbwheel) switch. The decoding is implemented using the Arduino Uno and requires only two pins (OCRA and INT0), leaving all of the other pins free for alternate functions.

The theory, which is the basis for this design idea, is the well-known capacitor-charging equation:

Vt = V(1 ‒ e‒t/RC)

Time T required to reach a voltage k × V is given by:

T = RCln[1/(1 ‒ k)]

which shows a linear relationship with C for a fixed value of R.