Page 1 of 1

how to speed up this stack with an array

Posted: Mon Nov 12, 2012 8:15 am
by smokingwheels
The program loops around and stores a value say 60 times a second.
I built it to check the capas in my 37 year old Amplifier.
Code
........
c6=c5
c5=c4
c4=c3
c3=c2
c2=c1
c1=c

then on the timer I calculate the average but the numbers still go up and down.
eg c+c1+c2....../6
I also know the frequency of the loop so I would like to adjust the amount of records stored in the stack.

Here is what I have so far..

DEFLNG A-Z
REM capa program
CLS
TIMER ON
ON TIMER(1) GOSUB health

start:
OUT 956, 255
DO: t = t + 1
LOOP UNTIL INP(957) = 127
OUT 956, 0
DO: t = t + 1
LOOP UNTIL INP(957) = 63
LOCATE 1, 1
c10 = c9
c9 = c8
c8 = c7
c7 = c6
c6 = c5
c5 = c4
c4 = c3
c3 = c2
c2 = c1
c1 = c
c = t
t = 0: f = f + 1
a$ = INKEY$
IF a$ = CHR$(27) THEN END
GOTO start

health:
LOCATE 5, 1
PRINT "Test Frequency "; f
f = 0
LOCATE 6, 1
PRINT "Raw "; c; ((c - 50) * .00157)
PRINT USING "####.###"; ((((c + c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9 + c10) / 11) - 50) * .00157) - 10.666

RETURN


Cheers
In advance

Wire pin 8 of printer port with 2.2 k to 10 add 10uf (new) to ground then run 2 wires pin 10 for + and ground to capa in question.
Note roughtly 6000 counts for 10 uf 1.6 nf resolution but not stable on p2 233 win 98 just doing my bit to stop ewaist.

Posted: Mon Nov 12, 2012 11:49 am
by burger2227
capas? layers?

Posted: Mon Nov 12, 2012 11:40 pm
by smokingwheels
capa is tech talk for a capacitor.
In old electronic equipment the loose there value over time and cause problems.

Posted: Thu Mar 28, 2013 4:39 am
by iamdenteddisk
capacitor wonder "changing values" can be due to degradation of plates or leakage of electrolyte. there has been new innovations in capacitor construction in the last decade new electrolytes and metallurgy for plate materials most likely you got the old electrolyte drying out change the caps..

not much else can be done for it but replacement of the "caps" them selves.. you could replace them with new and leave a desiccant pack inside the enclosure and maybe add a fan.

moisture, heat, bugs and stray fields are the worst enemy's of electronics prevent these and you should get 10yrs or better out of devices.

I never heard them called capas either.. that was a girls sorority in my day. "easy marks" kinda like the chess club girls. alphas where the ditzy cheerleaders also known as bad meat by everybody lol..