Note that there are some explanatory texts on larger screens.

plurals
  1. POVHDL state machine is not looping
    primarykey
    data
    text
    <p>Fellow SO users,</p> <p>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. </p> <p>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. </p> <pre><code>FSM_NEXT_STATE_INIT : PROCESS (CLK, RST) BEGIN IF (RST = '1') THEN CURR_STATE &lt;= STARTUP; ELSIF (CLK'EVENT AND CLK = '1') THEN CURR_STATE &lt;= NEXT_STATE; END IF; END PROCESS; START_FSM : PROCESS (CURR_STATE, INTR) BEGIN CASE CURR_STATE IS WHEN STARTUP =&gt; NEXT_STATE &lt;= CONVERT; WR &lt;= '0'; READ_DATA &lt;= '0'; WHEN CONVERT =&gt; IF (INTR = '0') THEN NEXT_STATE &lt;= READ1; ELSE NEXT_STATE &lt;= CONVERT; END IF; WR &lt;= '1'; READ_DATA &lt;= '0'; WHEN READ1 =&gt; NEXT_STATE &lt;= READ2; WR &lt;= '1'; READ_DATA &lt;= '1'; WHEN READ2 =&gt; NEXT_STATE &lt;= STARTUP; WR &lt;= '1'; READ_DATA &lt;= '0'; WHEN OTHERS =&gt; NEXT_STATE &lt;= STARTUP; END CASE; END PROCESS; PROCESS (CLK, RST) BEGIN IF (RST = '1') THEN Y &lt;= (OTHERS =&gt; '0'); ELSIF (CLK'EVENT AND CLK = '1') THEN IF (READ_DATA = '1') THEN Y &lt;= D7&amp;D6&amp;D5&amp;D4&amp;D3&amp;D2&amp;D1&amp;D0; --Concatenate the 8-bit ADC output END IF; END IF; END PROCESS; </code></pre> <p>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?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload