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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/25/12 15:58
Read: times


 
#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            01/01/70 00:00      
   Clears 7 low bits but protects unknown # of high bits            01/01/70 00:00      
      Pesrpective...            01/01/70 00:00      
   Setting & clearing bits            01/01/70 00:00      
      Concept is very clear now...            01/01/70 00:00      
         Practical C Programming            01/01/70 00:00      

Back to Subject List