![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) | |
|
Quote:
As kchriste said, the initial value of EEPROM can be written at 0x2100. For further modifying the data EEPROM, the EEPROM write routine as suggested in the datasheet is required. In my program, I didn't have any initial value in the EEPROM, I read the first address of EEPROM. If there is nothing (0xff), the program will write data into it; or else the program will take data from the EEPROM.
__________________
Superman returns..
|
||
|
|
|
|
|
(permalink) |
|
Oh I see my only problem is, if do not have any initial value do I still have to add the org 0x2100 codings? Earlier without that it didn’t work.
|
|
|
|
|
|
|
(permalink) |
|
In your program, you first get data from EEPROM. Without any initial value in it, what will you get?
Are you doing something like this: Save the present value of the 7-segment displays into the EEPROM when the button is pressed? Then the 7-segment displays will display the last saved values when the device is turned off and on again. Or you just want to store the initial values of the 7-segment displays?
__________________
Superman returns..
|
|
|
|
|
|
|
(permalink) | |||
|
Quote:
Quote:
Quote:
|
||||
|
|
|
|
|
(permalink) |
|
Yes, so you're doing what I've done. I didn't get the values from the EEPROM, but from the general purpose register for the first time turn on. Then second time onwards turning it on, it reads from the EEPROM for the last saved data.
__________________
Superman returns..
|
|
|
|
|
|
|
(permalink) |
|
Oh I see then where is your data saving if there is no org 0x2100 location in your coding?
Sorry for asking too much questions. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
The EEPROM write routine (0x55 and 0xaa into EECON2 and so on) in the datasheet is also writing into this location. This location belongs to the EEPROM. If you have written to org 0x2100 in your program, that is just the initial value of the EEPROM, so you can read from it in the beginning of your program. I didn't read from EEPROM in the beginning of my program when the first time turning on the device, so I have no problem even there is no value in the EEPROM.
__________________
Superman returns..
|
||
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| working with eeprom pages? | justDIY | Micro Controllers | 1 | 7th October 2005 09:21 AM |
| Writing Data to the EEPROM | Electrix | Micro Controllers | 2 | 31st August 2005 06:39 AM |
| faulty digital components testing,checking | walters | General Electronics Chat | 5 | 22nd August 2005 07:10 PM |
| sequential read to AT24C01A serial EEPROM | giaracam | Micro Controllers | 2 | 26th October 2004 03:19 AM |
| Ext EEPROM read delay? | brodin | Micro Controllers | 2 | 22nd February 2004 01:43 PM |