BSCTyp
Posts: 2
Joined: Mon Feb 12, 2018 4:46 pm

Baud Rate 256000 in C

Mon Feb 12, 2018 4:52 pm

Hi!
Is it possible for me to use the Baud Rate 256000 when using the wiringSerial Library

Code: Select all

   case      50:	myBaud =      B50 ; break ;
    case      75:	myBaud =      B75 ; break ;
    case     110:	myBaud =     B110 ; break ;
    case     134:	myBaud =     B134 ; break ;
    case     150:	myBaud =     B150 ; break ;
    case     200:	myBaud =     B200 ; break ;
    case     300:	myBaud =     B300 ; break ;
    case     600:	myBaud =     B600 ; break ;
    case    1200:	myBaud =    B1200 ; break ;
    case    1800:	myBaud =    B1800 ; break ;
    case    2400:	myBaud =    B2400 ; break ;
    case    4800:	myBaud =    B4800 ; break ;
    case    9600:	myBaud =    B9600 ; break ;
    case   19200:	myBaud =   B19200 ; break ;
    case   38400:	myBaud =   B38400 ; break ;
    case   57600:	myBaud =   B57600 ; break ;
    case  115200:	myBaud =  B115200 ; break ;
    case  230400:	myBaud =  B230400 ; break ;
    case  460800:	myBaud =  B460800 ; break ;
    case  500000:	myBaud =  B500000 ; break ;
    case  576000:	myBaud =  B576000 ; break ;
    case  921600:	myBaud =  B921600 ; break ;
    case 1000000:	myBaud = B1000000 ; break ;
    case 1152000:	myBaud = B1152000 ; break ;
    case 1500000:	myBaud = B1500000 ; break ;
    case 2000000:	myBaud = B2000000 ; break ;
    case 2500000:	myBaud = B2500000 ; break ;
    case 3000000:	myBaud = B3000000 ; break ;
    case 3500000:	myBaud = B3500000 ; break ;
    case 4000000:	myBaud = B4000000 ; break ;
As you can see in the wiringSerial c file I can only use these Baud Rates
Can I just use 230400 when the other device is set to 256000?
Or is there an other Library that enables me to use 256000?
Thank you for any Help!

dstahlke
Posts: 3
Joined: Sun May 27, 2012 2:32 am

Re: Baud Rate 256000 in C

Tue Feb 13, 2018 5:24 am

I don't know about wiringPi, but this program can set arbitrary baud rates: https://github.com/cbrake/linux-serial-test

It's a simple program and it should be easy to extract the baud rate function.

BSCTyp
Posts: 2
Joined: Mon Feb 12, 2018 4:46 pm

Re: Baud Rate 256000 in C

Wed Feb 14, 2018 6:08 pm

Thank you very much!

Return to “Interfacing (DSI, CSI, I2C, etc.)”