Resistor Circuits Calculator

Thread Starter

joeyd999

Joined Jun 6, 2011
6,439
Hi, Guys.

Back around 1994 I wrote a couple of applications to assist in designing optimal resistor divider circuits. They were written in Borland Turbo Pascal for Windows for Windows 3.1, but they still seem to work well on XP. I haven't tried them on Vista or Win 7, though.

The idea for the software came from an engineering problem I had. I was diagnosing a production yield issue on a particular product where a certain percentage of units were uncalibratable. I did some calculations and realized that a voltage divider, with the resistor values chosen, would not always provide a proper output voltage when turning the pot through its range. I recomputed the resistor values, taking the resistor and pot tolerances into account, and the problem was solved.

I also learned early in my career that multiturn pots are *lousy*. They provide excellent setability, but rotten stability. Mechanical shocks and wiper hysteresis would make units go out of calibration in the field. I decided that all circuits using pots should use single turn pots only. But this meant that any dividers using pots should be designed optimally to achieve the best setablity possible given various sources of error.

The computations are complex, and I originally did them on a spreadsheet. Finally, I wrote "Resistor Circuits Calculator" ("ResCalc" for short), to automate this process.

I don't design with pots anymore (or rarely, EEPOTS), but for those of you who do, I am attaching my software here in the hopes that it might help someone.

There is a short README file that gives some basic instructions on how to use this relatively simple set of programs.

There are six different circuits the programs calculate:

Ratiometric Divider
Voltage Divider
Non-Inverting Amp
Inverting Amp
Voltage Reference
Voltage Regulator

Enjoy.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
My system is running 64-bit Windows 7, and the programs are not compatible with it.

Do you happen to have the Excel spreadsheet you used before you wrote the programs?
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,439
My system is running 64-bit Windows 7, and the programs are not compatible with it.

Do you happen to have the Excel spreadsheet you used before you wrote the programs?
Sorry...the original spreadsheets were made in an old version of Microsoft Works for Windows. Even I cannot read them (or convert them) any longer.

The ResCalc tools will run fine under Wine if you happen to have a Linux box.
 

SgtWookie

Joined Jul 17, 2007
22,230
Gee, even if they are quite old, you should be able to download converters for it for MS Excel.

Unfortunately, I don't have a Linux box. I have another system running XP, but it's been disconnected for a couple of months now.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,439
Gee, even if they are quite old, you should be able to download converters for it for MS Excel.
You'd think. Unfortunately, there is no such beast.

Unfortunately, I don't have a Linux box. I have another system running XP, but it's been disconnected for a couple of months now.
You are in luck! Download a copy of Ubuntu and install it on the old XP box...it'll give it new life!
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,439
Do you happen to have the Excel spreadsheet you used before you wrote the programs?
Sorry...the original spreadsheets were made in an old version of Microsoft Works for Windows. Even I cannot read them (or convert them) any longer.
I was going through some of my old work today -- mostly a bunch of programmable logic written in ABEL -- and I found the old spreadsheets that were the inspiration for the software that is the subject of this thread.

To my surprise, LibreOffice Calc is now able to open the long-forgotten Microsoft Works spreadsheet file format. Yay!

Spreadsheets attached, in their original form.

For fun, here's an old 8x8 multiplier I wrote in ABEL (circa 1993). It performs an asynchronous sum of partial products:

Code:
module mult

title '8x8 Mutiplier'

"mult device 'p26cv12';

@Dcset

declarations

  "inputs

   x7, x6, x5, x4, x3, x2, x1, x0 pin;
   y7, y6, y5, y4, y3, y2, y1, y0 pin;

  "outputs

   sf, se, sd, sc,sb, sa, s9, s8 pin istype 'com';
   s7, s6, s5, s4,s3, s2, s1, s0 pin istype 'com';

  "internal

   p00, p01, p02, p03   pin istype 'com';
   p04, p05, p06, p07   pin istype 'com';

   p10, p11, p12, p13   pin istype 'com';
   p14, p15, p16, p17   pin istype 'com';

   p20, p21, p22, p23   pin istype 'com';
   p24, p25, p26, p27   pin istype 'com';

   p30, p31, p32, p33   pin istype 'com';
   p34, p35, p36, p37   pin istype 'com';

   p40, p41, p42, p43   pin istype 'com';
   p44, p45, p46, p47   pin istype 'com';

   p50, p51, p52, p53   pin istype 'com';
   p54, p55, p56, p57   pin istype 'com';

   p60, p61, p62, p63   pin istype 'com';
   p64, p65, p66, p67   pin istype 'com';

   p70, p71, p72, p73   pin istype 'com';
   p74, p75, p76, p77   pin istype 'com';

   c10                  pin istype 'com';
   c20, c21             pin istype 'com';
   c30, c31             pin istype 'com';
   c40, c41             pin istype 'com';
   c50, c51, c52        pin istype 'com';
   c60, c61, c62        pin istype 'com';
   c70, c71, c72        pin istype 'com';
   c80, c81, c82        pin istype 'com';
   c90, c91, c92        pin istype 'com';
   ca0, ca1, ca2        pin istype 'com';
   cb0, cb1             pin istype 'com';
   cc0, cc1             pin istype 'com';
   cd0, cd1             pin istype 'com';
   ce0                  pin istype 'com';


  x = [x7, x6, x5, x4, x3, x2, x1, x0];
  y = [y7, y6, y5, y4, y3, y2, y1, y0];
  s = [sf, se, sd, sc, sb, sa, s9, s8, s7, s6, s5, s4, s3, s2, s1, s0];

  p0 = [p70, p60, p50, p40, p30, p20, p10, p00];
  p1 = [p71, p61, p51, p41, p31, p21, p11, p01];
  p2 = [p72, p62, p52, p42, p32, p22, p12, p02];
  p3 = [p73, p63, p53, p43, p33, p23, p13, p03];
  p4 = [p74, p64, p54, p44, p34, p24, p14, p04];
  p5 = [p75, p65, p55, p45, p35, p25, p15, p05];
  p6 = [p76, p66, p56, p46, p36, p26, p16, p06];
  p7 = [p77, p67, p57, p47, p37, p27, p17, p07];

  t0 = [s0];
  t1 = [c10, s1];
  t2 = [c21, c20, s2];
  t3 = [c31, c30, s3];
  t4 = [c41, c40, s4];
  t5 = [c52, c51, c50, s5];
  t6 = [c62, c61, c60, s6];
  t7 = [c72, c71, c70, s7];
  t8 = [c82, c81, c80, s8];
  t9 = [c92, c91, c90, s9];
  ta = [ca2, ca1, ca0, sa];
  tb = [cb1, cb0, sb];
  tc = [cc1, cc0, sc];
  td = [cd1, cd0, sd];
  te = [ce0, se];
  tf = [sf];

equations

  p0 = x & y0;
  p1 = x & y1;
  p2 = x & y2;
  p3 = x & y3;
  p4 = x & y4;
  p5 = x & y5;
  p6 = x & y6;
  p7 = x & y7;

  t0 = p00;
  t1 = [0, y1 & x0] + [0, y0 & x1];
  t2 = [0,0,p20] + [0,0,p11] + [0,0,p02] + [0,0,c10];
  t3 = [0,0,p30] + [0,0,p21] + [0,0,p12] + [0,0,p03] + [0,0,c20];
  t4 = [0,0,p40] + [0,0,p31] + [0,0,p22] + [0,0,p13] + [0,0,p04] + [0,0,c21] + [0,0,c30];
  t5 = [0,0,0,p50] + [0,0,0,p41] + [0,0,0,p32] + [0,0,0,p23] + [0,0,0,p14] + [0,0,0,p05] + [0,0,0,c31] + [0,0,0,c40];
  t6 = [0,0,0,p60] + [0,0,0,p51] + [0,0,0,p42] + [0,0,0,p33] + [0,0,0,p24] + [0,0,0,p15] + [0,0,0,p06] + [0,0,0,c41] + [0,0,0,c50];
  t7 = [0,0,0,p70] + [0,0,0,p61] + [0,0,0,p52] + [0,0,0,p43] + [0,0,0,p34] + [0,0,0,p25] + [0,0,0,p16] + [0,0,0,p07] + [0,0,0,c51] + [0,0,0,c60];
  t8 = [0,0,0,p71] + [0,0,0,p62] + [0,0,0,p53] + [0,0,0,p44] + [0,0,0,p35] + [0,0,0,p26] + [0,0,0,p17] + [0,0,0,c52] + [0,0,0,c61] + [0,0,0,c70];
  t9 = [0,0,0,p72] + [0,0,0,p63] + [0,0,0,p54] + [0,0,0,p45] + [0,0,0,p36] + [0,0,0,p27] + [0,0,0,c62] + [0,0,0,c71] + [0,0,0,c80];
  ta = [0,0,0,p73] + [0,0,0,p64] + [0,0,0,p55] + [0,0,0,p46] + [0,0,0,p37] + [0,0,0,c72] + [0,0,0,c81] + [0,0,0,c90];
  tb = [0,0,p74] + [0,0,p65] + [0,0,p56] + [0,0,p47] + [0,0,c82] + [0,0,c91] + [0,0,ca0];         
  tc = [0,0,p75] + [0,0,p66] + [0,0,p57] + [0,0,c92] + [0,0,ca1] + [0,0,cb0];
  td = [0,0,p76] + [0,0,p67] + [0,0,ca2] + [0,0,cb1] + [0,0,cc0];
  te = [0,p77] + [0,cc1] + [0,cd0];           
  tf = [cd1] + [ce0];

test_vectors

  ([x, y]  -> s);
   [0, 0]  -> 0;
   [0, 1]  -> 0;
   [1, 1]  -> 1;
   [2, 3]  -> 6;
   [255, 255] -> 65025;
   [34, 231] -> 7854;

end
 

Attachments

Last edited:
Top