-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.py
More file actions
27 lines (22 loc) · 797 Bytes
/
Copy pathtime.py
File metadata and controls
27 lines (22 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Calculate timing of Output Qn for fixed capacitor & variable resistor.
resistor = [1000000,2.2*1000000,4.7*1000000,10*1000000]
# 1Mohm 2.2Mohm 4.7Mohm 10Mohm
fosc = []
for r in resistor:
R = 910000 #470K=24hr / 910K=1hr
C = 0.22 / 1000000 # C=0.22uF
f = 1 / (2.2 * (r+R) * C )
fosc.append(f)
print ("Fosc = " + str(fosc))
# fosc = [1.81, 0.826, 0.386, 0.181]
for freq in fosc:
print("\nFrequency = " + str(freq) + str("Hz") )
for n in range(4,15,1):
t = (2**n)/freq
if t > 59 :
if t>3599:
print("Q" + str(n) + " = " + str(t/3600) + " hour")
else:
print("Q" + str(n) + " = " + str(t/60) + " min")
else:
print("Q" + str(n) + " = " + str(t) + " sec")