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

  • SEARCH
  • Home
  • 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 8664425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:14:16+00:00 2026-06-12T17:14:16+00:00

Fellow SO users, I’m programming my ADC (ADC0804 which is mounted on a breadboard

  • 0

Fellow SO users,

I’m programming my ADC (ADC0804 which is mounted on a breadboard connected to a Spartan-3 FPGA board). Now, I’m using this ADC to provide digital output for my humidity sensor. The ADC outputs an 8-bit value which I’m displaying on the LEDs on the FPGA board.

Now, I’m writing the state machine in such a way that the ADC would always continue to keep outputting values even when I vary the humidity level. But as for the current implementation I have, eventhough I’m looping back to the first state, I’m not getting a continuous stream of values. I’m only getting one 8-bit value at a time (I.E.; I have to keep pressing the reset button to update the value displayed on the LEDs). The following is my code.

FSM_NEXT_STATE_INIT :   PROCESS (CLK, RST)
                        BEGIN
                        IF (RST = '1') THEN
                           CURR_STATE <= STARTUP;
                        ELSIF (CLK'EVENT AND CLK = '1') THEN
                            CURR_STATE <= NEXT_STATE;
                        END IF;
                       END PROCESS;

START_FSM   :   PROCESS (CURR_STATE, INTR)
                BEGIN

                CASE CURR_STATE IS

                        WHEN STARTUP =>
                            NEXT_STATE <= CONVERT;
                            WR <= '0';
                            READ_DATA <= '0';


                        WHEN CONVERT =>
                            IF (INTR = '0') THEN
                                NEXT_STATE <= READ1;
                            ELSE
                                NEXT_STATE <= CONVERT;
                            END IF;
                            WR <= '1';
                            READ_DATA <= '0';


                        WHEN READ1 =>
                            NEXT_STATE <= READ2;
                            WR <= '1';
                            READ_DATA <= '1';

                        WHEN READ2 =>
                            NEXT_STATE <= STARTUP;
                            WR <= '1';
                            READ_DATA <= '0';

                        WHEN OTHERS =>
                            NEXT_STATE <= STARTUP;
                END CASE;
                END PROCESS;

                PROCESS (CLK, RST)
                BEGIN
                    IF (RST = '1') THEN
                        Y <= (OTHERS => '0');
                    ELSIF (CLK'EVENT AND CLK = '1') THEN
                        IF (READ_DATA = '1') THEN
                            Y <= D7&D6&D5&D4&D3&D2&D1&D0; --Concatenate the 8-bit ADC output
                        END IF;
                    END IF;
                END PROCESS;

You’ll notice that in state ‘READ2’, I’m looping back to the beginning (so that I can keep reading values continuously as the states transition) but somehow I don’t think this is working. Could anyone please provide some assistance on how to go about solving this?

  • 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-06-12T17:14:17+00:00Added an answer on June 12, 2026 at 5:14 pm

    After a look on the data sheet for the ADC0804 I found following which could be the/a possible reason:

    Note: Read strobe must occur 8 clock periods (8/fCLK) after assertion of interrupt to guarantee reset of INTR.

    Inserting a WAIT state between CONVERT and READ1 might fix the problem.

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

Sidebar

Related Questions

Hello fellow Stackoverflow users, I have a page which does a AJAX request to
I'm looking for fellow users, who are using Xuggler to produce video encoded with
I'm hoping there are some fellow doctrine users out there. Here is a simplified
I have an app in which users can follow law firms I have 3
This is driving me nuts so any advice from fellow users would be welcome.
Hi fellow Umbraco users, I'm currently building my first umbraco website and since I'm
Howdy fellow programmers! I want to allow users of my software to securely transfer
Hi fellow stackers... I have an ASP.NET 3.5 app using forms authentication. I would
I'm using jquery/javascript to work with a hoverover that should follow the users mouse
I'm using this piece of code from a fellow SO user: $(#rightSubMenu).mousemove(function(e){ console.log('executed'); var

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.