Skip to content

Commit 3544945

Browse files
author
rze
committed
fixed freq_div_list
1 parent 5fac0d9 commit 3544945

File tree

4 files changed

+81
-73
lines changed

4 files changed

+81
-73
lines changed

v10_prototype_version_2/20220109/config.py

Lines changed: 66 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -136,70 +136,70 @@
136136

137137
clk_div_list = array("I", [0 for _ in range(64)])
138138

139-
clk_div_list[0] = 0b111100111110110101011100000000
140-
clk_div_list[1] = 0b111100111110110101011100000000
141-
clk_div_list[2] = 0b111100111110110101011100000000
142-
clk_div_list[3] = 0b111100111110110101011100000000
143-
clk_div_list[4] = 0b111100111110110101011100000000
144-
clk_div_list[5] = 0b111100111110110101011100000000
145-
clk_div_list[6] = 0b111100111110110101011100000000
146-
clk_div_list[7] = 0b111100111110110101011100000000
147-
clk_div_list[8] = 0b111100111110110101011100000000
148-
clk_div_list[9] = 0b111100111110110101011100000000
149-
clk_div_list[10] = 0b111100111110110101011100000000
150-
clk_div_list[11] = 0b111100111110110101011100000000
151-
clk_div_list[12] = 0b111100111110110101011100000000
152-
clk_div_list[13] = 0b111100111110110101011100000000
153-
clk_div_list[14] = 0b111100111110110101011100000000
154-
clk_div_list[15] = 0b111100111110110101011100000000
155-
clk_div_list[16] = 0b111100111110110101011100000000
156-
clk_div_list[17] = 0b110111110000100100101100000000
157-
clk_div_list[18] = 0b110011010110101101001000000000
158-
clk_div_list[19] = 0b101111100110000110110000000000
159-
clk_div_list[20] = 0b101100010110100101100000000000
160-
clk_div_list[21] = 0b101001100001010100000000000000
161-
clk_div_list[22] = 0b100111000001110011010100000000
162-
clk_div_list[23] = 0b100100110100100010001100000000
163-
clk_div_list[24] = 0b100010110110001110110000000000
164-
clk_div_list[25] = 0b100001000100110001110100000000
165-
clk_div_list[26] = 0b11111011110011100001000000000
166-
clk_div_list[27] = 0b11110000001011010111100000000
167-
clk_div_list[28] = 0b11100101100100111010100000000
168-
clk_div_list[29] = 0b11011011111000100111000000000
169-
clk_div_list[30] = 0b11010010111101110101100000000
170-
clk_div_list[31] = 0b11001010101111100011000000000
171-
clk_div_list[32] = 0b11000011001000110000100000000
172-
clk_div_list[33] = 0b1111100111000110101100000000
173-
clk_div_list[34] = 0b1011011110101000110000000000
174-
clk_div_list[35] = 0b1001000100111000000100000000
175-
clk_div_list[36] = 0b111100000010101110000000000
176-
clk_div_list[37] = 0b110011001011110001000000000
177-
clk_div_list[38] = 0b101100100110100110000000000
178-
clk_div_list[39] = 0b100111100001011001000000000
179-
clk_div_list[40] = 0b100011011110101011100000000
180-
clk_div_list[41] = 0b100000001100000000000000000
181-
clk_div_list[42] = 0b11101011101000110000000000
182-
clk_div_list[43] = 0b11011001001100100100000000
183-
clk_div_list[44] = 0b11001001011011101000000000
184-
clk_div_list[45] = 0b10111011110011010000000000
185-
clk_div_list[46] = 0b10101111111001100000000000
186-
clk_div_list[47] = 0b10100101011010100000000000
187-
clk_div_list[48] = 0b10011100000111000000000000
188-
clk_div_list[49] = 0b10011100000111000000000000
189-
clk_div_list[50] = 0b10011100000111000000000000
190-
clk_div_list[51] = 0b10011100000111000000000000
191-
clk_div_list[52] = 0b10011100000111000000000000
192-
clk_div_list[53] = 0b10011100000111000000000000
193-
clk_div_list[54] = 0b10011100000111000000000000
194-
clk_div_list[55] = 0b10011100000111000000000000
195-
clk_div_list[56] = 0b10011100000111000000000000
196-
clk_div_list[57] = 0b10011100000111000000000000
197-
clk_div_list[58] = 0b10011100000111000000000000
198-
clk_div_list[59] = 0b10011100000111000000000000
199-
clk_div_list[60] = 0b10011100000111000000000000
200-
clk_div_list[61] = 0b10011100000111000000000000
201-
clk_div_list[62] = 0b10011100000111000000000000
202-
clk_div_list[63] = 0b10011100000111000000000000
139+
clk_div_list[0] = -0b1010110011101010011100100000000
140+
clk_div_list[1] = -0b1010110011101010011100100000000
141+
clk_div_list[2] = -0b1010110011101010011100100000000
142+
clk_div_list[3] = 0b1100101101111110001011100000000
143+
clk_div_list[4] = 0b1010100110001010110001100000000
144+
clk_div_list[5] = 0b1010100110001010110001100000000
145+
clk_div_list[6] = 0b111111100101100010100100000000
146+
clk_div_list[7] = 0b111000100000111001011100000000
147+
clk_div_list[8] = 0b110011100101111111001000000000
148+
clk_div_list[9] = 0b110010110111100011000000000000
149+
clk_div_list[10] = 0b101110001111100011111000000000
150+
clk_div_list[11] = 0b101010011000101011000100000000
151+
clk_div_list[12] = 0b100011010100100011111000000000
152+
clk_div_list[13] = 0b11110010001100111111000000000
153+
clk_div_list[14] = 0b11010011111011010111100000000
154+
clk_div_list[15] = 0b10111111010111101100100000000
155+
clk_div_list[16] = 0b10111100011000010100100000000
156+
clk_div_list[17] = 0b10101001100010101100000000000
157+
clk_div_list[18] = 0b10011010001000010001000000000
158+
clk_div_list[19] = 0b10001101010010001111100000000
159+
clk_div_list[20] = 0b10000010011010101100000000000
160+
clk_div_list[21] = 0b1111001000110011111100000000
161+
clk_div_list[22] = 0b1110010000110010000000000000
162+
clk_div_list[23] = 0b1110001000001110010100000000
163+
clk_div_list[24] = 0b1101001111101101011100000000
164+
clk_div_list[25] = 0b1100011101110110000100000000
165+
clk_div_list[26] = 0b1011110001100001010000000000
166+
clk_div_list[27] = 0b1011001001110111001000000000
167+
clk_div_list[28] = 0b1010100110001010110000000000
168+
clk_div_list[29] = 0b1010001010001110101000000000
169+
clk_div_list[30] = 0b1010000101110111111100000000
170+
clk_div_list[31] = 0b1001101000100001000100000000
171+
clk_div_list[32] = 0b1001001101101101100000000000
172+
clk_div_list[33] = 0b1000110101001000010100000000
173+
clk_div_list[34] = 0b1000011110100001100100000000
174+
clk_div_list[35] = 0b1000001001101010001100000000
175+
clk_div_list[36] = 0b111111000111110000000000000
176+
clk_div_list[37] = 0b111110110010101101100000000
177+
clk_div_list[38] = 0b111100100011001100000000000
178+
clk_div_list[39] = 0b111010011101100100000000000
179+
clk_div_list[40] = 0b111000100000110110000000000
180+
clk_div_list[41] = 0b110110101100001011000000000
181+
clk_div_list[42] = 0b110100111110110010100000000
182+
clk_div_list[43] = 0b110011100110000111100000000
183+
clk_div_list[44] = 0b110011011000000010100000000
184+
clk_div_list[45] = 0b110001110111010101100000000
185+
clk_div_list[46] = 0b110000011100001010000000000
186+
clk_div_list[47] = 0b101111000110000010100000000
187+
clk_div_list[48] = 0b101101110100100101000000000
188+
clk_div_list[49] = 0b101100100111011010000000000
189+
clk_div_list[50] = 0b101011101000010001000000000
190+
clk_div_list[51] = 0b101011011110001100100000000
191+
clk_div_list[52] = 0b101010011000101001000000000
192+
clk_div_list[53] = 0b101001010110011110100000000
193+
clk_div_list[54] = 0b101000010111011110000000000
194+
clk_div_list[55] = 0b100111011011011001000000000
195+
clk_div_list[56] = 0b100110100010000010100000000
196+
clk_div_list[57] = 0b100101110010110011000000000
197+
clk_div_list[58] = 0b100101101011001111000000000
198+
clk_div_list[59] = 0b100100110110110100100000000
199+
clk_div_list[60] = 0b100100000100100111000000000
200+
clk_div_list[61] = 0b100011010100100001000000000
201+
clk_div_list[62] = 0b100010100110011000100000000
202+
clk_div_list[63] = 0b100001111010000110000000000
203203

204204
pwm_freq_list = [
205205
"0.4 Hz",
@@ -333,4 +333,5 @@
333333
pwm_div_list[60] = 0b10011100000111000000000000
334334
pwm_div_list[61] = 0b10011100000111000000000000
335335
pwm_div_list[62] = 0b10011100000111000000000000
336-
pwm_div_list[63] = 0b10011100000111000000000000
336+
pwm_div_list[63] = 0b10011100000111000000000000
337+

v10_prototype_version_2/20220109/ecu_simulator_v1.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ def init_channels():
227227
mem_slot_1_active = False
228228

229229
def fill_mem_slot(n, z, p1=True, p2=True, p3=True, p4=True):
230+
p1 = True
231+
p2 = True
232+
p3 = True
233+
p4 = True
230234
global d0
231235
global ar_p
232236
global mem_slot_1_active
@@ -559,6 +563,7 @@ def signal():
559563
#todo: register ueberschreiben fuer frequenz
560564
SM0_CLKDIV = 0x50200000 + 0x0c8
561565
mem32[SM0_CLKDIV] = clk_div_list[actual_poti[0]//16]
566+
#mem32[SM0_CLKDIV] = clk_div_list[3]
562567
if (actual_poti[0]//16 == 0 and sm_active):
563568
sm.active(0)
564569
sm_active = False
@@ -628,4 +633,5 @@ def signal():
628633

629634
last_gpio = actual_gpio
630635

631-
sleep(0.1)
636+
sleep(0.1)
637+

v10_prototype_version_2/20220109/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,5 @@ def suppress(s, p1, p2, p3, p4):
8787
assert suppress(signal_d, True, False, True, True) == "10000001011001"
8888
assert suppress(signal_d, True, True, False, True) == "10111000011001"
8989
assert suppress(signal_d, True, True, True, False) == "10111001000001"
90-
assert suppress(signal_d, False, True, False, True) == "00111000011000"
90+
assert suppress(signal_d, False, True, False, True) == "00111000011000"
91+

v10_prototype_version_2/20220109/test_02_calc_hash_2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
#freq_list = [5,10,100]
52
freq_list = [2.5,2.5,4.166,5,5,6.666,7.5,8.333,9.166,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100]
63
if len(freq_list)<3:
@@ -31,14 +28,16 @@
3128
ad = ad+dr
3229
#print(i, j, freq_list[j], "-", freq_list[min(j+1,len(freq_list)-1)], ad)
3330
#print(i, j, freq_list[j]+ad)
34-
print("*")
31+
#print("*")
3532
freq_list2[i] = freq_list[j]+ad
3633
else:
3734
#print(i, j, freq_list[j], "*")
3835
freq_list2[i] = freq_list[j]
3936
ad = 0
4037
k = j
4138

39+
print("hallo")
40+
print(len(freq_list))
4241
print(freq_list2)
4342

4443
pwm_list2 = [0]*64
@@ -170,7 +169,7 @@ def signal():
170169
print()
171170
for i in range(64):
172171
#print(clk_freq_list[i])
173-
print("clk_div_list["+str(i)+"] = "+pwm_div_list[i])
172+
print("clk_div_list["+str(i)+"] = "+clk_div_list[i])
174173

175174
print()
176175
print("pwm_freq_list = [")
@@ -184,4 +183,5 @@ def signal():
184183
print()
185184
for i in range(64):
186185
#print(clk_freq_list[i])
187-
print("pwm_div_list["+str(i)+"] = "+pwm_div_list[i])
186+
print("pwm_div_list["+str(i)+"] = "+pwm_div_list[i])
187+

0 commit comments

Comments
 (0)