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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/23/05 13:06
Read: times


 
#104043 - which is a whole lot easier to read
Responding to: ???'s previous message
I always avoid this confusion by the following method

In my .h file (the result of many years of refinement) for the chip I have (this is for the SILabs F12x, thus S0)
sfr S0_TMOD               = 0x89; // timer mode            
  #define SM_TMOD_GATE1     0x80  // control T1 from int1as 8 bit auto-reload timer
  #define SM_TMOD_T1CM1     0x50  // T1 as 16 bit counter
  #define SM_TMOD_T1TM2     0x20  // T1 as 8 bit auto-reload timer
  #define SM_TMOD_T1TM1     0x10  // T1 as 16 bit timer
  #define SM_TMOD_GATE0     0x08  // control T0 from int0
  #define SM_TMOD_T0CM1     0x05  // T0 as 16 bit counter
  #define SM_TMOD_T0TM2     0x02  // T0 as 8 bit auto-reload timer
  #define SM_TMOD_T0TM1     0x01  // T0 as 16 bit timer

then the above MOV TMOD, #11010101B becomes
mov S0_TMOD, #SM_TMOD_GATE1+SM_TMOD_T1CM1+SM_TMOD_T0CM1

which is a whole lot easier to read

Erik

List of 14 messages in thread
TopicAuthorDate
TMOD            01/01/70 00:00      
   Math            01/01/70 00:00      
   TMOD            01/01/70 00:00      
      clarification            01/01/70 00:00      
         Eh???            01/01/70 00:00      
            thanks            01/01/70 00:00      
               Not quite...            01/01/70 00:00      
                  direct addressing            01/01/70 00:00      
                     The point being...            01/01/70 00:00      
         answer for tmod problem            01/01/70 00:00      
            Tutorial???            01/01/70 00:00      
   which is a whole lot easier to read            01/01/70 00:00      
   answer for tmod problem            01/01/70 00:00      
      Samirul, I am sure that Paul has been pa            01/01/70 00:00      

Back to Subject List