SerOut2 Dynamic Port Selection


Results 1 to 11 of 11

Threaded View

  1. #1
    nba30's Avatar
    nba30 Guest

    Question SerOut2 Dynamic Port Selection

    I am connecting 15 serial devices to a 40 pin PIC (18F452) and I was wondering if there was a way to have a variable number: 1-15 select which port the serial data is sent to?

    For example:
    -------------------
    SELECT CASE address

    CASE 1
    port var portd.0
    CASE 2
    port var portd.1
    CASE 3
    port var portd.2
    CASE ELSE
    goto error
    END SELECT

    SerOut2 port,baud,["output string",10,13]

    -------------------
    Where "address" is a variable byte that stores a decimal number.

    This example will not compile since you are not allowed to declare an alias more than once.

    I also tried a LOOKUP statement but I cannot store the port addresses (or alias) into variable bytes or words. I also thought about using the address variable and the Pin numbers but since I am dealing with a larger PIC, I cannot access all of this pins with this command.

    Any ideas on how to do this without making a routine for each port that I need to read/write to?

    THANKS!
    Last edited by nba30; - 23rd March 2005 at 02:32.

Similar Threads

  1. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  2. Serout to serial servo
    By azmax100 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 12th August 2009, 16:46
  3. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. STATUS re-curtain W
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2005, 15:21

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