i2c Bus

Discussion in 'VHDL' started by sofi, May 13, 2004.

  1. sofi

    sofi Guest

    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


    this is a stop condition


    please help me .
    sofi, May 13, 2004
    1. Advertisements

  2. 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;

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

    falling_edge <= not sda1 and sda2;
    rising_edge <= sda1 and not sda2;
    Charles Bailey, May 13, 2004
    1. Advertisements

  3. sofi

    sofi Guest

    thanks :)
    sofi, May 14, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.