NO

Author Topic: FTDI D2XX drivers  (Read 16366 times)

JohnArnoldBrown

  • Guest
FTDI D2XX drivers
« on: April 26, 2012, 10:05:03 AM »
Hi,

Does anyone know whether Pelles C will work with the FTDI D2xx USB bridge drivers?

John

CommonTater

  • Guest
Re: FTDI D2XX drivers
« Reply #1 on: April 26, 2012, 10:09:48 AM »
Hi John and welcome to the forums...

In what context do you mean "will work"...

As in writing a program that uses them... If they're installed in Windows Pelles C can open the device as a file.

If you mean writing or compiling them... in both cases so long as the source is C (not C++)... Yes, it should be able to.

Is there a specific problem you're having?

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #2 on: April 26, 2012, 10:13:57 AM »
Thanks, I meant the first thing, using the installed drivers.
I'm an embedded C/micro person, so not too familiar with the whole Windows/DLL thing, so I thought I'd ask the question before wasting a lot of time.

Kind regards,

John Brown

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: FTDI D2XX drivers
« Reply #3 on: April 26, 2012, 07:45:19 PM »
Thanks, I meant the first thing, using the installed drivers.
I'm an embedded C/micro person, so not too familiar with the whole Windows/DLL thing, so I thought I'd ask the question before wasting a lot of time.
Still not quite clear what you intend to do? Pelle's C is a Windows based and targeted compiler/environment, so it might not be suitable for embedded work...

Ralf

CommonTater

  • Guest
Re: FTDI D2XX drivers
« Reply #4 on: April 26, 2012, 07:56:29 PM »
Thanks, I meant the first thing, using the installed drivers.
I'm an embedded C/micro person, so not too familiar with the whole Windows/DLL thing, so I thought I'd ask the question before wasting a lot of time.

Kind regards,

John Brown


I trust you've already downloaded the programming guide from THIS PAGE I just did a very quick scan of the examples and they seem close enough to plain C so there shouldn't be any big problems using the supplied driver DLLs to access the chip.
 
 

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #5 on: April 27, 2012, 01:11:07 PM »
Thanks, I meant the first thing, using the installed drivers.
I'm an embedded C/micro person, so not too familiar with the whole Windows/DLL thing, so I thought I'd ask the question before wasting a lot of time.
Still not quite clear what you intend to do? Pelle's C is a Windows based and targeted compiler/environment, so it might not be suitable for embedded work...

Ralf
I was merely explaining my ignorance of Windows/dlls etc.
I didn't mean that I wanted to use Pelles C for the embedded end of things, but I often need to communicate with the embedded stuff from a PC.

John

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: FTDI D2XX drivers
« Reply #6 on: April 27, 2012, 03:25:24 PM »
I didn't mean that I wanted to use Pelles C for the embedded end of things, but I often need to communicate with the embedded stuff from a PC.
Ok, I just misunderstood your initial post then a bit...  ;)

Ralf

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #7 on: April 27, 2012, 03:58:00 PM »
Well, just including the FTD2xx.h file in your hello world example brings up hundreds of errors!
I'm way out of my depth here.
BTW, does Pelles C understand C99 data tpes, such as uint32_t ?

John


Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: FTDI D2XX drivers
« Reply #8 on: April 27, 2012, 04:32:26 PM »
Remember to use pocc.exe commanline option -Ze Enable Microsoft extension.

Quote
BTW, does Pelles C understand C99 data tpes, such as uint32_t ?
Code: [Select]
#include <stdint.h>
May the source be with you

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #9 on: April 27, 2012, 04:35:05 PM »
Remember to use pocc.exe commanline option -Ze Enable Microsoft extension.

Quote
BTW, does Pelles C understand C99 data tpes, such as uint32_t ?
Code: [Select]
#include <stdint.h>

Done that.

Sorry, I've done the -Ze option, I will try the stdint.h

John

« Last Edit: April 27, 2012, 04:40:00 PM by JohnArnoldBrown »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: FTDI D2XX drivers
« Reply #10 on: April 27, 2012, 04:54:19 PM »
Sorry , forgot add these too:
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "FTD2XX.h"
#pragma comment(lib, "FTD2XX.lib")
Example
Code: [Select]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
#include "FTD2XX.h"

#pragma comment(lib, "FTD2XX")

int main(int argc, char **argv)
{
FT_STATUS ftStatus;
DWORD numDevs;

ftStatus = FT_ListDevices((void*)&numDevs, NULL, FT_LIST_NUMBER_ONLY);
if(ftStatus == 0)
{
DWORD uDevNo;
char Buffer[64]; // more than enough room!
for(uDevNo=0; uDevNo<numDevs; uDevNo++)
{
ftStatus = FT_ListDevices((PVOID)uDevNo,Buffer,FT_LIST_BY_INDEX|FT_OPEN_BY_SERIAL_NUMBER);
if (ftStatus == FT_OK) printf("%u %s\n", uDevNo, Buffer);
printf("%u %s\n", uDevNo, "Error");
}
}
return 0;
}
« Last Edit: April 27, 2012, 04:57:46 PM by timovjl »
May the source be with you

CommonTater

  • Guest
Re: FTDI D2XX drivers
« Reply #11 on: April 27, 2012, 05:51:58 PM »
Well, just including the FTD2xx.h file in your hello world example brings up hundreds of errors!
I'm way out of my depth here.
BTW, does Pelles C understand C99 data tpes, such as uint32_t ?

John

Hi John... I see the excrement has found the rotating impeller :D  ....

One tip the others haven't given you yet is when you have questions about Pelles C... the F1 button on your keyboard is your very best friend.  Pelle has written an excellent help file for both the IDE and C-11 (the new standard) and it's all tucked away very nicely under the standard Windows "help" button...  Place your cursor on any highlighted keyword and press F1 for full information about it's pupose and use.  Click on any "whitespace"  then F1 for general help on the editor or panel you've clicked on.  You're gonna love it... ;)

And by the way... Pelle even has a good sense of humour... wait till you see the last message in a very long cascade of messages... "More than 100 errors, please improve yourself"... I nearly peed myself laughing the first time I saw it!
 
« Last Edit: April 27, 2012, 05:55:04 PM by CommonTater »

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #12 on: April 27, 2012, 06:57:02 PM »
Thanks to everyone for their patience and help. I won't have time to look at this now for a day or so, but I'll try to digest it all when I do.

John

JohnArnoldBrown

  • Guest
Re: FTDI D2XX drivers
« Reply #13 on: April 28, 2012, 02:54:50 PM »
That's all looking good now. Gives me something to start from, which I always find is the biggest hurdle.

On a separate matter, how do I circumvent the "Do you want to allow the following program from an unknown publisher to make changes to this computer" dialog box that always pops up when I start the Pelles C IDE?

John

Offline Bitbeisser

  • Global Moderator
  • Member
  • *****
  • Posts: 772
Re: FTDI D2XX drivers
« Reply #14 on: April 28, 2012, 06:22:22 PM »
On a separate matter, how do I circumvent the "Do you want to allow the following program from an unknown publisher to make changes to this computer" dialog box that always pops up when I start the Pelles C IDE?
Welcome to the wonderful world of Windows 7 (seriously hope you're not running Vista). The UAC doesn't have an option to do something like a "whitelist" for certain programs not to come up with that ****.
You could try to create your own manifest for POIDE.EXE, but you still might get that crap every time you start your own testing application. A general description, though from the Vista days can be found at http://brethorsting.com/blog/2007/02/meet_uac_-_creating_a_uac_manifest/

Otherwise, try TweakUAC at http://www.tweak-uac.com/what-is-tweak-uac/

Ralf