FPGARelated.com
Forums

Spartan 3 to tempsensor interface

Started by rgebru March 18, 2005
hey,

thanks..I think the displaly problem got solved..although now I'
nervous since I didn't use a complicated algorithm and since I'
using the bits 9 downto 2 (positive numbers only and are straigh
binary) then I have a process that converts them to bcd..then to th
7 segment display.  Now I'm working on simulating the ad7814..whic
seemed pretty easy. but for the life of me I can't get it t
work..I'm just using a simple process (which you had mentione
earlier also) to generate the timing diagram..this is what I'm doin
( obviously it's wrong ) before I interface it to the fpga.  I ahv
to have the chip with FPGA working by wed :( Talk abou
procrastinating..it seemed simple before I started working on it!
:
entity model7814 i
port
      CS: in std_logic:='Z'
	 SCLK: in std_logic :='0'
	 Dout: out std_logi
	 )
end model7814

architecture Behavioral of model7814 i

 CONSTANT N: integer :=16
begi

 process (CS,SCLK
    begi

    if SCLK' event and SCLK= '0' the
	     if CS<='0' the
	    FOR K IN 0 to N loo
	      if K=0 the
	       Dout <= '0';
	      els
	       Dout<='1'
	      end if
	    end loop
       else
	   Dout<='Z'
      end if
    end if
end process

rgebru wrote:
> I started using the Analog devices AD7814 and I'm having trouble > understanding how to interface it to the Spartan 3 board. :( Does > anyone have any suggestions to get me started? I could REALLY use the > help!! Thanks!! >
1. Why don't you try and understand the code I sent ? It does (I think) all you want to do plus a little extra. It does respect the design rules (it's fully synchronous) It does employ good coding techniques. 2. Read and re-read (and adopt) : http://www.alse-fr.com/archive/VHDL_Coding_eng.pdf Your "simple" process is a collection of things "no to do". Wrong domain, wrong sensitivity list, wrong tristate inference ( via clocked process !).... If you do not start with the basics, you'll find hardware design disgustingly frustrating and a total loss of time. My opinion. Bert Cuzeau
hi

 You might want to give me a chance to look at it before you decide 
don't want to learn it!! Great, so I'm doing everything wrong.  Wel
I have something that kinda models the chip(Not what I had poste
earlier) will look at yours too obviously. But I don't have much tim
to get it working. Everything else except the chip interfacing work
so far. thanks

Thanks everyone for your suggestions, I finally got it to work..