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:55] carsten [Erläuterungen] |
projects:maps21:s:dcont:code:cpld2:cpld2 [2024/05/12 10:23] (current) carsten |
||
---|---|---|---|
Line 17: | Line 17: | ||
| **led_rows_red(t)** = zehn Zeilen rot ^ | | | | **led_rows_red(t)** = zehn Zeilen rot ^ | | | ||
| **led_rows_green(t)** = zehn Zeilen green ^ | | | | **led_rows_green(t)** = zehn Zeilen green ^ | | | ||
- | | rotary_switch_debounced | + | | 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 102: | 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 180: | 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 => ' |