0

I am trying to get an additional data bit out of ttyAMA0, which basicly works with edo1's approach (Without the CMSPAR patch, atm). In addition, I'm already running an arbitrary Baud rate of 20,35k, using the BOTHER flag.

Now the problem is that you obviously have to switch the parity on a per Byte basis, but it does not seem to change fast enough, resulting in entire blocks of data carrying the wrong(but same throughout blocks) parity.

Does anyone know what is causing that and/or a way around it?

        #include <unistd.h>
        #include <fcntl.h>
        #include <asm/termios.h>

        void send_byte_with_parity(unsigned char byte, unsigned char parity);

        for(i=0;i<37;i++)
        {
            send_byte_with_parity((unsigned char)tx_buffer[i], (tx_buffer[i] & (1<<8)));
        }

Reading the parity bit on Rx is a different story, but I'm glad for any info on that as well.

8
  • Related raspberrypi.stackexchange.com/questions/24806/…
    – Ghanima
    Commented May 11, 2016 at 6:41
  • I've already tested software solutions, this is about the tty device.
    – mystery
    Commented May 11, 2016 at 6:49
  • Did the software solutions work? I'm not sure if anyone has demonstrated a working hardware solution on the Pi.
    – joan
    Commented May 11, 2016 at 8:51
  • They do work using your library but the random jitter(>10us) is a big problem(not your fault, just the OS)
    – mystery
    Commented May 11, 2016 at 10:10
  • @mystery I wouldn't have expected jitter unless there is a lot of network activity or the Pi is exceptionally busy. Is there much else happening on the Pi?
    – joan
    Commented May 11, 2016 at 12:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.