如何连接8位GPIO"通用输入/输出"使用3个8位定时器(Timer0,Timer1,PWM)作为多路复用器。 GPIO将3个定时器输出作为输入,在它们之间进行选择。它的输出是它作为多路复用器的3个输入之一吗?
如何通过编码在VHDL中进行设计连接?
GPIO中每个引脚的功能是什么?
感谢。
答案 0 :(得分:0)
*-- Assuming you have logic to produce the mux selects: mux_sel(1 downto 0) :*
C1: PROCESS (timer0, timer1, pwm, mux_sel) IS
BEGIN
CASE mux_sel IS
WHEN "00" => gpio_in <= timer0;
WHEN "01" => gpio_in <= timer1;
WHEN "10" => gpio_in <= pwm;
WHEN OTHERS => NULL;
END CASE;
END PROCESS C1;
-- Even simpler:
gpio_in <= timer0 WHEN mux_sel = "00" ELSE
timer1 WHEN mux_Sel = "01" ELSE
pwm;