Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 21st August 2007, 05:23 AM   (permalink)
Default

Quote:
Originally Posted by Suraj143
Hi bananasiong without writing the org 0x2100 did your eeprom code work well?

I think its there to store data. When new data comes the previous values will overwrite.

Earlier I tried without it but it doesn’t work. After I applied org 0x2100. & also after changing bank bits it really worked well.
Yes, it worked well.
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..
bananasiong is offline  
Reply With Quote
Old 21st August 2007, 05:28 AM   (permalink)
Default

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.
Suraj143 is offline  
Reply With Quote
Old 21st August 2007, 05:48 AM   (permalink)
Default

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..
bananasiong is offline  
Reply With Quote
Old 21st August 2007, 05:59 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
In your program, you first get data from EEPROM. Without any initial value in it, what will you get?
org 2100h contains 1,2,3,4 values so I get this values when I power up.

Quote:
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.
Exactly what I'm doing.So my previous 1,2,3,4 values will be overwrite when I press the save button after & turn off & off.

Quote:
Or you just want to store the initial values of the 7-segment displays?
For this no need to write to EEPROM I can load the GP registers which has already loaded the initial values.
Suraj143 is offline  
Reply With Quote
Old 21st August 2007, 06:13 AM   (permalink)
Default

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..
bananasiong is offline  
Reply With Quote
Old 21st August 2007, 06:25 AM   (permalink)
Default

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.
Suraj143 is offline  
Reply With Quote
Old 21st August 2007, 06:43 AM   (permalink)
Default

Quote:
Originally Posted by Suraj143
Sorry for asking too much questions.
Nono, no problem

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..
bananasiong is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
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



All times are GMT. The time now is 11:14 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.