Virtual Port


+ Reply to Thread
Results 1 to 7 of 7

Thread: Virtual Port71 days old

  1. #1
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    343
    Thumbs Up
    Received: 10
    Given: 1
    Total Downloaded
    7.87 GB

    0 Not allowed!

    Default Virtual Port

    Hi all,
    How is it possible to create a virtual port?
    Let's say PORTX.
    Then we define:
    PORTX.0 to be PORTB.7
    PORTX.1 to be PORTC.0
    PORTX.2 to be PORTB.6
    PORTX.3 to be PORTC.1
    PORTX.4 to be PORTB.3
    PORTX.5 to be PORTC.2
    PORTX.6 to be PORTB.4
    PORTX.7 to be PORTC.5
    PORTX = 255
    And now it must exist
    PORTB.7 = 1
    PORTC.0 = 1
    PORTB.6 = 1
    PORTC.1 = 1
    PORTB.3 = 1
    PORTC.2 = 1
    PORTB.4 = 1
    PORTC.5 = 1
    Thanks in advance,
    Teo

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,757
    Thumbs Up
    Received: 51
    Given: 96
    Total Downloaded
    1.33 GB

    0 Not allowed!

    Default Re: Virtual Port

    There is no way to get Proton to do that automatically. You would need to make a sub to do the bit settings

    Sub PortX.......

    PortB.7 = PortX.0
    PortC.0 = PortX.1


    Then call it PortX(255)
    Tim

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    526
    Thumbs Up
    Received: 60
    Given: 0
    Total Downloaded
    408.14 MB

    0 Not allowed!

    Default Re: Virtual Port

    In Proton's defense, there's no way to do that in any language I'm aware of. The PIC hardware just doesn't support it.

    There are a few devices that have a virtual port PPS peripheral that you could set up to do something like that, but very few.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    343
    Thumbs Up
    Received: 10
    Given: 1
    Total Downloaded
    7.87 GB

    0 Not allowed!

    Default Re: Virtual Port

    Thank you very much,
    Teo

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Junior Member Dave Purola's Avatar
    Join Date
    Jul 2004
    Posts
    75
    Thumbs Up
    Received: 5
    Given: 0
    Total Downloaded
    229.34 MB

    0 Not allowed!

    Default Re: Virtual Port

    This works for me....

    BITSWORD1 VAR byte BANK0 'BITS FOR STORAGE


    bitsword1.0 = portc.0
    bitsword1.1 = portc.1
    bitsword1.2 = portc.2
    bitsword1.3 = portc.3


    bitsword1.4 = portb.4
    bitsword1.5 = portb.5
    bitsword1.6 = portb.6
    bitsword1.7 = portb.7


    latc = (latc & $0f) 'strip the bits
    latc = (latc | bitsword1) 'replace the bits


    latb = (latb & $f0) 'strip the bits
    latb = (latb | bitsword1) 'replace the bits

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    343
    Thumbs Up
    Received: 10
    Given: 1
    Total Downloaded
    7.87 GB

    0 Not allowed!

    Default Re: Virtual Port

    Thank you ,
    Teo

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,560
    Thumbs Up
    Received: 76
    Given: 33
    Total Downloaded
    6.56 GB

    0 Not allowed!

    Default Re: Virtual Port

    I do not know exactly what are you trying to do but, have you checked ClearPin and SetPin in the compiler manual page 118 and page 169? In these commands pins are replaced with a number.

    There is also PiMode on page 157 to set the pin either input or output.

    GetPin on page 124 will read the current ststus of the pin.

    All the above can be accessed using a variable.
    Last edited by joesaliba; 27th March 2020 at 21:25.
    Regards

    Joseph

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. USB Virtual Com Port (CDC) & USB_ADC sample
    By crankshaft in forum Proton Plus Compiler v3
    Replies: 35
    Last Post: 17th March 2013, 23:15
  2. [SOLVED !] Virtual Serial Port Driver
    By Sargon in forum Labcenter Proteus VSM
    Replies: 9
    Last Post: 21st October 2011, 20:21
  3. [SOLVED !] Virtual terminal
    By noyz2k in forum Labcenter Proteus VSM
    Replies: 0
    Last Post: 17th February 2009, 13:03
  4. Virtual Terminal
    By Paul Shepard in forum Labcenter Proteus VSM
    Replies: 1
    Last Post: 7th August 2006, 15:54
  5. USB Virtual com port
    By normnet in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 7th November 2005, 05:36

Posting Permissions

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