There are ways around this.
One is to use maths
myvar=PORTA.0+PORTA.1*2+PORTA.4*4+PORTA.5*8
Another way is bit manipulation
myvar=PORTA & %00110011 ' select the input pins
myvar=(myvar & %00000011) + (myvar & %00110000)>>2 'selects A0,A1 then selects A4 and A5 moves then to A2 and A3 and adds to A0,A1
Another way is to set Aliases for the pins which relate to myvar. I will let you look into that one and I am sure there must be other workarounds.
Then myvar can be used in LOOKUP to set an output pattern or used in SELECT CASE or IF THEN, the choice is yours.





Bookmarks