500K baud rate setup

Hi, guys, I have a high speed serial port PCI card. We replaced the original crystal( 14.7456MHz) with the new one 16.000MHz in order to communicate to a SICK laser scanner with the highest speed 500K. My program is written in c under Linux. When the machine boots, I setserial -a /dev/ttyS4, and the baud base is 921600 and divisor is 0; then I setserial /dev/ttyS4 baud_base

1000000 and setserial /dev/ttyS4 spi_cust divisor 2 to set baud rate as 500K.

However my program cannot talk to the laser scanner what do I need to do more?

Any advice is highly appreciated.

Li

Reply to
Li Tan
Loading thread data ...

Hmmm...last time I checked my mathematics book, dividing by 0 was a no no. It tends to return infinite values. If you are writing a 0x00 into the divisor latch, then it will do nothing.

Elroy

Reply to
Elroy the Seedy Impaler

I think 0x00 in the divisor latch will equal 0x100 as far as the baud rate generator is concerned. They normally work as counters.

Could you put a scope on the serial TX line and send out some "U" (0x55) characters to measure the actual baud rate, then adjust settings by trial and error until you get the baud rate you want.

--
Tim Mitchell
Reply to
Tim Mitchell

I'm not so sure that is true, especially for TL16C550 and 750s. Writing zeros into the divisor latch causes no data to be sent. We've made this mistake before.

Elroy

Reply to
Elroy the Seedy Impaler

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.