Anyone Implemented FTDI 4232 Mini-Module Bit Bang?

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
So far, I have not been able to see any output from the FTDI 4232 Mini-Module when using bit-bang mode. I can get my computer to recognize the device and load the drivers. I can get my program to compile and link FTDI's libraries, load and run without any errors. But so far, no luck in getting an output bit on Channel A, bit 0. In fact, after reading all the example programs, and going through the documemtation, I can't figure out how to even specifiy channel A. Here is one version of the code I've tried. I've also tried flashing the otuput on and off.

Rich (BB code):
// ftdi_hello_world_led.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <string.h>
#include <math.h>
#include "ftd2xx.h"
//#include <ftdi.h>
int _tmain(int argc, _TCHAR* argv[])
{
unsigned char c = 0xff;
DWORD bytes;
FT_HANDLE handle;
printf("FTDI Hello World\n");
if(FT_Open(0, &handle) != FT_OK) {
printf("Cannot open device\n");
return 1;
}
FT_SetBitMode(handle, 0xff, 0x1); //handle, mask, mode
FT_SetBaudRate(handle, 921600);
FT_Write(handle, &c, 1, &bytes);
for(;;) {}
return 0;
}
 
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
Ok, maybe someone can answer this question. It usually takes 3 -6 attempts plugging in the module before windows recognizes the device and loads the drivers. Does that sound like it might point to the cause of the problem described above?
 

Thread Starter

Brownout

Joined Jan 10, 2012
2,390
OK, I finally got this to work! I threw it in the junk drawer out of disgust. But today I dug it out and went over all the connections again. Turns I had a simple wiring mistake. Now, I can turn the LED on and off on I/O port A0. I'll need a slightly more complex breadboard to go forward with the rest of the I/O's. Also will try the MPSSE functions.
 
Top