libftdi Archives

Subject: Re: ftdi_usb_open_dev & ftdi_set_baudrate

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 17 Jan 2011 10:57:34 +0100
Hello Tim,

On Sunday, 16. January 2011 12:52:01 Tim Schneider wrote:
> I am currently working on connecting a self build sensor with the HTC
> Desire running Android with hostmode enabled. I am using a FTDI Chip and
> libftdi for the task. Since it might be possible that I have multiple
> FTDI Devices connected, I cannot use the ftdi_usb_open API. Instead i'm
> using ftdi_usb_find_all afterwards ftdi_usb_open_dev. Then I read the
> eeprom(ftdi_read_eeprom_getsize & ftdi_eeprom_decode), to determine
> weather this is the sensor I'm looking for.

How you do detect the sensor by the eeprom?
Do you look for the device serial or something?

> 1. I have arbitrary problems with reading the eeprom. Mostly it works the
> first time after a reboot, but on the second time I get a error on
> reading the eeprom. It also happens, that it does not work at all after
> a reboot or it even works multiple times in a row without the need to
> reboot. Does anybody have an Idea what I am doing wrong with this? Is
> there another way how to distinguish between multiple FTDI devices?

Usually by the serial. Which libftdi version is this?

> 2. When I try to set the baudrate for the sensor with ftdi_set_baudrate
> after I did the ftdi_usb_open_dev I get an error. After some research I
> found out, that ftdi_usb_open_dev already sets the baudrate to something
> like 9600, I need 115200 though. After looking through the API I did not
> find a different way to do this. Is there any way I can connect to a
> usb_device and set the baudrate manually? Are there any other ways to
> discover all connected FTDI devices and connect with a specific one not
> using the ftdi_usb_open_dev API?

Setting the baudrate should be always working. Can you post some small 
example code? Also try running your program with "valgrind", since version 
3.6.0 it also supports the ARM platform (I used it on my ARM based N900).

Cheers,
Thomas

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread