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 25th July 2007, 08:31 AM   (permalink)
Default

Quote:
Originally Posted by Pommie
The main difference between flash and EEPROM is the number of times you can write to it. Flash may fail after only 1000 writes, EEPROM is guaranteed for 10,000 writes but will typically last 1,000,000 writes.

EEPROM should be used to store things that may change infrequently such as customer preferences.

Flash should contain data that changes very infrequently such as the program code (changed when a bug is fixed or the code updated). You can also use flash to store data. For example, a musical doorbell may have the code and a tune programmed when it is manufactured but different tunes could be made available via the internet that could be flashed into the memory via RS232.

Mike.
So ideally speaking, we write to the flash everytime we program the chip? And the chip is unusable after 1000 times programming.
If my program occupy for only 1 page, 0x0000 to 0x07ff, I can only store additional data into the second page right?

Hi Gayan, I know what EEPROM is, I'm using it to store the time of my clock
__________________
Superman returns..
bananasiong is offline  
Reply With Quote
Old 25th July 2007, 08:43 AM   (permalink)
Default

You can store code or data in page two.

1000 writes for flash is the worst case - it is typically 100,000.

You seem to keep asking the same questions again and again. If you still have questions you should read the section "PCL and PCLATH" in the data sheet - normally section 2.2

Mike.
Pommie is offline  
Reply With Quote
Old 25th July 2007, 08:45 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
So ideally speaking, we write to the flash everytime we program the chip? And the chip is unusable after 1000 times programming.
No, it's guaranteed to have a minimum life of 1000 times, in reality it will almost certainly have a much longer life.

Quote:

If my program occupy for only 1 page, 0x0000 to 0x07ff, I can only store additional data into the second page right?
No - the entire 2K is program memory, I strongly suggest you use it as such and forget about writing directly to program memory - it's NEVER a good idea to write code that modifys program memory - unless you have a seriously good reason (such as a bootloader).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Old 25th July 2007, 08:58 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
it's NEVER a good idea to write code that modifys program memory - unless you have a seriously good reason (such as a bootloader).
Why? Storing things like,
Customer address for anti theft purposes,
Mapping tables for CDI,
String tables for different languages,
Are all reasons to write to the code area. Why do you think microchip gave you the ability to read and write to this area?

Most cars, mobile phones, network hubs, motherboards and even my DVD recorder are flash upgradable.

Mike.
Pommie is offline  
Reply With Quote
Old 25th July 2007, 09:14 AM   (permalink)
Default

Quote:
Originally Posted by Pommie
You can store code or data in page two.

1000 writes for flash is the worst case - it is typically 100,000.

You seem to keep asking the same questions again and again. If you still have questions you should read the section "PCL and PCLATH" in the data sheet - normally section 2.2

Mike.
It is because I didn't know what's the point of writing into the program memory. I thought that write the program into the program memory and I couldn't figure out why is it needed because the program is already there.
Now I know that the reading from and writing to the flash program memory section in the datasheet is refering to the data, but not the instructions.
__________________
Superman returns..
bananasiong is offline  
Reply With Quote
Old 25th July 2007, 09:24 AM   (permalink)
Default

Quote:
Originally Posted by bananasiong
It is because I didn't know what's the point of writing into the program memory. I thought that write the program into the program memory and I couldn't figure out why is it needed because the program is already there.
You're just confusing yourself, ignore that capability, or choose a PIC that doesn't include it (it's a relatively 'recent' addition) - it's rare to require it, and you almost certainly don't!.

As Pommie says, there are occasions where it's useful, although many of the applications (and the most important ones) he listed are just using it as a bootloader to reprogram the device.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Need some help with a code provided by ATMEL ikalogic Micro Controllers 1 23rd January 2007 02:45 PM
Hardcode a PIC by hand? (or 16F74 + par.port.prog = problem) smilen Micro Controllers 15 21st November 2005 09:23 AM
Writing Data to the EEPROM Electrix Micro Controllers 2 31st August 2005 06:39 AM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 01:04 PM
An error in pic16f84a, why? Zener_Diode Micro Controllers 6 11th April 2004 02:55 AM



All times are GMT. The time now is 06:59 PM.


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