FPGA communication, I2C and DAC

I would like to use an FPGA for a motor control application. I have worked with FPGAs before and am comfortable with what needs to be done inside the FPGA, where I need some advice is how to interface the FPGA with the outside world. At the end of the chain I need to generate an analog command voltage (multiple channels actually). My initial idea was to use a Cypress PSOC as the DAC and talk between the FPGA and PSOC using the I2C protocol. I've used I2C between multiple PSOCs and have had no problems, the question is how difficult it would be to implement an I2C master in the FPGA (I'm looking at using an Altera Cyclone II). Along those lines, I also would like to have communication between multiple FPGA based motor controllers. Again, I was thinking I2C.

Does anyone see any major hangups or problems with this approach? Any simpler implementation I am overlooking? What is the most common form of digital communication used with an FPGA? How about interfacing to a DAC?

Thanks Jim

Reply to
redstripe
Loading thread data ...

On a sunny day (28 Feb 2006 13:51:27 -0800) it happened "redstripe" wrote in :

I dunno, but I have used simple PWM and low pass filtering te generate an analog voltage for about 500 outputs, depends on how fast the voltage needs to change.

Reply to
Jan Panteltje

The simplest export scheme is SPI, which is also much faster than i2c. i2c also has poorer noise immunity, so that needs watching in a Motor Controller app. That said, if you can only get your DACs in i2c, then the decision is made for you. An i2c master will need a manager state engine, to handle ACK/NACK instances, and bus lockup recovery, as well as organise the address / data.

-jg

Reply to
Jim Granville

There are both I2C and SPI (master) cores on opencores. I've used both and they work for me.

Regards, Mark

Reply to
Mark McDougall

DAC's are also available in many interfaces. I've used the LTC1660 from Linear Tech. These have a very simple serial interface and you can string them in series if you need more than 8 voltages.

Going from FPGA to FPGA you may want to do your own simple serial interface instead of either SPI or I2C. Depending on how many wires you're willing to use you may simplify your design significantly by using point-to-point connections instead of a common multi-master bus like I2C.

Good Luck, Gabor

Reply to
Gabor

I'd go for SPI for loading a DAC under FPGA control. It is simple enough to do with minimal logic.

You do not need the sophistication of I2C.

On the subject of I2C master hardware, IMHO they're a bit of a waste of resources. It is not much effort to bit-bash master behaviour. Why poll some I2C widget when you can simply poll the I2C lines.

I2C slave hardware, now that is something worth doing.

Reply to
Kryten

The OP mentioned "motor control" so I assume that latency matters. This might rule out the use of bit-bashing.

Regards, Allan

Reply to
Allan Herriman

Or the CPU might be busy doing other things, or the program storage might be full, or there might not even be a CPU, or ...

-- The suespammers.org mail server is located in California. So are all my other mailboxes. Please do not send unsolicited bulk e-mail or unsolicited commercial e-mail to my suespammers.org address or any of my other addresses. These are my opinions, not necessarily my employer's. I hate spam.

Reply to
Hal Murray

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.