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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/10/08 16:00
Modified:
  10/10/08 16:29

Read: times


 
#158959 - a way to handle it
Responding to: ???'s previous message
I ahve replaced the SFR definitions with my own, here is a snippet:
sfr SF_CLKSEL           = 0x97;    // SYSTEM CLOCK SELECT            

sfr S0_SCON0            = 0x98;    // UART 0 CONTROL                 
  sbit    SB0_SCON0_SM0   = 0x9f;
  sbit    SB0_SCON0_SM1   = 0x9e;
  sbit    SB0_SCON0_SM2   = 0x9d;
  sbit    SB0_SCON0_REN   = 0x9c;
  sbit    SB0_SCON0_TB8   = 0x9b;
  sbit    SB0_SCON0_RB8   = 0x9a;
  sbit    SB0_SCON0_TI    = 0x99;
  sbit    SB0_SCON0_RI    = 0x98;
  #define SM_SCON0_MODE1    0x40
  #define SM_SCON0_MODE3    0xc0
  #define SM_SCON0_SM2      0x20
  #define SM_SCON0_REN      0x10
  #define SM_SCON0_TB8      0x08
  #define SM_SCON0_RB8      0x04
  #define SM_SCON0_TI       0x02
  #define SM_SCON0_RI       0x01

sfr S1_SCON1            = 0x98;               
  sbit SB1_SCON1_SM00     = 0x9f;

SG prefix: any page
SF prefix page f
S0 prefix page 0 ....
SM is mask

It does not make it 'safe' but it makes you conscientuos of the paging (saving many mistakes) and, when you make an error and look at S0_SBUF0 and the SFRPAGE show 'f' in the debugger you KNOW.
Erik


I can put the whole thing in my user page if the interest is big enough

List of 12 messages in thread
TopicAuthorDate
SFR Paging - advantages ?            01/01/70 00:00      
   how else would you do it            01/01/70 00:00      
      RE: how else would you do it            01/01/70 00:00      
         more options...            01/01/70 00:00      
            RE: more options            01/01/70 00:00      
      So smart?            01/01/70 00:00      
         Not very encouraging....:-(            01/01/70 00:00      
            Located this document..            01/01/70 00:00      
               a way to handle it            01/01/70 00:00      
                  Getting clear on this paging stuff            01/01/70 00:00      
                     No new concept!            01/01/70 00:00      
         maybe, maybe not            01/01/70 00:00      

Back to Subject List