UART vs software RS232


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I'll try inverting -- that option may be on the module in configuration -- like I say the hardwired connection is fine.

    Pardon my lack of knowledge on the matter but what exactly is the difference between
    software serin and serout, hserin etc and the UART?

    I know the good thing about the UART is that it can run in the background but other than that, what are the differences?

    Thanks kindly.

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    The USART is hardware, is faster (115.2k baud), has a buffer but is not capable of inverting to eliminate an RS232 driver.

    If using SEROUT try inverting or non inverting as per the table in PBP help.

    Which command for RS232 are you using?

    Norm

  3. #3


    Did you find this post helpful? Yes | No

    Default

    By command you mean 8N1?

    I'm only using 1200 baud.

    So what is Hserin and hserout? I'd still like to know the difference between software generated RS232 and "hardware" RS232.

    Just the basics of what is going on.

    I'll figure out my problem.....might have to unpack my scope. (wherever it is).

  4. #4
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    QUOTE "By command you mean 8N1?"
    I mean statement: SEROUT?

    Software RS232 can be inverted/non-inverted in software.
    Hardware cannot.

    SEROUT PORTB.7,1,["START",13] '1200 true
    SEROUT PORTB.7,5,["START",13] '1200 inverted

    Norm

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Normnet View Post
    QUOTE

    SEROUT PORTB.7,<font color=red>1</font color>,["START",13] '1200 true
    SEROUT PORTB.7,<font color=red>5</font color>,["START",13] '1200 inverted

    Norm
    RTFM applies here, in the serout and serout2 sections, you will discover " MODE ", now when using <font color=red>SEROUT</font color>, if you <font color=blue>INCLUDE "modedefs.bas"</font color>, you can specify the mode as in below:
    Code:
    SEROUT PORTB.7,<font color=red>T1200</font color>,["START",13]  '1200 true
    SEROUT PORTB.7,<font color=red>N1200</font color>,["START",13]  '1200 inverted
    Last edited by Archangel; - 1st September 2008 at 21:22.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6


    Did you find this post helpful? Yes | No

    Default Back to the specification of RS-232

    RS-232 defines the idle condition as steady MARK. This is -3 to -15 volts AT THE CONNECTOR. Likewise SPACE is a positive voltage of +3 to +15 AT THE CONNECTOR. In contrast, PIC 'idle' is almost always assumed to be 0 volts.

    These high(ish) interface voltages are well beyond TTL levels and so an Interface Converter or Line Driver is frequently required such as the older 1488 and 1489 or the newer MAX-232 family. Line Driver chips also serve for electrical protection of the PIC from outside interference and are usualy socketed on the circuit baord for easy replacement as they get zapped fairly often.

    Line drivers/interface converters are all INVERTERS. So this means the levels at the PIC are now the opposite of what you mention in your first post. MARK, which was a negative voltage at the connector becomes +5 volts at the PIC. SPACE becomes 0 volts at the PIC.

    SERIN allows selection of 'true' and 'inverted'. You use 'true' when you use a line driver or max-232, otherwise use the 'inverted' setting when you have no interface chip in line. HSERIN and SERIN2 expect you to use an inverting interface chip IF you are going to the outside world via an RS-232 connector.

    For short distance or internal PIC to PIC comms you can dispense with the line drivers but you will probably get errors in the first character when sending between PICs at TTL levels.

    To eliminate these errors all you have to do is condition the interface to 'mark' with a positive voltage long enough for a character time. You only need do this at the start of each message or you can ignore this issue and simply add a few throwaway characters at the start of every message. I find it better to add the HIGH xxx : PAUSE n and get every character every time.

    Try using
    HIGH TxDpin
    PAUSE 1
    and then output your message such as..
    SEROUT/HSEROUT/SEROUT2 TxDpin, message

    HTH
    BrianT

  7. #7


    Did you find this post helpful? Yes | No

    Default

    I know all about the history of those higher voltages but now in the 0 - 5 volt world....does it really just come down to this?....

    HSEROUT and HSERIN needs an inverted input where SEROUT and SERIN can operate either true or inverted? (as long as both ends are the same?)

    My device is set to true, 1200 baud, 8N1....having problems with wireless but fine with wired...whether a straight short RS232 or I also have an RS485 connection that can run for a mile. Works like a champ.

    I'm going to look closer at it today -- never had much luck with wireless.....(yet).

    Fact is though, using serout and serin, phase isn't an issue, as long as both ends are the same, right? Both T or Both N.

    Correct?

Similar Threads

  1. PIC uart basics
    By Michael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th September 2008, 19:11
  2. Software RS232 and wireless modules
    By Michael in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 17th August 2008, 05:27
  3. Software Stack
    By yasser hassani in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th December 2007, 10:04
  4. Replies: 3
    Last Post: - 26th November 2006, 21:47
  5. Infrared Communications over RS232 UART or with B0 interupt
    By modifyit in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th December 2005, 19:17

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