Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
10 years ago

[VHDL] Help with "stuck at VCC"

I need to make an output pulse (within certain conditions) becomes a '1' constant (in an LED).I was able to code, but the output is stuck at VCC. I do not know how to fix this. Can anyone help me please?Code:ARCHITECTURE behavioral OF check_minutes IS SIGNAL aux: STD_LOGIC := '0';BEGIN accept_minutes: PROCESS(enable,data) --processo de aceitar ou não a temperatura inserida. BEGIN IF(data>="000001" AND data<="111011" AND enable='1') THEN aux <= '1'; END IF; END PROCESS accept_minutes; minled <= aux;END ARCHITECTURE behavioral;

7 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I need to make an output pulse (within certain conditions) becomes a '1' constant (in an LED).I was able to code, but the output is stuck at VCC. I do not know how to fix this. Can anyone help me please?Code:ARCHITECTURE behavioral OF check_minutes IS SIGNAL aux: STD_LOGIC := '0';BEGIN accept_minutes: PROCESS(enable,data) --processo de aceitar ou não a temperatura inserida. BEGIN IF(data>="000001" AND data<="111011" AND enable='1') THEN aux <= '1'; END IF; END PROCESS accept_minutes; minled <= aux;END ARCHITECTURE behavioral;

    --- Quote End ---

    you just need to define when aux should be '0'; e.g.

    aux <= '0';

    if...your decision
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Can u edit the code and send please? I didn't understand what u teling

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    
    ARCHITECTURE behavioral OF check_minutes IS 
    SIGNAL aux: STD_LOGIC := '0';
    BEGIN 
    accept_minutes: PROCESS(enable,data) --processo de aceitar ou não a temperatura inserida. 
    BEGIN 
    IF(data>="000001" AND data<="111011" AND enable='1') THEN 
       aux <= '1';
    else aux <= '0'; 
     END IF; 
    END PROCESS accept_minutes; minled <= aux;
    END ARCHITECTURE behavioral;
    

    and enjoy the LED light.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In this case, when the 'enable' stop being '1' the led turns off. And this is wrong, cause the user will not press "enable" button forever.

    I want if the output is '1' once is forever; regardless of the value of the enable.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    In this case, when the 'enable' stop being '1' the led turns off. And this is wrong, cause the user will not press "enable" button forever.

    I want if the output is '1' once is forever; regardless of the value of the enable.

    --- Quote End ---

    You either change enable to a toggle switch instead of current button or learn how to keep enable high internally using clock edge ...etc.

    and hopefully LED wouldn't burn