EmbDev.net

Forum: FPGA, VHDL & Verilog executing optical sensors with vhdl


Author: Kobi (Guest)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hello everybody, and thank you for having me here with you.
i'm having troubles executing this optical sensor module that i created 
physically using VHDL in collaboration with DE-2/115
the pic i added should explain what i am trying to do... i want to be 
able to make this work by pressing one of the buttons on my board which 
cause a LED to light
this is the code i've written so far:
and for some reason it's not working :/

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
USE IEEE.STD_LOGIC_ARITH.ALL;
entity mouse_lab IS
port(reset,clock_in: in STD_LOGIC;
IF2: IN STD_LOGIC;
LED1: OUT STD_LOGIC);
END mouse_lab;
architecture behave OF mouse_lab IS
BEGIN
PROCESS (clock_in,IF2)
BEGIN
if reset = '0' then
led1 <='1';
else
IF clock_in'event and clock_in = '1' then
if IF2 = '0' then
led1 <='0';
else
led1 <='1';
end if;
end if;
end if;
END process;
END behave;

Author: Klakx (Guest)
Posted on:

Rate this post
0 useful
not useful
The sensitivity List should have reset instead of IF2.
How is your Testbench working. Also people often wrongly apply clock to 
wrong Pin

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [vhdl]VHDL code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig