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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/12/10 10:16
Read: times


 
#174989 - Already did all that
Responding to: ???'s previous message
David Prentice said:
Your first step is to decide HOW you want to call any EEPROM functions. I originally gave you a function that takes the 'offset into the internal eeprom space' as an integer. e.g. 0x0123 would access the 0x123'th cell in the eeprom area.


well, I honestly dont care how to address it, my only concern at the moment is getting it working as fast as possible.

David Prentice said:
With 8051 compilers, they have the notion of an xdata variable. So you can declare absolute memory locations in exactly the same way as you have for the memory-mapped LCD.

However you have two different xdata's. So you would need to make sure the Compiler knows how to do the extra little instructions.


Already did that earlier:

unsigned char xdata lcd_command _at_ 0x4000;				//define a data port at 4000 and call it lcd_command - for programming the LCD
unsigned char xdata lcd_data _at_ 0x4001;					//define a data port at 4001 and call it lcd_data - for writing on the LCD
unsigned char xdata keypad _at_ 0x6000;						//define a data port at 6000 and call it keypad - for reading the keypad
 

#define userlimit 45	//define userlimit - 45 MAX under onboard 1K EPROM
unsigned char xdata encrypted_password[5*userlimit] _at_ 0x0000;	//encrypted password.5*userlimit.
unsigned char xdata user_name[16*userlimit] _at_ 0x000E1;				//stores user name.16*userlimit.
unsigned char xdata user_level[userlimit] _at_ 0x003B1;				//store user level.1*userlimit.

 


David Prentice said:
the EEPROM is clearly defined with encrypted_password, user_name and user_level. but it didnt work then either. (I assume _at_ and @ serve the same purpose seeing my LCD works)

Which is why it is easiest to use a function to read and write the eeprom. You would have to force an absolute location for your eeprom_variable. Pass its eeprom_address and the function looks after the read or write. e.g.


...
EEPROM_Write(&encrypted_password[a],encrypted[a]);
EEPROM_Read(&user_name);
...

 


still didnt work.

David Prentice said:
Most people use EEPROM for fixed storage of data. i.e. you want to specify what lives at 0x000 or at 0x123 etc.

So using the integer offset is more intuitive.


Yeah, didnt really understand that one. you mean the pointer that saves the address should be an integer? if so then already tried:

char EEPROM_Read(unsigned int *address)
 


Is it possible that the EEPROM section of the MCU is burned or somehow malfunctioning and im just driving myself insane over a hardware fault? and is there anyway to test it if so?

List of 23 messages in thread
TopicAuthorDate
EEPROM Read/Write Issues            01/01/70 00:00      
   if it was an external EEPROM            01/01/70 00:00      
   if it was an external EEPROM            01/01/70 00:00      
   Special sequence.            01/01/70 00:00      
      Thanks, but can you please simplyfy it?            01/01/70 00:00      
         Hope this explains            01/01/70 00:00      
   Managed to fix lockups, but it doesnt read/write            01/01/70 00:00      
      You have to choose your API            01/01/70 00:00      
         Already did all that            01/01/70 00:00      
            char vs int            01/01/70 00:00      
            I gave you a function            01/01/70 00:00      
               Still no luck            01/01/70 00:00      
                  unsigned int is not the size of the unsigned int* pointer            01/01/70 00:00      
                  Why not use the function I gave you.            01/01/70 00:00      
                     I did use you function            01/01/70 00:00      
                        My apologies.            01/01/70 00:00      
                           Sorry to keep dragging you back here...            01/01/70 00:00      
                              FLIP is a pain            01/01/70 00:00      
                                 We have progress!            01/01/70 00:00      
                                    Terribly sorry to bump but I really need help            01/01/70 00:00      
                                       Found the solution!            01/01/70 00:00      
                                          Study your C textbooks            01/01/70 00:00      
                                          it cant distinguise the sign bit            01/01/70 00:00      

Back to Subject List