[Ktechlab-devel] Confusing bitwise behaviour (novice)

Matthew Ayres solar.granulation at gmail.com
Wed Sep 16 14:56:55 UTC 2009


Hello again

Using flowcode I'm performing a right-rotation on variable x on a P16F84.
Port A TRIS is 00011111 and port B TRIS is 00000000.  x is set to 1 before
the initial rotation.

I have the chip's out pins hooked up to LEDs in a circuit in ktechlab.  I'm
writing x to port B, the value of which is thus displayed on the LEDs.

Slipping into binary for a moment, one step after displaying 4, pins go high
for a value of 130 or, back in binary, 1000 0010.  That is to say that pins
RB1 and RB7 are high while the others are low.

To me, this seems to indicate that the variable is being stored in more than
8 bits and that one of these unexpected bits is initially 1.  In short, I'm
confused as all get out!

-Matthew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/ktechlab-devel/attachments/20090916/10f6a8f0/attachment.html>


More information about the Ktechlab-devel mailing list