Claims
- 1. A device capable of changing codes of a micro-controller comprising:
a micro-controller; an address latch comprising two input terminals respectively connected to a multiplex bus and an address latch enable (ALE) pin of said micro-controller; a flash memory whose input terminals are connected to said address latch and an address bus of said micro-controller and whose output terminals are connected to the input terminal of said address latch, the flash memory having a renovation program and an general program both recorded therein; a static random access memory (SRAM) whose input terminals are connected to said address latch and an address bus of said micro-controller and whose output terminal are connected to the input terminal of said address latch; and a logic circuit whose input terminals are respectively connected to an output port pin, a read (RD) pin, a write (WR) pin, and a program store enable (PSEN) pin of said micro-controller and whose output terminals are respectively connected to a write enable (WE) pin and an output enable (OE) pin of said flash memory and a write enable (WE) pin and an output enable (OE) pin of said static random access memory, therein, voltages of the pins of the flash memory being WE=1 and OE=PSEN and voltages of the pins of the SRAM being WE=WR, and OE=RD as a voltage of the output port pin is high, the voltages of the pins of the flash memory being WE=WR and OE=RD and the voltages of the pins of the SRAM being WE=1 and OE=PSEN as the voltage of the output port pin is low; wherein, during a period of changing code, the renovation program of the flash memory controls the micro-controller to copy the renovation program itself into the SRAM and then, by changing the voltage of the output port pin to low, makes the renovation program recorded in the SRAM control the micro-controller for replacing the general program of the flash memory with a new program.
- 2. The device capable of changing codes of the micro-controller as claimed in claim 1, wherein said micro-controller is an 8031-series micro-controller.
- 3. The device capable of changing codes of the micro-controller as claimed in claim 1, wherein a voltage of the output port pin is controlled by the renovation program for reading or rewriting of the flash memory and the SRAM.
- 4. The device capable of changing codes of the micro-controller as claimed in claim 1, wherein the flash memory is rewritable as the voltage of the output port pin is low.
- 5. The device capable of changing codes of the micro-controller as claimed in claim 1, wherein the SRAM is rewritable as the voltage of the output port pin is high.
- 6. The device capable of changing codes of the micro-controller as claimed in claim 1, wherein the output port pin is a seventh pin of port 1 of the micro-controller.
- 7. A device capable of changing codes of a micro-controller comprising:
a micro-controller; a flash memory connected to the micro-controller; a static random access memory (SRAM) connected to the microcontroller; and a logic circuit connected to the micro-controller, the flash memory, and the static random access memory (SRAM); wherein the logic circuit can control the micro-controller to fetch machine codes from the static random access memory (SRAM) and write operation results to the flash memory when the logical circuit receives a change mode signal.
- 8. The device capable of changing codes of the micro-controller as claimed in claim 7, wherein the logic circuit can control the micro-controller to fetch machine codes from the flash memory and write operation results to the static random access memory (SRAM) when the change mode signal does not active.
- 9. The device capable of changing codes of the micro-controller as claimed in claim 7, wherein the change mode signal is outputted from an output port pin of the micro-controller.
- 10. The device capable of changing codes of the micro-controller as claimed in claim 7, wherein said micro-controller is an 8031-series micro-controller.
- 11. The device capable of changing codes of the micro-controller as claimed in claim 7, wherein a read (RD) pin and a write (WR) pin of the micro-controller are respectively connected to an output enable (OE) pin and write enable (WE) pin of the flash memory and a program store enable (PSEN) pin of the micro-controller and a high voltage are respectively connected to an output enable (OE) pin and write enable (WE) pin of the static random access memory (SRAM) when the change mode signal is received by the logic circuit.
- 12. A method for changing a general program stored in a flash memory according to a renovation program stored in the flash memory, the method comprising the steps of:
copying the renovation program to a static random access memory (SRAM); and according to the renovation program stored in the static random access memory (SRAM), copying a new program stored in the static random access memory (SRAM) to the flash memory to updating the general program.
- 13. The method as claimed in claim 12, further comprising a step of copying the new program from an outside interface into the static random access memory (SRAM).
- 14. The method as claimed in claim 12, further comprising a step of executing the new program stored in the flash memory.
- 15. The method as claimed in claim 12, wherein an address space of the renovation program in the SRAM is identical to an address space of the renovation program in the flash memory.
CROSS REFERENCE TO RELATED APPLICATION
[0001] This application is a continuation-in-part of U.S. application Ser. No. 09/695970, filed on Oct. 26, 2000 and entitled “Device capable of changing codes of micro-controller”.
Continuation in Parts (1)
|
Number |
Date |
Country |
| Parent |
09695970 |
Oct 2000 |
US |
| Child |
10316012 |
Dec 2002 |
US |