T
Tim McCoy
Guest
Hey all,
I'm coding a module to perform serial comms with an external sensor device
I have, but need the ability to clock data to the destination device, and
then the same wire is used by the secondary microcontroller to drive back
the result of a register read.
So for clarity:
write strategey: send address (FPGA as driver), send data (FPGA as driver)
read strategy: send address (FPGA as driver), receive response data
(external microcontroller as driver)
This is a complete two-pin system, with a CLK and SDIO line. What I
basically need to do is have a pin with "inout" bevahiour, but I cant seem
to get a simulateable design (behavioural or post-synthesis).
I'm currently trying the following dumb approach...
---------
entity sdiocontrol is
Port ( fromFPGA : in std_logic;
direction : in std_logic;
SDIO : inout std_logic;
toFPGA : out std_logic);
end sdiocontrol;
architecture Behavioral of sdiocontrol is
begin
sdiocontrol : process(direction, fromFPGA)
begin
if direction = '0' then
SDIO <= fromFPGA;
else
toFPGA <= SDIO;
end if;
end process sdiocontrol;
end Behavioral;
---------
Any suggestions?
Cheers
Tim
--
"Linux... because rebooting is for adding new hardware!"
http://home.swiftdsl.com.au/~tmccoy
MSN: timsy_01@hotmail.com
ICQ: 160341067
I'm coding a module to perform serial comms with an external sensor device
I have, but need the ability to clock data to the destination device, and
then the same wire is used by the secondary microcontroller to drive back
the result of a register read.
So for clarity:
write strategey: send address (FPGA as driver), send data (FPGA as driver)
read strategy: send address (FPGA as driver), receive response data
(external microcontroller as driver)
This is a complete two-pin system, with a CLK and SDIO line. What I
basically need to do is have a pin with "inout" bevahiour, but I cant seem
to get a simulateable design (behavioural or post-synthesis).
I'm currently trying the following dumb approach...
---------
entity sdiocontrol is
Port ( fromFPGA : in std_logic;
direction : in std_logic;
SDIO : inout std_logic;
toFPGA : out std_logic);
end sdiocontrol;
architecture Behavioral of sdiocontrol is
begin
sdiocontrol : process(direction, fromFPGA)
begin
if direction = '0' then
SDIO <= fromFPGA;
else
toFPGA <= SDIO;
end if;
end process sdiocontrol;
end Behavioral;
---------
Any suggestions?
Cheers
Tim
--
"Linux... because rebooting is for adding new hardware!"
http://home.swiftdsl.com.au/~tmccoy
MSN: timsy_01@hotmail.com
ICQ: 160341067