Hi Denis,

Thanks for your reaction.

In <termios.h> the same baudrates as in your post are mentioned.  However, 
after googling about the topic I'm now investigating in the ioctl() 
function.  For the moment I have this in my code:

/*
 * XpressNetInterface.cpp
 *
 *  Created on: Oct 9, 2017
 *      Author: paul
 */

#include "XpressNetInterface.h"

#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>

//#include <termios.h>
#include <asm/termbits.h>

namespace DCC_V3
{
...
    XpressNetInterface::XpressNetInterface(const char* pDevice)
            : m_pDevice(pDevice)
    {
        struct termios2 settings;

        m_fdSerial = open(m_pDevice.c_str(), O_RDWR | O_NOCTTY);
        if(m_fdSerial < 0)
        {
            //    TODO Daemon has no terminals, use syslog
            perror("open");
        }

        int r = ioctl(m_fdSerial, TCGETS2, &settings);
        if(r)
        {
            perror("ioctl");
        }

        settings.c_ispeed = settings.c_ospeed = 62500;
        settings.c_cflag &= ~CBAUD;
        settings.c_cflag |= BOTHER;

        r = ioctl(m_fdSerial, TCSETS2, &settings);
        if(r)
        {
            perror("ioctl");
        }

        m_fdStop = eventfd(0, 0);
        m_thread = thread([this]
        {
            threadFunc();
        });

    }

...
}

This compiles without errors or warnings.  But before I can test it I have 
to investigate in the "never ending story of device tree overlays".

BTW I cannot use one of the PRUSS processors because they are both used for 
other purposes.

Op dinsdag 10 oktober 2017 19:13:30 UTC+2 schreef Dennis Lee Bieber:
>
> On Tue, 10 Oct 2017 09:04:48 -0700 (PDT), Paul Van den Bergh 
> <[email protected] <javascript:>> declaimed the 
> following: 
>
> >Hi all, 
> > 
> >I'm implementing an interface to a commercial product that communicates 
> >over an asynchronous interface at 62500 Baud.  Looking at the <termios.h> 
> >files on the BBB I cannot find this setting.  Is it at all possible to 
> set 
> >up a u(s)art to communicate at this speed?  Is it possible with ioctl()? 
>   
> >Where can I find more info on the later ? 
> > 
>         The TI Technical Reference Manual for the SoC used by the BBB. 
> (Page 
> 4320 of SPRUH73P http://www.ti.com/lit/ug/spruh73p/spruh73p.pdf 
>
> Baud rate        Over sampling        Divisor                Error (%) 
> 300                        16                                10000            
>     0 
>
> 600                        16                                5000             
>    0 
>
> 1200                16                                2500                0 
>
> 2400                16                                1250                0 
>
> 4800                16                                625                     
>    0 
>
> 9600                16                                313                     
>    0.16 
>
> 14400                16                                208                    
>     0.16 
>
> 19200                16                                156                    
>     0.16 
>
> 28800                16                                104                    
>     0.16 
>
> 38400                16                                78                     
>    0.16 
>
> 57600                16                                52                     
>    0.16 
>
> 115200                16                                26                    
>     0.16 
>
> 230400                16                                13                    
>     0.16 
>
> 460800                13                                8                     
>    0.16 
>
> 921600                13                                4                     
>    0.16 
>
> 1843200                13                                2                    
>     0.16 
>
> 3000000                16                                1                    
>     0 
>
> 3686400                13                                1                    
>     0.16 
>
>
>
>         No 62500... No MIDI 31250 either <G> 
>
>         It might be possible to program one of the PRUs to emulate a UART 
> at 
> the needed speed. (Unless I stuffed a few too many zeros in it, I'm coming 
> up with over 3000 PRU instructions per bit <G>) 
> -- 
>         Wulfraed                 Dennis Lee Bieber         AF6VN 
>     [email protected] <javascript:>    HTTP://wlfraed.home.netcom.com/ 
>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/8e489e71-873f-4eb2-9b9f-6e30ecbb1102%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to