i2c Bus

S

sofi

hallo all ,
i am a beginner in vhdl , i need help .
i just want to ask with VHDL code wether the i2c Bus is free.
bus is free when a stop condition is sent und known start condition is sent


this is a start condition

______
scl(1)
__
\__
sda(1->0)

this is a stop condition

______
scl(1)
__
__/
sda(0->1)



please help me .
thanks
 
C

Charles Bailey

I think what you are asking for is a falling edge detector and a rising
edge detector.

Very simple:
SIGNAL sda1, sda2, falling_edge, rising_edge : std_logic;
BEGIN

proc1: PROCESS
BEGIN
WAIT until clk='1';
sda1 <= sda;
sda2 <= sda1;
END PROCESS;

falling_edge <= not sda1 and sda2;
rising_edge <= sda1 and not sda2;
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top