//FSM for the key
always@(posedgeclkornegedgerst_n)beginif(rst_n==1'b0)beginstate<=IDLE;cnt_start<=1'b0;key_o_r<=1'b1;endelsecase(state)IDLE:beginif(key_neg==1'b1)begincnt_start<=1'b1;state<=FILTER0;endelsestate<=IDLE;endFILTER0:beginif(cnt_finish==1'b1)begincnt_start<=1'b0;key_o_r<=1'b0;state<=DOWN;endelseif(key_pos==1'b1)beginstate<=IDLE;cnt_start<=1'b0;endelsebeginstate<=FILTER0;endendDOWN:beginif(key_pos==1'b1)beginstate<=FILTER1;cnt_start<=1'b1;endelsebeginstate<=DOWN;endendFILTER1:beginif(cnt_finish==1'b1)begincnt_start<=1'b0;state<=IDLE;key_o_r<=1'b1;endelseif(key_neg==1'b1)beginstate<=DOWN;cnt_start<=1'b0;endelsebeginstate<=FILTER1;endenddefault:beginstate<=IDLE;key_o_r<=1'b1;cnt_start<=1'b0;endendcaseend
追忆流年寻梦少年 2022-7-20 12:59
赞!
雏羽 2022-7-20 12:54
追忆流年寻梦少年 2022-7-20 12:44
对于硬件接触的抖动,想看看其波形、频率等,工程师的好奇心啊哈哈
雏羽 2022-7-20 10:59
追忆流年寻梦少年 2022-7-20 10:30
雏羽 2022-7-20 09:31
nufuvcgx 2022-7-20 09:14
nufuvcgx 2022-7-20 09:13