基于vhdl的交通灯控制器的设计与实现(编辑修改稿)内容摘要:

select LCD_RS = 39。 039。 when function_set|entry_set|set_display|clr_display|set_addr, 39。 139。 when others。 what byte to transmit to lcd refer to datasheet for an explanation of these values with cur_state select tx_byte = 00101000 when function_set, ??????? 00000110 when entry_set, 00001100 when set_display, 00000001 when clr_display, 10000000 when set_addr, 0011amp。 counter_play1h when max_degree_1, 0011amp。 counter_play1l when max_degree_2, 00100000 when blank1, 0011amp。 counter_play2h when temperature_1, 0011amp。 counter_play2l when temperature_2, 00100000 when blank2, 00100000 when degree_1, 00100000 when degree_2, 00100000 when blank3, 00100000 when others。 main state machine display: process(clk, rst_n) begin if(rst_n=39。 039。 ) then cur_state = function_set。 elsif(clk=39。 139。 and clk39。 event) then case cur_state is refer to intialize state machine below when init = if(init_done = 39。 139。 ) then cur_state = function_set。 else cur_state = init。 end if。 every other state but pause uses the transmit state machine when function_set = if(i2 = 2020) then cur_state = entry_set。 else cur_state = function_set。 end if。 when entry_set = if(i2 = 2020) then cur_state = set_display。 else cur_state = entry_set。 end if。 when set_display = if(i2 = 2020) then cur_state = clr_display。 else cur_state = set_display。 end if。 when clr_display = i3 = 0。 if(i2 = 2020) then cur_state = pause。 else cur_state = clr_display。 end if。 when pause = if(i3 = 82020) then cur_state = set_addr。 i3 = 0。 else cur_state = pause。 i3 = i3 + 1。 end if。 when set_addr = if(i2 = 2020) then cur_state = max_degree_1。 else cur_state = set_addr。 end if。 when max_degree_1 = if(i2 = 2020) then cur_state = max_degree_2。 else cur_state = max_degree_1。 end if。 when max_degree_2 = if(i2 = 2020) then cur_state = blank1。 else cur_state = max_degree_2。 end if。 when blank1 = if(i2 = 2020) then cur_state = temperature_1。 else cur_state = blank1。 end if。 when temperature_1 = if(i2 = 2020) then cur_state = temperature_2。 else cur_state = temperature_1。 end if。 when t。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。