non-standard baud rate usb->serial

I’ve made a serius design flaw in my project, not including a crystal to drive my mcu at an appropriate speed for standard baud rates. However, all is not lost if I can only set the computer baud rate to a non-standard value, i.e. 250K. I am using the FTDI ft232r usb->serial converter, which states explicitly that this is possible. However, how do I get the computer to output at this baud rate. I am using openFrameworks as a platform, so I’m hoping to use a C library. Any suggestion or pointers on C libraries for OS X that support non-standard baud rates is what I’m looking for…

Use the ftdi API, it’s available on their website. Using that you can do much more with your ftdi chip (bitbanging, nonstandard baudrates…).

And yes, it’s a C library. There’s a dynamic library and a C header file.

There’s also an opensource version available, called libftdi http://www.intra2net.com/en/developer/libftdi/

I used it to access the spi protocol in an FT2232. Works for sure on mac and linux, I have no idea if it works on windows. Again it’s all C code.

great advice inventore, I actually found this just moments before I got your reply. And, now I’m stuck again, have you ever used this successfully? I’m sure someone has. I’m trying to use the D2XX library in OSX (10.5). I’ve installed the header files correctly, and can get their sample code to compile just fine, and my files as well. So I’m assuming the library is being linked properly. However, I’m having the following problem, I can’t open a port using FT_Open, or FT_OpenEx.

I am able to scan for devices, which it finds correctly, and their serial numbers, but when it goes to open the device, it always returns with ftStatus = 3, Device Not Opened error. My guess, is that this is because the device is already opened. It shows up in /dev as /dev/tty.usbserial.serialnumber. Does this mean the port is in use? I’ve tried running all of the sample programs and always get a fail on FT_Open with error 3. Any ideas? Is there a way to make sure that port is closed before trying to open it?

Try changing VID and PID, in this way the FT232 won’t be recognized as a serial port, and won’t appear in /dev. At this point you’ll have exclusive access to it. Anyway, I never tried that.

And if you try, tell me if it works :lol: