How to output one bit to a pin?
Thomas Taylor
Posts: 27
How do you take the LSB in a byte and outa[x] to a particular pin? Ive thought of a few ways to use logic operators that may accomplish this goal, but each of these seemed too cumbersome. I may be lost in the woods and missing the obvious. Thanks in advance for some guidance. Tom
Comments
This is assuming you're working in SPIN. If PASM let me know and I will post example for that too!
outa[x]:= variable
SPIN takes care of using the LSB. This is because the pin in [] can also be a range, so outa assignment already has work with a flexible number of bits and has to mask out the bits that are not needed.
You're probably right about that! I've spent too much time in PASM lately...
outa[x]:= variable works just fine.
Also thanks for the explanation, MagIO2.
I must have missed that point in the PEK Labs: Fundamentals book.