> -----Original Message----- > From: piclist-bounces@mit.edu > [mailto:piclist-bounces@mit.edu] On Behalf Of Andre Abelian > Sent: Saturday, May 28, 2005 2:14 PM > To: 'Microcontroller discussion list - Public.' > Subject: RE: [EE]: XORing output_bit in CCS c > > > > Rob, > > I just downloaded the manual and looked at page 23-24 where > #bit and #byte are I do not see any thing talking about xor > What page are you looking at? > > Andre > > Not sure what you think you read because page 23 and 24 of the manual concerns the CCS debugger. #bit is covered on page 34 and #byte is on page 35. Did you look at the example code they specify? Did you read the entire description of #byte and #bit because it makes it pretty clear this is a method for direct access to bytes and bits in the PIC's register file map. // assuming PIC16F877A, change address to suit your application #byte PORTA = 0x05 #bit PA0 = PORTA.0 // later in the code PA0 = 1; // set output bit (assuming TRIS register set correctly) PA0 = 0; // clear output bit (assuming TRIS register set correctly) PA0 ^= 1; // toggle bit (assuming TRIS register set correctly) // if TRIS set for input then this is possible if (PA0) { // do something because PA0 read back as 1 } switchstate = PA0; Rob -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist