How to read ports


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2005
    Location
    Penang
    Posts
    40

    Default How to read ports

    Hi all,

    I want to read PORTB (0 to 7) that is attached to HCTL-2016 Quad IC.The problem is when i try to read port,i got syntax error.Or maybe i forgot how it should be done?...Please help.Below is the code:


    ENCODER_THISL.LOWBYTE,[PORTB]

    ..then some codes....

    ENCODER_THISL.HighBYTE,[PORTB]


    Is this how it should be done?.I still remember this (<<) must be used but not sure...darn it!...

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    ENCODER_THISL.LOWBYTE = PORTB
    
    ..then some codes....
    
    ENCODER_THISL.HighBYTE = PORTB
    Tray this way.

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Jun 2005
    Location
    Penang
    Posts
    40


    Did you find this post helpful? Yes | No

    Talking Ok Done.

    To Arratti,

    Thanks.It's working & it's working this way too:

    PORTB = ENCODER_THISL.LOWBYTE

    Thanks

Members who have read this thread : 1

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