PDA

View Full Version : How to read ports



NatureTech
- 23rd March 2010, 04:18
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!...

aratti
- 23rd March 2010, 05:13
ENCODER_THISL.LOWBYTE = PORTB

..then some codes....

ENCODER_THISL.HighBYTE = PORTB


Tray this way.

Al.

NatureTech
- 23rd March 2010, 05:22
To Arratti,

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

PORTB = ENCODER_THISL.LOWBYTE

Thanks