PDA

View Full Version : On the Fly - Chip programming



vikas
10-28-2004, 06:46 PM
Hello

As most of you know that 8051 can take up and execute programs from the program memory ( EEPROM / FLash ) . Which inturn can be programmed using a simple UART after the monitor program has been loaded :) . So i was thinking wouldn't it be nice if we could simply javk in a tranciver on the board connected to the UART and a matching IC on the computer side . So in a was now we have a remote programmable board ( No wires required to program the board ) . So programing such a board will be like ... Open Hyperterminal simply select correct menu optiona dn upload the file using send file option All this while your robot is in your next room :) .

Tell me what you think of the Idea cause even when there is ISP interface is till dont like plugging in the 10 pin prgramming headers .

Vikas

Vivek
11-14-2004, 09:42 AM
Hi

There are 2 methods to achieve what you have said - ie. on the fly programming, without using the ISP interface.

1. The older method, was popular when flash based mcus were not in market and i also used this for one of my robot.

The CPU uses external EEPROM to run Code. But Along with that, there is also a RAM chip in the system which is Memory mapped to some CODE address map.

So the CPU starts with a CODE in EEPROM, and this code is Just a Simple Receiver code, which gets the file to run (in binary or intel hex format).
After writing the file in RAM, the CPU simply makes a Jump into RAM. (to a predefined location, where the dowloaded code has start-address).

to make this program userfriendly, you should add the options to specify the running location.
The code in EEPROM is called monitor-program. It can have simple single character commands like
d - download
x - execute
s yyyy - show ram-contents from location yyyy
and so on.

This method anyway increases the cost. 1 EEPROM , 1 RAM.
Oh now the EEPROM is not needed. just external RAM. 32KB or 64KB.

2. Some microcontrollers have In-Application-Programmable Flash.
(Phillips uses IAP term for this. On example i remember is P89C668)
Then its obvious: the code in your flash dowloads the file via serial, and puts it in some flash portion.

cheers!
Vivek