PASM single pin turn on or off.
I dont know why I am having such a hard time with this. I am new to PASM( In case you missed that LOL). And I cant seem to find an example.
So I cant seem to figure out how to turn on or off a single pin. If I use the mov command, I overwrite the whole register. If I use an or command I cant garentee which state it is in.
Anyone have an example of how to do this.
Thank you for your time.
TJ
So I cant seem to figure out how to turn on or off a single pin. If I use the mov command, I overwrite the whole register. If I use an or command I cant garentee which state it is in.
Anyone have an example of how to do this.
Thank you for your time.
TJ

Comments
OR OUTA,bitmask ' This turns the pin on ANDN OUTA,bitmask ' This turns the pin off bitmask LONG |< 16 ' Have a single bit turned on (1). The rest are zeroes.The above assumes that the corresponding bit in DIRA has been turned on already.
TJ
take a look at the PASM-commands MUXC MUCNC MUXZ MUXNZ Prop-manual page 383ff.
short example:
mov _dummylong, #0 wz 'load zero-value => Z-Flag=1 muxz DirA, _Bit 'set the bit 'define a constant at the bottom of the PASM-code _Bit long |< 22 'create Bitmask where only bit 22 is setbest regards
Stefan