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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/01/07 09:40
Read: times


 
#146442 - Overcomplicated?
Responding to: ???'s previous message
Joe Gold said:
Compare your header file with the Keil one here

http://www.keil.com/dd/docs/c51/philips/reg952.h

You will note how the S1BUF (S1ADDR) is mapped in to external memory.

Looking at that file:
Keil's reg952.h said:
/* Serial 1 Configuration */
#define S1ADDR   (*((unsigned char volatile xdata*)0xFFB2))
#define S1ADEN   (*((unsigned char volatile xdata*)0xFFB1))
#define S1BUF    (*((unsigned char volatile xdata*)0xFFB0))


Looks like a particularly clumsy way of doing it!

As we are talking specifically about Keil, I'd have thought it would make much more sense to write:
unsigned char volatile xdata S1ADDR _at_ 0xFFB2;
unsigned char volatile xdata S1ADEN _at_ 0xFFB1;
unsigned char volatile xdata S1BUF  _at_ 0xFFB0;

Which would have the added advantages of giving you proper 'C' language (and debugger) symbols, and informing the Linker that these addresses are not available for general use?

Discuss.

List of 19 messages in thread
TopicAuthorDate
UART1 problem in P89LPC952            01/01/70 00:00      
   What ?            01/01/70 00:00      
   Compare with other examples            01/01/70 00:00      
      Compare with other examples ... and            01/01/70 00:00      
         Re: Compare with other examples            01/01/70 00:00      
            now you have two            01/01/70 00:00      
               Don't trust anything            01/01/70 00:00      
                  Re:Don't trust anything            01/01/70 00:00      
                     its working            01/01/70 00:00      
                        how?            01/01/70 00:00      
                           Re:how?            01/01/70 00:00      
                              Yep : Don\'t trust anything!            01/01/70 00:00      
                              Whose header?            01/01/70 00:00      
                                 Re:Whose header?            01/01/70 00:00      
   MCB950 board is working            01/01/70 00:00      
      UART1 S1BUF doesn't use std SFR            01/01/70 00:00      
         Check the header file            01/01/70 00:00      
            Re:Check the header file            01/01/70 00:00      
            Overcomplicated?            01/01/70 00:00      

Back to Subject List