libftdi Archives

Subject: Re: libftdi-1.0: More patches

From: Jim Paris <jim@xxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 2 Sep 2011 13:34:14 -0400
Uwe Bonnes wrote:
> >>>>> "Thomas" == Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx> writes:
> 
> ...
>     Thomas> Also you can focus on single tests only with this:
>     Thomas> "./test_libftdi --run_test=Baudrate/Type232HFixedBaudrates"
> 
>     Thomas> The output of the unit test is not that pretty as I put the
>     Thomas> actually testing in a generic function. Usually that's a no no,
>     Thomas> but I didn't want to duplicate the code for every chip
>     Thomas> type. Maybe a macro can come to the rescue here.
> 
> The one basic is the description in the datasheet:
> Baud Rate Generators - The Baud Rate Generators provides a x16 or a
> x10 clock input to the UART's from a 120MHz reference clock and
> consists of a 14 bit pre-scaler and 4 register bits which provide fine
> tuning of the baud rate (used to divide by a number plus a fraction). This
> determines the Baud Rate of the UART which is programmable from 183 baud to
> 12 Mbaud. See FTDI application note AN_120 on the FTDI website for more
> details.
> 
> The other basic is how this bits get stuffed in the USB request. I didn't
> find any documentation about it. AN_120 is not explicit. Have you more
> information? 
> 
> I wrote the code with a strong look at the corresponding calculations in
> /usr/src/linux/drivers/usb/serial/ftdi_sio.c and a test with the scope. For
> the cases I tested, I saw somehow sensible results. However with the RS232
> pattern you can't easily measure exact frequency with the scope.

If you send a continuous string of UUUUU then you'll see the base
frequency as a simple square wave.

-jim

> What are your doubts? A slight misscalcuation and bad rounding in my code or 
> values really far off the set value. The last case I can easily test with
> the scope. Perhaps tell the setting that you expect a bigg error. It is
> quite easy to test now with examples/serial.


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

Current Thread