Quote:
|
Originally Posted by Fat Alex
so... uh, where would i learn how to do that?
|
Unless you are writing a bootloader(program to allow the pic to program itself without a programmer), i can't really see why it would ever be a good idea to store anything to flash. The only advantage is that it is big... If you need to store alot of data, I would use an external EEPROM..
*Anything you write to flash will be erased if you upload a new program
*It is difficult to both read and write from
*It can cause VERY odd errors if you are not careful (you are writing to the same space as your program is executing from and if you overlap bad things will happen)
*you can only write blocks of 8 bytes at a time
*you can only erase in blocks of 64 bytes at a time
*Flash memory is only rated for 100,000 write/erase cycles. EEPROM is rated for 1,000,000
If you really have your heart set on it, the datasheet will tell you how.
Quote:
|
Originally Posted by Mark McLeod
2) "rom const int x=10;" uses ROM or program space. You cannot change the value of x from within your program as it's running (the compiler will reject "x=y+2;" as an error). The value at program load is permanent and unchanging, only by downloading a new program can x be modified.
|
you CAN write to ROM at runtime but its difficult and i wouldnt' advise it.