Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > single wire serial comms module

Reply
Thread Tools

single wire serial comms module

 
 
Tim McCoy
Guest
Posts: n/a
 
      06-12-2005
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: http://www.velocityreviews.com/forums/(E-Mail Removed)
ICQ: 160341067

 
Reply With Quote
 
 
 
 
Damien Manoeuvre
Guest
Posts: n/a
 
      06-12-2005
Tim McCoy <(E-Mail Removed)> wrote:


> Any suggestions?


SDIO <= fromFPGA when (direction = '0') else 'Z';
toFPGA <= SDIO;


--
D.Manoeuvre
 
Reply With Quote
 
 
 
 
Tim McCoy
Guest
Posts: n/a
 
      06-12-2005
On Sun, 12 Jun 2005 11:12:24 +0200, Damien Manoeuvre wrote:

> Tim McCoy <(E-Mail Removed)> wrote:
>
>
>> Any suggestions?

>
> SDIO <= fromFPGA when (direction = '0') else 'Z';
> toFPGA <= SDIO;


When simulated at a behavioral level, this results in unknown
levels on the SDIO output pin when the fromFPGA signal is being driven
from low to high.

I'm using the testbench waveform generator within the Xilinx WebPack - is
this likely an issue within the simulation tools?

Cheers

Tim

--
"Linux... because rebooting is for adding new hardware!"

http://home.swiftdsl.com.au/~tmccoy
MSN: (E-Mail Removed)
ICQ: 160341067

 
Reply With Quote
 
Andy Peters
Guest
Posts: n/a
 
      06-13-2005
Tim McCoy wrote:
> On Sun, 12 Jun 2005 11:12:24 +0200, Damien Manoeuvre wrote:
>
> > Tim McCoy <(E-Mail Removed)> wrote:
> >
> >
> >> Any suggestions?

> >
> > SDIO <= fromFPGA when (direction = '0') else 'Z';
> > toFPGA <= SDIO;

>
> When simulated at a behavioral level, this results in unknown
> levels on the SDIO output pin when the fromFPGA signal is being driven
> from low to high.
>
> I'm using the testbench waveform generator within the Xilinx WebPack - is
> this likely an issue within the simulation tools?


it is, if the waveform generator doesn't know how to drive tristates.
Your test bench must assign SDIO in the same manner as in the FPGA,
e.g.,

SDIO <= fromTestBench when (direction = '1') else 'Z';
fromTestBench <= SDIO;

-a

 
Reply With Quote
 
Tim McCoy
Guest
Posts: n/a
 
      06-14-2005
> it is, if the waveform generator doesn't know how to drive tristates.
> Your test bench must assign SDIO in the same manner as in the FPGA,
> e.g.,
>
> SDIO <= fromTestBench when (direction = '1') else 'Z';
> fromTestBench <= SDIO;
>
> -a


Okay, here are the basic test bench waveform files - I'm not sure that I'm
making the right assignments in the directions. I'm trying to test it by
asserting nothing to the SDIO line when direction = '0', to let it
simulate the output being driven by the FPGA.

Then when direction = '1', I'm trying to set a bit waveform on the input
(blue) section of the SDIO line within the direction = '1' section. But
this results in undefined and incorrect levels on toFPGA.

http://home.swiftdsl.com.au/~tmccoy/...testbench1.png
http://home.swiftdsl.com.au/~tmccoy/...testbench2.png

....the above simulations show that SDIO is being asserted to the high
impedance state correctly, but when I try and put transitions on the SDIO
pin, it all gets strange.

Is there some documentation somewhere about simulating inouts?

Cheers

Tim

--
"Linux... because rebooting is for adding new hardware!"

http://home.swiftdsl.com.au/~tmccoy
MSN: (E-Mail Removed)
ICQ: 160341067

 
Reply With Quote
 
info_
Guest
Posts: n/a
 
      06-23-2005
Hi,

I wonder if you just didn't forget to pull up your pin ?

SDIO <= 'H'; -- does it nicely.

Alternatively, your testbench could do
SDIO <= fromFPGA when (direction = '0') else 'H';

And my little trick :

toFPGA <= SDIO and SDIO; -- guess what for


Bert Cuzeau




Andy Peters wrote:

> Tim McCoy wrote:
>
>>On Sun, 12 Jun 2005 11:12:24 +0200, Damien Manoeuvre wrote:
>>
>>
>>>Tim McCoy <(E-Mail Removed)> wrote:
>>>
>>>
>>>
>>>>Any suggestions?
>>>
>>> SDIO <= fromFPGA when (direction = '0') else 'Z';
>>> toFPGA <= SDIO;

>>
>>When simulated at a behavioral level, this results in unknown
>>levels on the SDIO output pin when the fromFPGA signal is being driven
>>from low to high.
>>
>>I'm using the testbench waveform generator within the Xilinx WebPack - is
>>this likely an issue within the simulation tools?

>
>
> it is, if the waveform generator doesn't know how to drive tristates.
> Your test bench must assign SDIO in the same manner as in the FPGA,
> e.g.,
>
> SDIO <= fromTestBench when (direction = '1') else 'Z';
> fromTestBench <= SDIO;
>
> -a
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial port comms with ASP.Net =?Utf-8?B?Sm9uYXRoYW4gQXR0cmVl?= ASP .Net 5 09-26-2006 10:12 AM
DMA 40-pin/80-Wire with a empty spot on one wire? lcs A+ Certification 1 02-02-2006 09:06 AM
Please help with Serial Comms salsipius C++ 2 10-12-2005 06:51 PM
Perl for serial comms eight02645999@yahoo.com Perl Misc 2 09-24-2005 01:42 AM
2 Wire and 3 Wire Telecom Wiring SchoolTech NZ Computing 1 02-26-2005 08:23 AM



Advertisments