SXB IO PIN declaration question.
Clock Loop
Posts: 2,069
How can I do this when declaring IO PINS.
Basically I am trying to assign the IO pin RA.2 to bit .0 in the byte READ.. and so on.
I can't complile like this. Is there a way I CAN do this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
' ------------------------------------------------------------------------- ' IO Pins Read.0 var RA.2 Chrg.0 var RA.3 Read.1 var RB.0 Chrg.1 var RB.1 Read.2 var RB.2 Chrg.2 var RB.3
Basically I am trying to assign the IO pin RA.2 to bit .0 in the byte READ.. and so on.
I can't complile like this. Is there a way I CAN do this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
Comments
Also "READ" is a reserved word.
I would recommend you make your connection in the order you want the bits to be in. Then you can just alias the whole port.
ReadBack VAR RA
Chrg VAR RB
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·
Oops on the read reserved word. I just made that one up here as an example..
So your saying if I do, something like
ReadBack VAR RA
Chrg VAR RB
I can then referr to the bits I want later...
I.E. ReadBack.0, ReadBack.1 = RA.0, RA.1
And Chrg.0, and Chrg.1 = RB.0, RB.1
My whole goal of doing this was to be able to set one bit of ReadBack,,, and then referr to all bits in ReadBack as a whole.
I didn't want to use elaborate code to combine different ports into one byte..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Meh. Nothing here, move along.
Keep in mind that you are NOT creating a copy of the RA port. When you use ReadBack you ARE accessing the RA port. It's an alias not a copy.
You can also then alias the individual bits as in...
ReadBack VAR RA
VoltageHigh VAR ReadBack.0
VoltageLow VAR ReadBack.1
If VoltageHigh = 1 THEN
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap 4-digit LED display with driver IC·www.hc4led.com
COMING SOON "SD DATA LOGGER" www.sddatalogger.com
"I reject your reality, and substitute my own." Mythbusters
·