WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [SOLVED] TC Max Serial Port Baudrate  (Read 19812 times)

Offline aj

  • WikiUser
  • *
  • Posts: 29
[SOLVED] TC Max Serial Port Baudrate
« on: May 23, 2013, 01:52:32 PM »
Hello,

I have installed TC OS and I want to develop an application for communication through serial port. The only requirement for this application is the serial port baudrate. I need to use the max speed available and I want to know if it is possible use 921600 kbs or there is some limitation?

Thanks
« Last Edit: May 31, 2013, 09:21:24 AM by aj »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12074
Re: TC Max Serial Port Baudrate
« Reply #1 on: May 23, 2013, 02:04:35 PM »
Does "stty < /dev/ttyXX" give the allowable baud rate?

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #2 on: May 23, 2013, 02:10:39 PM »
Does "stty < /dev/ttyXX" give the allowable baud rate?

I dont knew the stty command but I will try it.

Thanks :)

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #3 on: May 27, 2013, 04:11:46 AM »
Does "stty < /dev/ttyXX" give the allowable baud rate?

Hi,

I used the stty command and shows the configuration of serial port. My doubt is how to know the max baudrate supported by TC. I need to know if is a software limitation or a hardware limitation.

Thanks

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 12074
Re: TC Max Serial Port Baudrate
« Reply #4 on: May 27, 2013, 04:15:46 AM »
I guess any software limitation would be that of the linux-3.0.21 kernel.

Hardware-wise, you'd have to check with the manufacturer - what happens when you use stty to set the baud rate?

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #5 on: May 27, 2013, 04:25:31 AM »
I guess any software limitation would be that of the linux-3.0.21 kernel.

Hardware-wise, you'd have to check with the manufacturer - what happens when you use stty to set the baud rate?

When I set the baudrate 230400 with stty command i get this message: "cannot perform all requested operations"

Thanks

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #6 on: May 28, 2013, 07:11:22 AM »
Hi aj
I think the baud rates may be hard coded in stty and only go up to 115200. For the speed you are looking to run at
will probably require you to find some documentation on your motherboard. The information you need is what type
of UART is on the board and what speed it is being clocked at to determine if it can even achieve the desired baud
rate. If it can't, you will need to find a serial card that can. Then you should be able to use setserial.tcz to configure it.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #7 on: May 28, 2013, 07:26:14 AM »
Hi aj
I think the baud rates may be hard coded in stty and only go up to 115200. For the speed you are looking to run at
will probably require you to find some documentation on your motherboard. The information you need is what type
of UART is on the board and what speed it is being clocked at to determine if it can even achieve the desired baud
rate. If it can't, you will need to find a serial card that can. Then you should be able to use setserial.tcz to configure it.

Hi Rich,

I have installed setserial.tcz and now i can change the baudrate.
My UART type is 16550A and it supports the 921600 baudrate.
Now I'm trying to change the baudrate but I just only can with setserial and I would like make the configuration by software developed in C language.

Thanks   

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #8 on: May 28, 2013, 07:35:00 AM »
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #9 on: May 28, 2013, 07:47:12 AM »
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c

I will try this and then I post the results.

Thanks Rich :)

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #10 on: May 29, 2013, 03:05:05 AM »
Hi aj
This may be of some interest:
http://jim.sh/ftx/files/linux-custom-baudrate.c
Hi Rich,

I use setserial to change the baud_base to 921600.
My serial card is a super I/O W83627HF and it supports the 921600 baud rate.
I compile the code you give me and I can configure the serial port but some strange things happen:
   -> baud_base 921600 (with setserial) -> 115200 configured by software -> 9600 real baud rate
   -> baud_base 921600 (with setserial) -> 230400 configured by software -> 38400 real baud rate
   -> and I tried with different values for baud_base and I changed the divisor with setserial but the real max baud rate is 115200.
   
The problem could be the TC serial driver? I'm trying to debug if the problem is the software before contact the super I/O manufacturer.

Thanks
 

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #11 on: May 29, 2013, 08:02:44 AM »
Hi aj
OK, one thing at a time. Does setserial correctly set the baud rate to 921600? Show the setserial command you are
issuing.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #12 on: May 29, 2013, 08:16:43 AM »
Hi aj
OK, one thing at a time. Does setserial correctly set the baud rate to 921600? Show the setserial command you are
issuing.

I set "sudo setserial /dev/ttyS0 cust_spd baud_base 921600 divisor 1". Then I use "setserial -a /dev/ttyS0" and I can see the configuration results.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #13 on: May 29, 2013, 08:23:22 AM »
Hi aj
If you send data out of the port, is it coming out at 921600?

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #14 on: May 29, 2013, 08:38:14 AM »
Hi aj
If you send data out of the port, is it coming out at 921600?

No. I'm sending data to another pc and the max speed that I can read is 115200.