libftdi Archives

Subject: RE: ftdi_read_data return 0xff

From: "Michael Plante" <michael.plante@xxxxxxxxx>
To: <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 7 Feb 2011 20:11:08 -0500
Rodrigo Rosa wrote:
>>    unsigned char output_buff[1024];
>>    unsigned char input_buff[1024];
>>    uint numBytesToSend = 0;
>>    uint numBytesToRead = 0;
>>    uint numBytesSent = 0;
>>    uint numBytesRead = 0;
>>        numBytesToSend = 0;
>>        output_buff[numBytesToSend++]=0x1A;
>>        output_buff[numBytesToSend++]=0x01;
>>        output_buff[numBytesToSend++]=0xAA;
>>        numBytesSent = ftdi_write_data(&ftdic, output_buff,
numBytesToSend);
>>        //read
>>        numBytesToRead = numBytesSent;
>>        numBytesToSend = 0;
>>        output_buff[numBytesToSend++]=0x2E;
>>        output_buff[numBytesToSend++]=0x01;
>>        numBytesSent = ftdi_write_data(&ftdic, output_buff,
numBytesToSend);
>>        numBytesToRead = numBytesSent;
>>        input_buff[0]=0x00;input_buff[1]=0x00;input_buff[2]=0x00;
>>         numBytesRead = ftdi_read_data(&ftdic, input_buff,
numBytesToRead);



These do not appear to be MPSSE commands.  Have you looked at AN108?  I am
admittedly looking at a year-old version.  Also, if you're sure your
commands are right, you might try printing some of your variables to the
console and telling us the output, particularly for numBytesToRead and
numBytesRead.  I suspect you are not setting numBytesToRead correctly, by
the way.

Michael


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

Current Thread