libftdi Archives

Subject: Re: How to use libftdi ftdi_set_bitmode function bitmask ?

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 02 Apr 2009 20:51:55 +0200
Hello Nicolas,

Nicolas wrote:
As I continued to search for an answer I finally managed to use this CBUS thing using libftdi.

Great :-)

The fact is that's not simple for someone who never heard about serial our USB developpement. So here is what I learned, in case of someone as newbie as me have the same problems.

The point was simply that I missunderstood "input" and "output" pin types. To set pins levels from the computer I had to use output pins. I used input ones... I know this is a basic serial thing, but serial developpement and electronics are not part of my knowledge. Here data goes from the computer to the chip, so it's an output from the computer.

Exactly.

So to fix my exemple, here are the right bytes to light my LED on or off :

ftdi_set_bitmode(&ftdic, 0x87, BITMODE_CBUS); // 0x87 is 10000111 byte to switch on. Cbus pin 3 is output set to low. All other pins are input and set to high.

ftdi_set_bitmode(&ftdic, 0x8F, BITMODE_CBUS); // 0x8F is 10001111 byte to switch off. Cbus pin 3 is output set to high. All other pins are input and set to high.

Do you use the CBUS mode on purpose or is it the only mode
that worked out of the box?

Cheers,
Thomas

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