This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
projects:maps21:s:dcont:code:cpld2:cpld2 [2024/05/09 19:33] carsten [Erläuterungen] |
projects:maps21:s:dcont:code:cpld2:cpld2 [2024/05/12 10:23] (current) carsten |
||
---|---|---|---|
Line 13: | Line 13: | ||
| **Stroke[4..0]** = Bitstring[4..0] Eingangsvariable 1ms-Takt | | **Stroke[4..0]** = Bitstring[4..0] Eingangsvariable 1ms-Takt | ||
| **Mode[2..0]** = Bitstring Mode[1..0] Eingangsvariable ^ c_num_measurement_ranges ✔ | = Anzahl Messbereich als Integerzahl = 3 | | | **Mode[2..0]** = Bitstring Mode[1..0] Eingangsvariable ^ c_num_measurement_ranges ✔ | = Anzahl Messbereich als Integerzahl = 3 | | ||
- | | **led_columns(t)** | + | | ^ c_period_wl ✔ | = Länge Perioden Bitstring[5..0] = 50 | |
- | | ^ | | | + | | **led_columns(t)** |
+ | | **led_rows_red(t)** | ||
+ | | **led_rows_green(t)** = zehn Zeilen green ^ | | | ||
+ | | rotary_switch_debounced | ||
+ | | rotary_switch_debounced_d1 | ||
| ^ | | | | ^ | | | ||
| ^ | | | | ^ | | | ||
| ^ | | | | ^ | | | ||
^ ^^^ | ^ ^^^ | ||
- | | p_drive_led_rows: | + | | <color /# |
- | | p_debounce_and_handle_switches | + | | <color /# |
- | + | | <color /# | |
+ | | <color /# | ||
+ | |||
===== Code Orginal ===== | ===== Code Orginal ===== | ||
Line 98: | Line 105: | ||
period_cntr <= period_cntr + 1; | period_cntr <= period_cntr + 1; | ||
end if; | end if; | ||
- | -- create blink signal with 1 Hz | + | -- create blink signal with 1 Hz: 1 bei 24 0 Priode 49! |
if period_cntr = to_unsigned(c_num_20ms_periods / 2 - 1, c_period_wl) then | if period_cntr = to_unsigned(c_num_20ms_periods / 2 - 1, c_period_wl) then | ||
blink_signal <= ' | blink_signal <= ' | ||
Line 176: | Line 183: | ||
-- debounce switches | -- debounce switches | ||
for i in 0 to c_rotary_switch_wl - 1 loop | for i in 0 to c_rotary_switch_wl - 1 loop | ||
- | debounce_array(i)(0) <= rotary_switch(i); | + | debounce_array(i)(0) <= rotary_switch(i); |
for d in 1 to c_debounce_time_ms - 1 loop | for d in 1 to c_debounce_time_ms - 1 loop | ||
- | debounce_array(i)(d) <= debounce_array(i)(d - 1); | + | debounce_array(i)(d) <= debounce_array(i)(d - 1); -- Schaltergeschichte bis vor 4ms |
end loop; | end loop; | ||
if debounce_array(i) = (c_debounce_time_ms - 1 downto 0 => ' | if debounce_array(i) = (c_debounce_time_ms - 1 downto 0 => ' |