B4R Question Serial Parity bit MARK

Discussion in 'B4R Questions' started by tzfpg, Oct 18, 2018.

  1. tzfpg

    tzfpg Member Licensed User

    i need to set wemos serial parity bits to MARK, how can i set that?
    i already refer to these values but not seen SERIAL_8M1
    Code:
    SERIAL_5N1 0x00
    SERIAL_6N1 
    0x02
    SERIAL_7N1 
    0x04
    SERIAL_8N1 
    0x06
    SERIAL_5N2 
    0x08
    SERIAL_6N2 
    0x0A
    SERIAL_7N2 
    0x0C
    SERIAL_8N2 
    0x0E
    SERIAL_5E1 
    0x20
    SERIAL_6E1 
    0x22
    SERIAL_7E1 
    0x24
    SERIAL_8E1 
    0x26
    SERIAL_5E2 
    0x28
    SERIAL_6E2 
    0x2A
    SERIAL_7E2 
    0x2C
    SERIAL_8E2 
    0x2E
    SERIAL_5O1 
    0x30
    SERIAL_6O1 
    0x32
    SERIAL_7O1 
    0x34
    SERIAL_8O1 
    0x36
    SERIAL_5O2 
    0x38
    SERIAL_6O2 
    0x3A
    SERIAL_7O2 
    0x3C
    SERIAL_8O2 
    0x3E
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Where have you find this list?
     
  3. tzfpg

    tzfpg Member Licensed User

  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that other parities are supported.
     
  5. tigrot

    tigrot Well-Known Member Licensed User

    In moderm UART's MARK parity is no longer supported. I don't know why, but probably because it's no more a EIA standard.
     
  6. tigrot

    tigrot Well-Known Member Licensed User

    In this case I use 8,N and generate a parity bit using a table, to convert ASCII char to MARK parity. In both directions.
    For MARK it's simple to add a 1 bit, without any fancy conversion.
     
    Last edited: Oct 19, 2018
  7. tzfpg

    tzfpg Member Licensed User

    how to do that? is it convert the hex to binary and then add one bit, parity mark is always 1, right?
     
  8. tigrot

    tigrot Well-Known Member Licensed User

    I use OR 128 to add the most significant bit to the byte. To take off use AND 127. Yes it's always 1. Use 8,n for definition, so parity in not checked. To tell the truth MARK is not strictly a parity checking, since it's not calculated. In 45 years I have never seen any device using this feature.
     
  9. JordiCP

    JordiCP Well-Known Member Licensed User

    In fact MARK 'parity' in Async serial is exactly the same as NO parity and 2 stop bits (8N2 for instance)
     
    tzfpg and Erel like this.
  10. tzfpg

    tzfpg Member Licensed User

    now which serial library support 8N2?
     
  11. JordiCP

    JordiCP Well-Known Member Licensed User

    Not sure to understand...it is in the list that you provided in the first post :)
    SERIAL_8N2 0x0E
    Which serial library does not support it?
     
  12. tzfpg

    tzfpg Member Licensed User

    i use SoftwareSerial,cannot find any setting
     
  13. JordiCP

    JordiCP Well-Known Member Licensed User

    I don't use B4R, so can be wrong, but according to the second link you posted, shouldn't it be in the second param of initialize2?
    Code:
    myserial.initialize2(96000x0E)
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    tzfpg and JordiCP like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice