Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

nonstandard baud rate on 8430

I'm a bit confused as to how to program a non-standard baud rate on my PCI 8430/8  rs-232 board.

Can I do it with OpenComConfig in  the CVI rs-232 library, or do I need to use the Windows SetCommState function?

I'm also a bit confused about the 1% accuracy specification for the baud rate when using a non-standard rate.  Does this mean that the bit clock used is + / - 1% of the requested value?  e.g., for 57601 bps the actual bit rate will be somewhere from 57,025 to 58,176 bps?

Finally, what is the maximum bit clock difference that can be tolerated between sender / receiver before I could expect to see errors?  I realize this is more likely a generic 16550 UART question more so than a NI specific question.

Thanks.

Menchar
0 Kudos
Message 1 of 6
(4,708 Views)
I believe that it can be done in CVI, but I don't think it can be done directly from the CVI front panel, since you are restricted to a pre-defined list of baud rates. You will need to select one of the baud rates in the drop-down list on the front panel, insert the call into your code, and then go back and modify the baud rate to your custom setting.

I don't have it in front of me, so I do not know exactly how it inserts the baud rate, but if it is some form of constant such as CBR_115200, you can just replace this with a number, such as 1000000 (The max baud rate of the 8430).

-tuba
0 Kudos
Message 2 of 6
(4,697 Views)

Hi Menchar,

From the help on the OpenComConfig front panel for the baud rate: "You can use nonstandard baud rates. All baud rate values are interpreted literally by the comm driver." So, instead of using the slider control on the function's front panel, type in a new value into the baud rate parameter in the source code. You can also use NI-VISA to program your serial ports, although you would have to rewrite your code to use this application programming language (API) instead of the built-in CVI RS232 library.

You are correct, the non-standard baud rates will be generated with +/- 1 percent of the bit rate specified as you mentioned. I found several websites mention that 1% is the maximum difference you want to have, however you could have a difference in up to 5% difference in baud rate and not have problems. See this site, under the heading "Testing Serial Timing". Also, see this site on Radio-Electronics.com under the heading "RS232 Signal Levels", the last paragraph.

Regards,

Missy S.
Project Engineer
RoviSys
Message 3 of 6
(4,676 Views)

MissyD -

Thanks for the nice response.

The NI knowledge base doesn't portray the specifics of how the 843x cards generate the arbitrary baud rate.   It does show the logic for the other NI serial cards as to how the bit rates are calculated.

I would think that the 843x cards maybe generate some finite number of non-standard baud rates, such that any requested arbitrary rate within the range will be within +/- 1% of a rate that can be generated.

So, for some non-standard rates, it may be it's better than 1%?  For standard rates, the 843x spec claims .01% accuracy.

The reason I want to nail this down is that we have a device that's not running at a standard rate, and we're trying to figure out how closely the 843x can be made to match it.

Thanks,

Menchar

0 Kudos
Message 4 of 6
(4,671 Views)
A follow up question if I might be permitted Smiley Wink

After reading those good web pages, I am wondering
how tolerant is the 843x in re receiving frames generated by another device? 

I.e., how much of a timing error will it tolerate when receiving frames?  The web pages state that PC com ports are known to be fairly tolerant of error - the 5% you mentioned - is the 8430 about the same?

Thanks in advance for any additional info you might have.

Menchar
0 Kudos
Message 5 of 6
(4,660 Views)
Hello menchar,

The method used to generate a given baud rate on the 843x series boards is much more complex that the method used by a standard 16550 UART.  The 16550 lends itself to a simple calulation which only really has one variable--the clock divider.  The 843x series boards manipulates several variables to generate a baud rate, making the method of determining error much more difficult.

While I do not know the exact amount of clock error which can be tolerated by the 843x, the on-board UARTs will resynchronize with each incoming data byte.  This means that any differences in baud rate will not cumulate to cause a long-term failure--only the timing within each individual byte is important.  The card does sample each bit multiple times (as mentioned above), so it does have some tolerance for clock variations on the connected device.

-Jason S.
Message 6 of 6
(4,613 Views)