FTDI bitbanging... - Page 1
Forum section: electronics / projects

author: Boscoe
author_rank: Frequent Contributor
timestamp: April 17, 2015, 03:56:27 pm
content: Okay, I'm ready to smash my head against the wall now.I'm trying to get bit banging working with my FT232R before I try real data transfer.I've had a go at using ftdilib and D2XX from FTDI and have no idea how to get them working. I'm trying to follow thishttp://hackaday.com/2009/09/22/introduction-to-ftdi-bitbang-mode/tutorial.I don't understand how to make the libraries and integrate them into my IDE (Eclipse on Windows). It almost seems impossible, I have read in places some have not been able to make the library in Windows. There also seems to be next to zero information on how to do on the internet with the hackaday effectively saying 'just do it'.Can someone tell me how to get libftdi working?Thanks

author: moffy
author_rank: Super Contributor
timestamp: April 18, 2015, 01:05:50 am
content: "If you want to use the D2XX library, the header and object files are included in the driver folder. This is the easier option."You don't need to "make" the library it is already precompiled. You just need to link it in at the link stage and ensure your header ".h" files are available for your program. You also need to make sure that you have the FTDI drivers installed so it can recognise your cable. Look in Device Manager under Serial Ports there should be an entry for FTDI when the cable is plugged in.

author: Christopher
author_rank: Frequent Contributor
timestamp: April 18, 2015, 05:50:58 am
content: I had terrible trouble with D2xx spi. Took over a week and I still didn't get anywhere so scrapped it. Unfortunately I can't help but I do feel your pain!

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 18, 2015, 08:57:43 am
content: I've used bit-bang mode on an FT2232H in Visual Basic a while ago to implement a custom synchronous serial protocol & don't recall having any major issues, so I can at least confirm that it does work.I always use the D2XX API for any FTDI serial stuff as you have a lot more control than with COM port emulation.Using D2xx is no diffferent to any other external DLL library.

author: donotdespisethesnake
author_rank: Super Contributor
timestamp: April 18, 2015, 09:58:59 am
content: Quote from: Boscoe on April 17, 2015, 03:56:27 pmYes, I saw that article too, and thought "with all those details that looks easy", but getting a working project for a platform of choice proved more difficult. Eventually I got a project working with Visual Studio 2013, but I think I had to find a backdoor source for some of the files after being unable to find them anywhere on FTDI website.But VS2013 is not Eclipse, so I guess you need libftdi working with gcc. I think the libftdi projects are mainly Linux oriented, to compile under Windows probably requires Cygwin. I would look athttp://www.intra2net.com/en/developer/libftdi/The actual FTDI API is a real mess if you want to support different devices, but I got some simple GPIO toggling going for a couple of devices I have. It's almost too much effort to be worth doing, instead I would probably use a cheap USB micro board and some bespoke firmware, e.g. with Arduino or mbed. A CDC connection makes the app side much easier and more portable.

author: Boscoe
author_rank: Frequent Contributor
timestamp: April 18, 2015, 09:59:32 am
content: Thank you for the replies!I'm now trying D2XX. I have included the header file and added the lib file to my compiler directory but I get 418 errors of this kind:Description Resource Path Location Type expected '=', ',', ';', 'asm' or '__attribute__' before 'FT_Close' ftditest line 313, external location: c:\mingw\mingw32\include\ftd2xx.h C/C++ ProblemIs this because the lib file isn't in the right location? If so where should it go?Thanks

author: Boscoe
author_rank: Frequent Contributor
timestamp: April 18, 2015, 10:01:07 am
content: Quote from: donotdespisethesnake on April 18, 2015, 09:58:59 amThanks. Do you think it would be easier with VS?

author: moffy
author_rank: Super Contributor
timestamp: April 19, 2015, 11:42:45 pm
content: Quote from: Boscoe on April 18, 2015, 10:01:07 amVS should be much easier. If you are developing for windows it is the tool of choice and now that it is free, a no brainer.