Bug in sub_rs_set_config

All about Sub-20 Multi Interface USB Adapter USB to I2C, SPI, GPIO, RS232, RS485, Ir, LCD

Moderator: serg

Post Reply
Pablo
Posts: 8
Joined: Wed May 19, 2010 3:28 pm

Bug in sub_rs_set_config

Post by Pablo »

Hello

There is a bug in sub_rs_set_config(sub_handle hndl, int config, int baud).

The manual says:
The actual baudrate may slightly differ from the desired as actual baudrate is an integer quotient from dividing the 16MHz reference clock.

But it does not differ "SLIGHTLY".
It differs EXTREMELY !

I need a strange baudrate for my application of 186000 Baud.
I set this baudrate and the result is that the SUB-20 works with 200000 Baud instead.
This is completely useless as the deviation is so much that I get read errors.

If the SUB-20 would behave as the manual says, it would not deviate so much.

If you divide 16 MHz by the integer 86 the result is 186046 Baud which is very near to the desired value.
But 200000 is a deviation of 7,5 %!
Why is it not possible to divide 16 MHz by 86 ?

Either there is a bug in the DLL (or the controller) or the manual has to be corrected.
I hope that there is a bug because such an extreme deviation is unacceptable for me!

Pablo
Attachments
SetFrequency.gif
SetFrequency.gif (43.76 KiB) Viewed 6591 times

xol
Site Admin
Posts: 241
Joined: Sat Aug 29, 2009 8:04 am

Re: Bug in sub_rs_set_config

Post by xol »

Hi.
The error is a result of integer round-up of the baud rate register value calculation.
The nearest baudrate to one you need is 181818. Set baudrate to this value.
It will give you about 2% error from the required 186000.

Pablo
Posts: 8
Joined: Wed May 19, 2010 3:28 pm

Re: Bug in sub_rs_set_config

Post by Pablo »

Hello

What you write is not true.
Please read my posting throroughly again!
Use a calculator and divive 16.000.000 by 86 !
The result is NEITHER 200.000 NOR 181.818.

Elmü

Post Reply