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.

  • I've already tested software solutions, this is about the tty device. – mystery May 11 '16 at 6:49
  • Did the software solutions work? I'm not sure if anyone has demonstrated a working hardware solution on the Pi. – joan May 11 '16 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 May 11 '16 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 May 11 '16 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.