Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a little piece of hardware connected to my serial port which outputs a string when I push a button. However, computer seems to be reading it in as all 0's (in hex). The device is outputting in 9600baud, 1start/1stop bit, no parity, and no handshaking.
I seem to have things set up correctly, and it recieves the data, it is just not the correct data. I have tried recieving with logserial, gtkterm, and miniterm. Logserial and gtkterm both showed the recieved data as being all 0h's.
The cable is wired for 3 wires (ground, trans, rec). It works under hyperterm in windows.
The tx,rx,brk numbers all change as a send, though I don't know what they mean.
cat /proc/tty/driver/serial (ran after powering up device)
serinfo:1.0 driver:5.05c revision:2001-07-08
0: uart:16550A port:3F8 irq:4 baud:9600 tx:443 rx:8352 brk:8340 RTS|DTR|DSR
I was setting the baud_base in setserial to 9600 bacause that's what my hardware device was talking to me at. Then I would read from the serial port with logserial or gtkterm who set the baud rate to 9600.
If one did cat /proc/tty/driver/serial after doing setserial you would
see a baud rate of 800. After starting logserial or gtkterm you would see 9600.
In this case it did not work.
If instead I set the setserial baud_base to 115200 (its boot time
default), cat /proc/tty/driver/serial showes 9600. If I then run
logserial or gtkterm cat /proc/tty/driver/serial still shows 9600
baud. And it works.
in the man_page for setserial:
This option sets the base baud rate, which is the clock frequency divided by 16. Normally this value is 115200, which is also the fastest baud rate which the UART can support.
Use the custom divisor to set the speed when the application requests 38.4kb. In this case, the baud rate is the baud_base divided by the divisor. This parameter may be specified by a non-privileged user.
Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
This option sets the custom divison. This divisor will be used then the spd_cust option is selected and the serial port is set to 38.4kb by the application. This parameter may be specified by a non-privileged user.
I'm not using a custom devisor but best I can tell there is a divisor of 12 at work on the baud_base.