SERIN confusion on receiving a string of characters.


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    Tried to use this with arduino, instead of RS-232. But it does not work, since polarity is inverted.
    Added simple 1 transistor inverter and everything is fine, but maybe it is possible to modify PBP settings for SERIN2 to accept "inverted" serial data?

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    Not sure what you mean by "arduino, instead of RS-232" but if you take a look at the SERIN2 section of the manual you'll find:
    Mode is used to specify the baud rate and operating parameters of the serial transfer.
    The low order 13 bits select the baud rate. Bit 13 selects parity or no parity. Bit 14
    selects inverted or true level
    . Bit-15 is not used.
    and
    Bit 14 selects the level of the data and flow control pins. If bit 14 = 0, the data is
    received in true form for use with RS-232 drivers. If bit14 = 1, the data is received
    inverted. This mode can be used to avoid installing RS232 drivers.
    So if 16468 works WITH external inverter then flipping bit 14 should make it work WITHOUT external inverter.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    Needless to say that everything regarding Serin and Serin2 is in the manual with detail.

    Cannot see connection of the above to Arduino...

    Ioannis

  4. #4
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    The polarity of input signal. Not the byte or bit inversion, but voltage inversion.

    like discussed here: https://forum.arduino.cc/t/software-...class/535584/6

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    Both are related. The RS232 protocol says that the line stays inactive at -12volt and the TTL output is at 5V at the same time. This forces you to have the appropriate inverter driver chip like MAX232 for example.

    If you do not want to use that chip then you have to make your TTL output stay at 0Volts to fool RS232 line and if you are lucky (as is the case most of the times) the other end of the RS232 line will understand that TTL output is idling.

    Hope this makes sense now.

    Ioannis

  6. #6
    Join Date
    Feb 2013
    Posts
    1,124


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    I know about hardware level converters.
    I'm asking another question. Whenever is it possible for SERIN to treat input 0 as 1 and vice versa?

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: SERIN confusion on receiving a string of characters.

    When you flip bit 14 as Henrik clearly stated at #12

    Ioannis

Similar Threads

  1. PLz Help! Serin and Serout Confusion
    By noor31 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 16th June 2014, 19:51
  2. String of characters(array) to decimal value
    By tacbanon in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 20th June 2012, 14:30
  3. Problem receiving string
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th October 2009, 07:24
  4. Receiving Different String lengths
    By Jannie in forum Serial
    Replies: 5
    Last Post: - 26th January 2009, 05:00
  5. USART Stops Receiving Characters
    By breesy in forum Serial
    Replies: 7
    Last Post: - 26th November 2006, 03:50

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts