I've just started into Propeller Assembly and I am having some issues with controlling/reading pins.
I can set a pin high using
But how do I set it LOW?·
I would assume from SX assembler you'd need a AND of all the pin bits bar pin10 in this case - i.e %111111111111111011111111111 (etc)·
Is there an easier way to do this?
or dira, SPI_ASM_CLK ' output
or outa, SPI_ASM_CLK ' HIGH
SPI_ASM_CLK long |< 10
I assume the same applies to DIRA and setting input(0) and output(1) modes
Then reading pins - I am using the following code - to read INA state:
mov input, #0 ' Zero input
or input, INA ' Place the state of all the pins into input
and input, SPI_ASM_DI ' Place the state of SDA into input
test input, SPI_ASM_DI WC ' If input AND SDA = 0  WZ=1 else = 1  WZ=0
if_c shl spiASMData,#1
if_c or spiASMData,#1
if_nc shl spiASMData,#1
SPI_ASM_DI long |< 11
I get values back from it, but wrong ones.
As always grateful for any help!
Moderator Edit: By popular request this thread is being made a sticky.
Post Edited By Moderator (Chris Savage (Parallax)) : 8/21/2006 5:19:48 PM GMT