0
\$\begingroup\$

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.

\$\endgroup\$

marked as duplicate by PeterJ, Dave Tweed Mar 12 '16 at 18:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • \$\begingroup\$ they had a hex keypad and a monitor program in ROM. we had to hand assemble the asm code into machine code and poke it into memory with the hexadecimal keypad. we could also store and reload programs (or data) from audio cassette tape in and out of the unit using this wonderful "Kansas City standard". also had the means to diagnose programs with register/memory examine and change, breakpoints, and single-stepping. in 1985 i wrote a monitor for the Mot MC6809 to do this. \$\endgroup\$ – robert bristow-johnson Mar 12 '16 at 4:45
  • 1
    \$\begingroup\$ I'll go back a bit further. I can remember entering a boot loader into a variety of "minicomputers" (PDP-8 and such) by using the front-panel switches to enter the machine code into core memory. 8 or 12 or 16 toggle switches to enter binary addresses or data words, a switch to enter the binary value into the program counter and another to write the value into the location pointed to by the PC and increment the PC to the next location. All of this was implemented using discrete logic! I know, I'm an old fart! \$\endgroup\$ – DoxyLover Mar 12 '16 at 4:54
  • \$\begingroup\$ I believe a search for 'booting a computer' will find lots of articles, for example at Wikipedia Booting. Alternative phrases include 'Initial program load'. Doing a search of the web is often a good place to start. Please read the help center. \$\endgroup\$ – gbulmer Mar 12 '16 at 7:45
  • 2
    \$\begingroup\$ OP has a problem. MICROCONTROLLERS are designed to be programmed with a narrow communications interface so the answer is not possible. Other earlier computers, were programmed with wire and diode arrays quite MANUALLY but cannot be called microcontrollers. Some good information on MICROPROCESSOR programing history in the answers. \$\endgroup\$ – KalleMP Mar 12 '16 at 8:02
  • \$\begingroup\$ Another possible duplicate: How were the first microprocessors programmed? \$\endgroup\$ – Dave Tweed Mar 12 '16 at 12:13
8
\$\begingroup\$

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.

enter image description here

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.

enter image description here

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.)

enter image description here

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.

enter image description here

\$\endgroup\$
  • \$\begingroup\$ After a short time you learnt to put the old EPROM in the eraser as soon as you tried a new one, and you always had a few of them to cycle. :) \$\endgroup\$ – pipe Mar 12 '16 at 16:37
3
\$\begingroup\$

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

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ The Membership Card is a reproduction of the Popular Electronics Elf computer from August, 1976, repackaged to fit in a pocket-sized Altoids tin, with an 1802 running off 2 AA batteries and up to 64KB of memory. Here is a cheat sheet showing the card's I/O buttons and LEDs plus the 1802 instruction set. \$\endgroup\$ – tcrosley Mar 12 '16 at 20:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.