The LatticeXP2 development kit I selected has an RS232 connector and buffer hooked up to the FPGA. A primitive interface, you might say? Having professionally developed both USB and PCI solutions, I was searching for a development board that had the simplest interface with the FPGA. Why? Well, I don’t want to spend 50% of the time tweaking kernel mode device drivers and data transfer libraries–I want to focus on the FPGA. What could be simpler than the good ol’ serial port, right? Every telecom application I’ve worked on has had hardware with a serial port for debug and engineering management.
It turns out that the PC industry really feels that serial ports are legacy, however. Apple abandoned serial ports over a decade ago, and recent Dell desktop PCs don’t even have serial and parallel ports. For applications requiring legacy ports, we are recommended to use USB-to-Serial Port adaptors. Having worked with such devices since 2003, I can tell you that many are flaky and high unstable. The biggest problem I’ve seen is that the drivers are of questionable quailty. I’ve tried many devices that resulted in a Windows blue-screen of death, in modern Windows NT-based OS (WinNT/2k/XP/Vista/7), and these days the only thing that can really bring down your system to the blue-screen is a kernel-mode error–or more likely- a bad device driver.
Over the years, I’ve found that USB-to-Serial devices that implement an FTDI solution are of superior quality. FTDI is based out of the UK and provides device drivers for all flavors of Windows, Mac OS and Linux. I highly recommend FTDI-based USB-to-RS232 cables if you’ll be using a Mac; just purchase your cable, download the latest driver and follow the installation guide and you’ll be up and running in no time.
After you install the driver, plug in the device and use the System Profier (in Applications->Utilities) to verify the device is recognized:
While there is probably a way to access the serial ports through Mac programming libraires like Cocoa and Carbon, for my purposes I’m going to keep things simple and use the POSIX interface. You can determine the interface using the Terminal application and executing the follow commands:
The above should match devices with a serial number following the search pattern above. The cu.usbserial* device is a call-up interface that you would use if your were dialing into a modem (ah, the good ol’ days!). The tty.usbserial* interface is for listening to a device on a serial interface, and this is the interface I will use to communicate with my Lattice FPGA. My kit has not yet arrived in the post, so I think I’ll start working on a simple terminal application to access the tty interface.