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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/13/07 17:40
Read: times


 
#143197 - As Jan Said
Responding to: ???'s previous message
Erik Malund said:
// set RS485 for 8 bit and Timer 4 baud
//S0_SCON0  = SM_SCON0_REN  + SM_SCON0_SM2 + SM_SCON0_SM1 + SM_SCON0_SM0 ;
  S0_SCON0  = SM_SCON0_REN                 + SM_SCON0_SM1                ; this is how I do it (for ALL SFRs)

As Jan said, you could equally do:
//S0_SCON0  = SM_SCON0_REN  | SM_SCON0_SM2 | SM_SCON0_SM1 | SM_SCON0_SM0 ;
  S0_SCON0  = SM_SCON0_REN                 | SM_SCON0_SM1                ; this is how I do it (for ALL SFRs)

See: http://www.8052.com/forum/read.phtml?id=142803

I guess the advantange is that it's more explicitly obvious that you're doing bitwise stuff?

List of 9 messages in thread
TopicAuthorDate
in 'mov SCON, #50h' where does the 50 come from?            01/01/70 00:00      
   Simple hex/binary arithmetics            01/01/70 00:00      
      or, rather than add            01/01/70 00:00      
   Comment help the author, too!            01/01/70 00:00      
      That would be the Standards Committe            01/01/70 00:00      
      this is how I do it            01/01/70 00:00      
         As Jan Said            01/01/70 00:00      
   Like this            01/01/70 00:00      
   Thanks for the hlp            01/01/70 00:00      

Back to Subject List