WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #15 on: May 29, 2013, 08:48:07 AM »
Hi aj
So you used setserial to program the port for 921600 and it doesn't send at that speed. Are you certain that the W83627HF
has a fast enough clock to support that speed?

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #16 on: May 29, 2013, 08:59:59 AM »
Hi aj
So you used setserial to program the port for 921600 and it doesn't send at that speed. Are you certain that the W83627HF
has a fast enough clock to support that speed?

Hi Rich,

I read the W83627HF's datasheet and it supports 230k, 460k  and 921k.
So if the problem isn't the TC serial driver I will try to contact the W83627HF manufacturer.

Thanks for support

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #17 on: May 29, 2013, 09:09:19 AM »
Hi aj
Yes, I know the chip can support that speed. That doesn't mean the board it's installed on can. From the data sheet:
Quote
UART
∙  Two high-speed 16550 compatible UARTs with 16-byte send/receive FIFOs
∙  MIDI compatible
∙  Fully programmable serial-interface characteristics: 
          --- 5, 6, 7 or 8-bit characters 
          --- Even, odd or no parity bit generation/detection   
          --- 1, 1.5 or 2 stop bits generation
∙  Internal diagnostic capabilities:
          --- Loop-back controls for communications link fault isolation   
          --- Break, parity, overrun, framing error simulation   
∙  Programmable baud generator allows division of 1.8461 MHz and 24 MHz by 1 to (216-1)
∙  Maximum baud rate up to 921k bps for 14.769 MHz and 1.5M bps for 24 MHz
If the chip is not supplied with a fast enough clock (14.769Mhz.) it can not run at 921600.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #18 on: May 29, 2013, 09:19:52 AM »
Hi aj
Yes, I know the chip can support that speed. That doesn't mean the board it's installed on can. From the data sheet:
Quote
UART
∙  Two high-speed 16550 compatible UARTs with 16-byte send/receive FIFOs
∙  MIDI compatible
∙  Fully programmable serial-interface characteristics: 
          --- 5, 6, 7 or 8-bit characters 
          --- Even, odd or no parity bit generation/detection   
          --- 1, 1.5 or 2 stop bits generation
∙  Internal diagnostic capabilities:
          --- Loop-back controls for communications link fault isolation   
          --- Break, parity, overrun, framing error simulation   
∙  Programmable baud generator allows division of 1.8461 MHz and 24 MHz by 1 to (216-1)
∙  Maximum baud rate up to 921k bps for 14.769 MHz and 1.5M bps for 24 MHz
If the chip is not supplied with a fast enough clock (14.769Mhz.) it can not run at 921600.

Hi Rich,
I don't know the hardware. I will check the clock speed.
Thanks for support

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #19 on: May 29, 2013, 10:04:21 AM »
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 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.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 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.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #20 on: May 29, 2013, 10:24:31 AM »
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 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.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 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.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.

Hi Rich,

I will try this too.

Thanks again :)

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #21 on: May 30, 2013, 02:24:18 AM »
Hi aj
One other thing I noticed. From the setserial man pages:
Quote
spd_cust
 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.
spd_normal
 Use 38.4kb when the application requests 38.4kb. This parameter may be specified by a non-privileged user.
divisor divisor
 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.
After using setserial to program the baud rate, try using stty to set the speed to 38.4kb. Your hardware should now be set to
the fastest speed it supports.

Hi Rich,

I followed these steps and doesn't worked.
The  W83627HF's clock speed is 24MHz so it supports 921k.
The problem could be the serial driver? I found this link http://www.muru.com/linux/w83627hf/.

Thanks for the support

Offline genec

  • Full Member
  • ***
  • Posts: 240
Re: TC Max Serial Port Baudrate
« Reply #22 on: May 30, 2013, 04:50:27 AM »
so you tried
Code: [Select]
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4then open some serial program and used the baud rate 38400 and still no luck?

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #23 on: May 30, 2013, 05:05:44 AM »
so you tried
Code: [Select]
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4then open some serial program and used the baud rate 38400 and still no luck?

Hi genec

Yes, I tried this and still no luck. But this link shows a driver for my serial card. I need compile this driver? Or the TC serial driver is enough?

Thanks

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #24 on: May 30, 2013, 06:02:31 AM »
Hi aj
Quote
I need compile this driver? Or the TC serial driver is enough?
hwmon-3.0.21-tinycore.tcz  contains the  w83627hf  driver. Install the extension and modprobe the driver if you haven't
already done so.
Quote
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4
That will set the baud rate to 230400 and should be executed with sudo.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #25 on: May 30, 2013, 07:17:54 AM »
Hi aj
Quote
I need compile this driver? Or the TC serial driver is enough?
hwmon-3.0.21-tinycore.tcz  contains the  w83627hf  driver. Install the extension and modprobe the driver if you haven't
already done so.
Quote
setserial /dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4
That will set the baud rate to 230400 and should be executed with sudo.

Hi Rich,

I have installed hwmon-3.0.21-tinycore.tcz and modprobe w83627hf. I set dev/ttyS0 uart 16550A baud_base 921600 spd_cust divisor 4 and the real baud rate is 38400. If I set dev/ttyS0 uart 16550A baud_base 230400 spd_cust divisor 1, the real baud rate is 115200.
I need add another module? Or I need remove the old serial driver?

Thanks

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #26 on: May 30, 2013, 11:37:14 PM »
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #27 on: May 31, 2013, 02:22:09 AM »
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.

Hi Rich,

I will try to compile the driver.

Thanks for the support

Offline aj

  • WikiUser
  • *
  • Posts: 29
Re: TC Max Serial Port Baudrate
« Reply #28 on: May 31, 2013, 02:45:46 AM »
Hi aj
I took a look at the source code for w83627hf and from what I can tell it does not program the UART clock source, so it
is probably set to 1.846Mhz which would limit the baud rate to 115200. From the w83627hf data sheet:
Quote
CRF0 (Default 0x00)
  Bit 7 - 2  : Reserved.
  Bit 1 - 0  : SUACLKB1,  SUACLKB0   
= 00    UART A clock source is 1.8462 Mhz (24MHz/13)
= 01    UART A clock source is 2 Mhz (24MHz/12)
= 10    UART A clock source is 24 Mhz (24MHz/1)
= 11    UART A clock source is 14.769 Mhz (24mhz/1.625)
This shows if the register is not reprogrammed to 11 the default state will be used which limits the baud rate to 115200.
Looks like you may have to compile  http://www.muru.com/linux/w83627hf/w83627hf-fast-serial.c  to get higher speeds.

Hi Rich,

It is possible compile the driver with Tiny Core? Some includes are in "/usr/src" and TC doesn't have this directory.

Thanks

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 7795
Re: TC Max Serial Port Baudrate
« Reply #29 on: May 31, 2013, 08:22:05 AM »
Hi aj
I was able to compile the source. Make sure you have compiletc.tcz and linux-headers-3.0.21-tinycore.tcz installed.
Comment out or remove this line from the source:
Code: [Select]
#include <linux/config.h>Create a file called  Makefile  in the same directory as the source containing:
Code: [Select]
obj-m += w83627hf-fast-serial.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
Execute  make  from the command line and it should build.