Author Topic: FTDI bitbanging...  (Read 4286 times)

0 Members and 1 Guest are viewing this topic.

Offline BoscoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 276
FTDI bitbanging...
« on: April 17, 2015, 03:56:27 pm »
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 this http://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
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1821
  • Country: au
Re: FTDI bitbanging...
« Reply #1 on: April 18, 2015, 01:05:50 am »
"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.
 

Offline Christopher

  • Frequent Contributor
  • **
  • Posts: 429
  • Country: gb
Re: FTDI bitbanging...
« Reply #2 on: April 18, 2015, 05:50:58 am »
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!
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13804
  • Country: gb
    • Mike's Electric Stuff
Re: FTDI bitbanging...
« Reply #3 on: April 18, 2015, 08:57:43 am »
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.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1093
  • Country: gb
  • Embedded stuff
Re: FTDI bitbanging...
« Reply #4 on: April 18, 2015, 09:58:59 am »
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'.

Yes, 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 at http://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.
Bob
"All you said is just a bunch of opinions."
 

Offline BoscoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 276
Re: FTDI bitbanging...
« Reply #5 on: April 18, 2015, 09:59:32 am »
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++ Problem

Is this because the lib file isn't in the right location? If so where should it go?

Thanks
 

Offline BoscoeTopic starter

  • Frequent Contributor
  • **
  • Posts: 276
Re: FTDI bitbanging...
« Reply #6 on: April 18, 2015, 10:01:07 am »
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'.

Yes, 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 at http://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.

Thanks. Do you think it would be easier with VS?
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1821
  • Country: au
Re: FTDI bitbanging...
« Reply #7 on: April 19, 2015, 11:42:45 pm »

Thanks. Do you think it would be easier with VS?

VS 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf