I know we can program and load program inside micro controller with easily available programmer with Computer based interface. But I want to know how same thing was being done in older days when No programmer or modern computer kind of interface was not available? Consider it as i am making a full project, so don't miss any steps.
In general, most microcontrollers have had In Circuit Serial Programming (ICSP), e.g. where a programmer like the PICkit 3 is connected to a PIC microcontroller, and a binary image of the code is programmed into the microcontroller's program memory using a dedicated programming interface (in the case of PICs, an data line PGED and a clock line PGEC).
Before flash memory came along, the program memory could take the form of PROM (programmable read-only memory), EPROM (erasable PROM), or EEPROM (electrically erasable PROM). The latter (EEPROM) is functionally the same as Flash memory today, from a programming standpoint. Straight PROMs could only be programmed once. Processors with EPROM had little windows on them, and the program could be erased in 20 minutes or so using UV light. EPROMs without a window were also sold as OTPROM -- one time PROMs.
Before microcontrollers had programmable memory and ICSP, any on-chip program memory was stored in ROM and could only be programmed by the factory. This was used for large volume production which could justify this. The customer would supply a binary file to the factory containing the program. If there was a mistake after the chips were fabricated, all of the chips would have to be thrown out.
So before the ROMs were made, the program would typically be checked out using an In-Circuit Emulator (ICE), in which the microprocessor and/or program code memory chips would be replaced by a socket, and a large cable connected the socket to the ICE. This allowed the program to be downloaded to the ICE and checked out, before the chip was programmed -- it was similar to working with the JTAG interfaces used today, the difference being the typical ICE cost around $5000 in 1970's dollars.
Before microcontrollers, there were microprocessors; the difference being there was no program memory on chip -- instead, the microprocessor had external address and data busses, and the program memory was contained in an external ROM, PROM, EPROM, or EEPROM chip. The latter three could be programmed by the customer. External memory chips using ROM would also be programmed by the factory. This dates way back to the 4004, which was the first microprocessor.
The 1702 (shown earlier) was one of the first EPROMs and could store 256 bytes of program code. The 2764 with 8 KB of program code was another popular chip later on. These chips would be programmed using an external programmer connected to a PC. (Some of the programmers also contained keyboards where you could enter the code by hand, or patch code that had been download.)
You would program the chip(s) needed by your program, then plug them into sockets on your board. The program either ran or it didn't due to bugs. There were no breakpoints available unless you were using one of those multi-thousand dollar ICEs.
If the program had a bug, you would try to fix it, program a new set of chips and repeat. Because of the lack of breakpoints, printf's to a serial UART were often used, as well as blinking LEDs or using an oscilloscope to look at other processor pins. If you ran out of chips, you might have to wait 20 minutes to erase them under a UV eraser.
Back in the old days before ROM chips programming for embedded systems was done by building the memory, eg weaving a rope memory.
General purpose computers were programmed with paper tape (often with switches load the loader code to run the tape reader)
This was superceded by the mask ROM which was programmed at the silicon foundry by varying the oxide or metal layer to set or clear bits.
software was used to prepare the data for the ROM, and with the invention of PROM and EPROM, a connection to a computer could to write it onto the memory chips
The RCA COSMAC 1802 microprocessor included modes which facilitated entering a program into RAM using a row of switches and a button, and verify the code using LEDs. Some computer kit designs in the late 1970s didn't have any ROM, but simply required the user to enter a boot-strapping program manually when the system was powered up. There were two operating-mode switches which depending upon their position would make it possible to reset the program counter, store the switch values to the current program counter, latch the contents of RAM at the program counter to the LEDs, or run the program. At the last Vintage Computer Fair I wrote out a 16-byte program on paper, entered it via switches, and successfully executed it.
If one wanted to do something similar today, one's best bet would probably be to get some UV-erasable 16C54 microcontrollers, a hex Schmidt-trigger buffer or inverter, a 12-bit counter, some resistors, and some capacitors, LEDs, some switches, and possibly a binary counter chip. If the 16C54 reset wire is transitioned from low to +12 volts, then the RTCC and clock inputs will control programming operations. One of them alternates between copying the switch states between programming the memory cells and reading out their contents. The other increments the programming counter.
rh Programming the chip is simply a matter of hitting one of the inputs (I forget which one) to read out the contents of memory location 000 (ensure it's blank), setting the switches to what's supposed to be there, hitting that input again to copy the switch state to the EPROM, and hitting it a third time to read out the new contents. Then hit the other switch, do the above steps for location 001, etc. until everything of interest has been programmed (up to 512 words). Then ground reset, allow it to rise to 5 volts, and let the chip's clock run to execute the program.
If one has a suitable supply of 16C54 chips available, one could use a rig such as that described to program one to operate as a key component in an automated PIC programming device which could then do things like accept input from a serial port.