Redirecting serial data at runtime


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    No chance. That takes pins. I'm using all of them already.
    What if...and this is a big ol' what if...
    Since you're already using the first UART for serial, that pin is taken up...
    The 2nd serial port is 'free' for the moment but you want to use it, but can't because there's not enough space for the code.

    How about you use that second serial port pin as an I/O and use it to 'steer' the 1st UART's output (and/or input if need be).
    I think the code impact would be minimal, just set a pin high or low depending on where the serial has to go...

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    You won't believe this, but I do that trick already. I use a 74HCT125 as a data selector to switch between an RS-232 port, and a Lantronix XPORT (which does telnet).

    What I really need is HSERINx/HSEROUTx !!!
    Charles Linquist

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    You won't believe this, but I do that trick already. I use a 74HCT125 as a data selector to switch between an RS-232 port, and a Lantronix XPORT (which does telnet).
    Oh...I believe it...

    What I really need is HSERINx/HSEROUTx !!!
    Sounds like you're into messing with HSERIN in the libs then!
    Maybe you could throw a 'PORT QUALIFIER' as the first character of every HSEROUT statement which would trip another I/O select pin into said library function.
    I.E.
    HSEROUT ["1", data, data, data]
    would always go to the first port
    HSEROUT ["2", data, data, data]
    would always go to the second port

    I would think it wouldn't be that hard to modify the libraries to do recognize the first character in the output stream and switch ports accordingly.
    In fact, I'm going to have a look at the libraries right now...

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Just had a quick look see at the library and it's immediately obvious that modifying the library to do what I suggested above will add a lot more code than just using HSEROUT2.
    I don't support you could post the source...maybe we could find a few places to save some code space for you. I'm up for it...

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    Sorry, can't post the code (it is the property of the company I work for).

    But, you are probably correct in stating that the extra assy structures needed to switch between TX/RX REG1 and TX/RX REG2 would add too much code also.

    I'll have to look into this more.
    Charles Linquist

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I really appreciate the offer, though. I just saw where I can do some "compacting" myself.

    One part that takes up too much space - I have a complete SNMP agent running. I'll start there.
    Charles Linquist

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Charles Linquis View Post
    I really appreciate the offer, though. I just saw where I can do some "compacting" myself.

    One part that takes up too much space - I have a complete SNMP agent running. I'll start there.
    One big thing I've found is with variables. You use a word when a byte will do. That right there uses up a lot of code space.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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