bi-directional bus

Joined
Aug 3, 2010
Messages
1
Reaction score
0
Hi everyone. Please try to bear with because I am very new to electronics in general.

I am modifying someone's VHDL project to add a bi-directional line (SDA) for use in an I2C temperature detector. The FPGA is a Spartan-3 on an Opal Kelly XEM3010 board.

The relevant ports are defined as follows:
Code:
SDA_P	: inout std_logic; 
SDA_N	: inout std_logic;

Code:
signal SDA : std_logic;

Code:
obufds_SDA : OBUFDS
   port map (
      I         => SDA,
      O       => SDA_P,        
      OB     => SDA_N         
);
and in the ucf file:
Code:
NET "SDA_P"      LOC = "F17"  | IOSTANDARD = LVDS_25;
NET "SDA_N"      LOC = "G18"  | IOSTANDARD = LVDS_25;

With this setup, I can assign values to SDA which seems to properly output values to SDA_P and SDA_N. However, I don't have any idea how to read input from the SDA line. I tried making a signal SDA_IN and adding
Code:
ibufds_SDA_IN : IBUFDS
   port map (
      O       => SDA_IN,
      I       => SDA_P,        
      IB      => SDA_N         
);
but that returned an error.

Thanks for reading!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top