Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Raghunathan
08/25/12 09:58
Read: 1514 times
Chennai
India


 
#188165 - A simple doubt in C
A simple set of statements :

P0MDOUT |= 0x10; // Enable TX0 as a push-pull output
P1MDIN &= ~0x7F; // Set desired pins as analog inputs

While the first one is quite obvious that I am loading 0x10 into P0MDOUT without disturbing any bits that could have already been set, the second statement is a bit convoluted. (What I want to load is 0x80) So whats the big fun in doing this in this fashion ? I am sure its being done with a reason , but maybe I am missing the point.

( For all those experts in C out there, this could almost be a stupid query. So ...just spare a thought that there could be novices also and for whom c-code is hobby....!!)

Cheers
Raghu

List of 6 messages in thread
TopicAuthorDate
A simple doubt in C      Raghunathan      08/25/12 09:58      
   Clears 7 low bits but protects unknown # of high bits        Per Westermark      08/25/12 11:04      
      Pesrpective...      Raghunathan      08/25/12 21:18      
   Setting & clearing bits        Andy Neil      08/25/12 11:18      
      Concept is very clear now...      Raghunathan      08/25/12 21:08      
         Practical C Programming      Andy Peters      09/04/12 15:57      

Back to Subject List