question on interfacing FPGA with a sensor

hi,

I have a doubt on using inout ports in FPGA design. I am implementing an application on FPGA, that should be interfaced to SHT71(Sensirion humidity and temperature sensor). My FPGA gets the value of temperature and humidity from the sensor and calculates moisture(output) using certain equations.

I have designed the arithmetic unit required to calculate the moisture value in VHDL, and synthesized on to FPGA. But now I have to interface this unit to the sensor(SHT71), and the sensor needs to have a controller(any microcontroller as specified in the SHT71 datasheet) to control its operations and get the values of temperature and humidity. The sensor has a bidirectional data signal as one of the ports, and that should be connected to the controller to send and receive data. I want to implement the controller also on the same FPGA itself. But is it possible? Is it possible to handle a bidirectional port from an FPGA to send and receive data? I am using Virtex XCV800 HQ240I. Or is it suggestible to use any standard microcontroller as an interface between sensor and FPGA?

Any suggestion on this is highly appreciated.

Thanks

Reply to
Viswan
Loading thread data ...

Bidirectional communications are fine.

You probably don't need a full-blown microcontroller for the implementation, you just need the intelligence in the FPGA to perform the proper setup and interrogation over the link.

You could probably interface the sensor to the smallest CPLDs available with a simple state machine. Your FPGA choice is fine.

Reply to
John_H

Take a look at PicoBlaze, available free from Xilinx with VHDL source. I've used this tiny micro to do similar tasks (I2C interface is very similar to the two wire sensirion interface). If you're not out of Block RAM it should fit handily in your large Virtex part. Also see:

formatting link

Reply to
Gabor Szakacs

Do you really need an FPGA to do the job? Wouldn't a simple uC do the trick cheaper and easier? Unless you need the FPGA anyway for some other stuff. (or if this is homework for an FPGA class ;)

Anyway, this is certainly doable in FPGA (it's an overkill, actually) and bi-directional I/O is not an issue. As John mentioned, the interface can be done easily with a simple FSM.

J.S.

Reply to
John Smith

hi,

thanks a lot for all your suggestions. they are really helpful. as i mentioned already, I have a lot of arithmetic operations to be done after obtaining the values of temperature and humidity from the sensor. I need to go through some complex floating point equations which involve addition, subtraction, multiplication and division. So I chose FPGA. I have to perform around 15 multiplications, 4 divisions, 4 additions and 2 subtractions.. would microcontroller be fine for those stuff?

Thanks a lot V.N.

Reply to
Viswan

This depends really on how often you have to do this. In other words, how much time do you have to do the calculations?

I'd suppose that the temperature and humidity values change quite slowly and it does not make sense to update the values more than once per second. Or even once per minute? You can do quite a lot of number crushing in a microcontroller in one second.

I think that using an FPGA for this case is OK for educational purposes, but for a real life case it does not make sense.

J.S.

Reply to
John Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.