Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3999152
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:37:12+00:00 2026-05-20T07:37:12+00:00

this question probably wont be explained very well and that’s because I don’t really

  • 0

this question probably wont be explained very well and that’s because I don’t really understand what’s happening in my design.

I need to use an I2C communication bus to talk to a camera (Terasic D5M) so I tried to write one using Verilog. I only need a master. On my logic analyzer everything looks great except I keep getting NACK signals from the camera. Initially I had no idea what was wrong so I just put it aside.

Tonight I tried to use the Altera University IP Core which has a module for the D5M. After setting this to automatically initialize I watched what was going on on my analyzer. The trace looks the same as the output from my I2C module except this is registering an ACK by the device.

My problem is, I cannot for the life of me figure out why I’m not getting an acknowledgement. It may be that I’m not allowing the camera to pull the sda line low (scl works fine) but I cannot figure out why this would be.

Has anyone has any similar experiences or have any idea where I should go look / post / read? I would post some code but I don’t know how useful it’s going to be if it’s not in its entirety. Sorry about being so vague but I’m really lost and don’t even know what I should be asking; I guess this is a similar effect request. Thanks for any help, here’s a little bit of code for the output lines from the i2c module.


`define HIGH  1'bZ
`define TRUE  1'b1
`define FALSE 1'b0

inout sda;
assign sda = (ena_sda)?sda_bit:`HIGH;

inout scl;
assign scl = (ena_scl)?pSCL:`HIGH;

pSCL is a clock that runs at the desired rate and sda_bit is the value of the sda line during operation. Here is the section that releases and waits for the ack. This is embedded in my shifting state, hence the beginning else if.


// Data shifting complete, check for ACK
// Release the SDA line and set our bit to high Z
else if(shiftComplete == `TRUE) begin
    ena_sda = `FALSE;
    sda_bit = `HIGH;
    if(negedge_SCL) begin
        ena_sda = `TRUE;                        
        case(i2cState)
            `DATA_STATE:
                begin
                    shiftComplete = `FALSE;
                    nxState = `DATA_STATE;
                end
            `START_STATE: nxState = `REPEAT_START_STATE;
             default: nxState = `STOP_STATE;
        endcase
    end
end /* end ACK */

I would think that releasing ena_sda would be enough to let the camera drive the module. I think I put the sda_bit = HIGH before as a test (I haven’t looked at this in a month).

I would be happy to share more code or show my logic traces but I don’t want to clutter this anymore. Thanks for reading.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:37:13+00:00Added an answer on May 20, 2026 at 7:37 am

    I would separate the input and output and add to that an output enable, basically not use an inout. Does your altera device’s I/O pads support being used that way? (they should) If so let the I/O pad do the inout work. Also have you defined the I/O pad as a push-pull or wired-or, or weak pull up or any of those? In some cases you may choose to have it a push-pull when output is enabled and when an input it tri-states allowing the other side to control the data line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question would probably apply equally as well to other languages with C-like multi-line
This is probably an easy question, but I want to understand better how Apache
This is probably a really simple jQuery question, but I couldn't answer it after
This is probably a really stupid newbie-sounding question to you developer type people, but
All, This question probably has a very simple answer - something I'm overlooking. But
This question is probably better phrased: how does running a Java server on a
(This question is over 6 years old and probably no longer has any relevance.)
This is probably a silly question, but curiosity has gotten the better of me.
This is probably a simple question but I am not an ASP.NET developer and
This is probably a simple question, and I'm slightly embarrassed to ask it, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.