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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/14/05 12:27
Read: times


 
#102402 - I use 2 Mbyte and read it as follows
Responding to: ???'s previous message
I use 2 Mbyte and read it as follows
////////////////////////////////////////////////////////////
//
//  FUNCTION: U8 ReadFlashC (U32 RFLaddr);
//
//  read a byte from flash
//
//  ROUTINE MUST BE EXPANDED IF USED FROM ANY ISR

U8 ReadFlashC (U32 RFLaddr)
{
U16 RFLoffs;
U8  RFLpage;
U8  RFLsvSfpg; 
U8  RFLsvIE;

U32 RFLmomma; 
  
  RFLmomma = RFLaddr ;
  
  RFLoffs = (U16) (RFLaddr & 0xFFFF);
  RFLpage = (U8)  ((RFLaddr >> 16) & 0xFF);
  SF_P4       &= 0xe0;                
  SF_P4       |= RFLpage;
  RFLsvIE     = SG_IE;
  SBG_IE_EA   = FALSE;
  RFLsvSfpg = SG_SFRPAGE;                
  SG_SFRPAGE  = 0x00;                
  S0_EMI0CF   = 0x3c; // select external memory
  RFLsvSfpg   = *(U8 xdata*) RFLoffs;
  S0_EMI0CF   = 0x30; // select internal memory
  SG_SFRPAGE  = RFLsvSfpg;                
  SG_IE       = RFLsvIE;
  return  (RFLsvSfpg);
} // end ReadFlashC
ah, I see one - I always have the word "momma" in "debugging variables" I have lost where the habit originated. Anyhow a global search on "momma" allow me to remove all debug variables at cleanup time

BTW
the flash referred to is configured as data, not code memory. The code is for a SILabs f12x.

Erik



List of 14 messages in thread
TopicAuthorDate
Addressing obscenely large amts of RAM?            01/01/70 00:00      
   I use 2 Mbyte and read it as follows            01/01/70 00:00      
      serial            01/01/70 00:00      
         well..            01/01/70 00:00      
            oh i forgot            01/01/70 00:00      
         how do you determine that since it is pa            01/01/70 00:00      
   Banking            01/01/70 00:00      
      2mb            01/01/70 00:00      
         so what, the technique is the same            01/01/70 00:00      
         Wanton!            01/01/70 00:00      
         EMS?            01/01/70 00:00      
   another thought            01/01/70 00:00      
      6 ports device            01/01/70 00:00      
         why only 6            01/01/70 00:00      

Back to Subject List