Forum: Mikrocontroller und Digitale Elektronik RS485/422 zu USB Schnittstellenkonverter mit beliebiger Baudrate


von Mike (Gast)


Lesenswert?

Hallo,
ich bin auf der Suche nach einem RS485/422 zu USB 
Schnittstellenkonverter, bei dem ich die Baudrate frei parametrieren 
kann. Zum Beispiel sollen auch solche Werte wie 104500 Baud einstellbar 
sein. Ganz gut wäre es, wenn dieser Konverter sogar mindestens zwei 
RS485/422-Schnittstellen besitzt. Der Preis spielt eher eine 
untergeordnete Rolle.

Gruß Mike

von ich (Gast)


Lesenswert?


von Zack (Gast)


Lesenswert?

> Zum Beispiel sollen auch solche Werte wie 104500 Baud einstellbar sein.

Wie kommst Du auf diese Baudrate? Fehlen da vielleicht noch zwei 
Nachkommastellen? :-)

von Reinhard Kern (Gast)


Lesenswert?

Mike schrieb:
> ich bin auf der Suche nach einem RS485/422 zu USB
> Schnittstellenkonverter, bei dem ich die Baudrate frei parametrieren
> kann. Zum Beispiel sollen auch solche Werte wie 104500 Baud einstellbar
> sein.

Hallo,

ob das geht, kannst du nach folgender Anleitung nachrechnen (aus 
FTDI-Application):
>>
A Baud rate for the FT232R, FT2232 (UART mode) or FT232B is generated 
using the chips
internal 48MHz clock. This is input to Baud rate generator circuitry 
where it is then divided by 16
and fed into a prescaler as a 3MHz reference clock. This 3MHz reference 
clock is then divided
down to provide the required Baud rate for the device's on chip UART. 
The value of the Baud rate
divisor is an integer plus a sub-integer prescaler. The original 
FT8U232AM only allowed 3 subinteger
prescalers - 0.125, 0.25 or 0.5. The FT232R, FT2232 (UART mode) and 
FT232B support
a further 4 additional sub-integer prescalers - 0.375, 0.625, 0.75, and 
0.875. Thus, allowed values
for the Baud rate divisor are:
Divisor = n + 0, 0.125, 0.25, 0.375, 0.5, 0.625, 0.75, 0.875; where n is 
an integer between 2 and
16384 (214).
Note: Divisor = 1 and Divisor = 0 are special cases. A divisor of 0 will 
give 3 MBaud, and a divisor
of 1 will give 2 MBaud. Sub-integer divisors between 0 and 2 are not 
allowed.
Therefore the value of the divisor needed for a given Baud rate is found 
by dividing 3000000 by the
required Baud rate.
The exact Baud rate may not be achievable - however as long as the 
actual Baud rate used is
within +/-3% of the required Baud rate then the link should function 
without errors. When a Baud
rate is passed to the driver where the exact divisor required is not 
achievable the closest possible
Baud rate divisor will be used as long as that divisor gives a Baud rate 
which is within +/- 3% of the
Baud rate originally set.
For example:
A non-standard Baud rate of 490000 Baud is required.
Required divisor = 3000000 / 490000 = 6.122
The closest achievable divisor is 6.125, which gives a baud rate of 
489795.9, which is well within
the allowed +/- 3% margin of error. Therefore 490000 can be passed to 
the driver and the device
will communicate without errors.
<<

Dass bei hohen Baudraten je nach Quarz grössere Abweichungen entstehen, 
gilt immer. Bauen kann man natürlich alles, z.B. mit einem steuerbaren 
Quarz-Oszillator. Dann müsste man natürlich auch den Treiber 
entsprechend programmieren. Unter Windows ist es übrigens der Treiber, 
der entscheidet, was möglich ist, du kannst für die Baudrate irgendeine 
Zahl übergeben und der Treiber macht das entweder (wobei du den Fehler 
nicht weisst) oder gibt einen Fehler zurück.

Was mehr oder weniger heisst, jeder handelsübliche Adapter kann anders 
reagieren.

Gruss Reinhard

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.