in reply to Re: SAS protocol
in thread SAS protocol

I did several Raspberry Pi projects and one of them is establishing communication with an ancient slot machine (1995). I've found "documentation" about SAS on one of websites for Raspberry Pi (or Arduino): is a 10 lines code snippet in C++, one of lines is serialPort1.Parity = Parity.Mark; and there's another line with parity which is not "odd" or "even". I'm trying to translate that to Perl script with GUI.

Replies are listed 'Best First'.
Re^3: SAS protocol
by marto (Cardinal) on Jan 17, 2022 at 09:11 UTC

    "one of lines is serialPort1.Parity = Parity.Mark; and there's another line with parity which is not "odd" or "even". I'm trying to translate that to Perl script with GUI."

    Unsurprisingly, specifically mentioned in the documentation, which I showed you here.

Re^3: SAS protocol
by Marshall (Canon) on Jan 17, 2022 at 23:49 UTC
    There are 3 basic parity options:
    1. Don't send parity bit ("none")
    2. Calculate and send parity bit, ("odd","even")
    3. Send a fixed value for the parity bit, ("mark"- logical 1, "space"- logical 0)

    You can go faster if you don't send the parity bit. Most applications send a calculated parity bit (calculation done by the RS-232 chip) with either odd or even parity.

    Sending a fixed value for the parity is a "weird duck". This might be done to essentially "add a 9th data bit", or to force a parity error for some framing reason. When doing that, usually the chip is re-configured just temporarily for a single data byte. So options are "mark","space","none","odd","even". I have no idea why the SAS protocol would send a "mark" for the parity - the rationale for that is protocol dependent. Parity is configured by one of those 5 strings as marto's post explained.