The 16F877 has built in EEPROM memory which is non-volatile. That means anything you write to it will be retained after a power loss. You can also write the internal flash memory of the part which will work in the same manner. The difference between the two is the EEPROM memory will tolerate an order of magnitude more write cycles than the flash program memory.
All that being said, the 16F877 and its first replacement, the 16F877A, are approaching end of life and aren’t recommended for new designs. The current production part is the 16F887 that has some additional capabilities but is otherwise identical to the others. If you already have a 16F877, then go ahead and use it since it will suit your purposes. If you have to order a new microcontroller, consider the 16F887.
Probably I need to explain for I am trying to find out.
I need to build a controller, with software wich remembers last button pressed.
For example, button #2 was pressed, the motor has its speed, when power goes off and on, I want the motor has the same speed. No reseting. I just need a ddirection where to start to learn. Maybe I have to choose different chip.
The 16F877 has built in EEPROM memory which is non-volatile. That means anything you write to it will be retained after a power loss. You can also write the internal flash memory of the part which will work in the same manner. The difference between the two is the EEPROM memory will tolerate an order of magnitude more write cycles than the flash program memory.
All that being said, the 16F877 and its first replacement, the 16F877A, are approaching end of life and aren’t recommended for new designs. The current production part is the 16F887 that has some additional capabilities but is otherwise identical to the others. If you already have a 16F877, then go ahead and use it since it will suit your purposes. If you have to order a new microcontroller, consider the 16F887.
-Bill
Notice I cut-and-pasted everything?
What don’t you understand?
What part of the above can you not Google and figure out?
You don’t need repeat your post… I know everything what write to program stays after power shutdown…
I am asking how to make program rewrite it itself. Read my post… I want when I push button program writes this port as starting port, and after shutdown it remembers which button was pressed… I need 4 buttons, every time i push button #1, or #2, or#3,
There is a section of the datasheet that provides details on how to use the EEPROM of the device. Download the datasheet and read everything you can about it. It’s quite easy to use. If this is going to be a C project, there may be some commands built into the compiler or part of the peripheral libraries that may do most of the work for you. I’m not readily familiar with the 8-bit C compilers so you will have to look into that one yourself.