Claims
- 1. A microcontroller coupled to a main-unit interface, which comprises:
- a microprocessor unit coupled via an external data bus to said main-unit interface, said microprocessor unit generating an internal reprogramming-enable signal and a set of latch-enable signals for control of data transfer during a reprogramming operation;
- a ROM unit used to store a reprogramming control routine therein;
- a flash memory unit used to store a main control program for execution by said microprocessor unit to perform a control function specific to said microcontroller;
- an external jumper being manually set to generate an external reprogramming-enable signal;
- an OR gate coupled to said microprocessor unit and said external jumper for generating a selection signal when either of said internal reprogramming-enable signal and said external reprogramming-enable signal is present;
- a multiplexer having two input ends respectively connected to the data buses of said ROM unit and said flash memory unit and one output end connected to the data bus of said microprocessor unit, said multiplexer selecting said ROM unit for connection to said microprocessor unit when said selection signal from said OR gate is present, and selecting said flash memory unit otherwise; and
- a latch buffer coupled between said flash memory unit and said microprocessor unit, said latch buffer being under control in response to the latch-enable signals from said microprocessor unit for data transfer between said flash memory unit and said microprocessor unit;
- wherein the generation of either of said internal reprogramming-enable signal and said external reprogramming-enable signal causes said multiplexer to select the ROM unit for connection to the microprocessor unit, causing the microprocessor unit to execute said reprogramming control routine stored in said ROM unit to control a reprogramming operation to write data into said flash memory unit.
- 2. The microcontroller of claim 1, wherein said external jumper is switchable between a system voltage and a ground voltage in such a manner that when said external jumper is switched to the system voltage, the external reprogramming-enable signal is triggered to generate.
- 3. The microcontroller of claim 2, wherein the external reprogramming-enable signal from said external jumper causes said multiplexer to select the ROM unit for connection to the microprocessor unit, causing the microprocessor unit to execute said reprogramming control routine stored in said ROM unit to control a reprogramming operation to write data into said flash memory unit.
- 4. The microcontroller of claim 1, wherein said flash memory unit further stores a reprogramming detection/initialization routine which is executed by said microprocessor unit to detect whether a flash-reprogramming request signal is issued from said main-unit interface.
- 5. The microcontroller of claim 1, wherein said reprogramming control routine stored in said ROM unit is used to control said microprocessor unit to receive the data to be reprogrammed into said flash memory unit from said main-unit interface.
- 6. The microcontroller of claim 5, wherein said data to be reprogrammed into said flash memory unit include a data signal, an address signal, and a control signal.
- 7. The microcontroller of claim 6, wherein said latch buffer comprises:
- a first latch, in response to a first latch-enable signal from said microprocessor unit, for latching the address signal on a data bus connected to said flash memory unit;
- a second latch, in response to a second latch-enable signal from said microprocessor unit, for latching a flash read/write request signal on a signal line connected to said flash memory unit; and
- a transceiver coupled between said flash memory unit and said microprocessor unit; said transceiver operating in response to a transmission/reception control signal in such a manner that during a write operation, said transmission/reception control signal setting said transceiver to a transmission mode, causing said transceiver to transfer the data signal received by said microprocessor unit from said main-unit interface to said flash memory unit; and during a read operation, said transmission/reception control signal setting said transceiver to a reception mode, causing said transceiver to transfer the data read from said flash memory unit to said microprocessor unit.
- 8. A microcontroller coupled to a main-unit interface, which comprises:
- a microprocessor unit coupled via an external data bus to said main-unit interface, said microprocessor unit generating an internal reprogramming-enable signal and a set of latch-enable signals for control of data transfer during a reprogramming operation;
- a ROM unit used to store a reprogramming control routine therein;
- a flash memory unit used to store a main control program for execution by said microprocessor unit to perform a control function specific to said microcontroller;
- a multiplexer having two input ends respectively connected to the data buses of said ROM unit and said flash memory unit, said multiplexer selecting said ROM unit for connection to said microprocessor unit when said internal reprogramming-enable signal from said microprocessor unit is present, and selecting said flash memory unit otherwise; and
- a latch buffer coupled between said flash memory unit and said microprocessor unit, said latch buffer being under control in response to the latch-enable signals from said microprocessor unit for data transfer between said flash memory unit and said microprocessor unit;
- wherein the generation of said internal reprogramming-enable signal from said microprocessor unit causes said multiplexer to select the ROM unit for connection to the microprocessor unit, causing the microprocessor unit to execute said reprogramming control routine stored in said ROM unit to control a reprogramming operation to write data into said flash memory unit.
- 9. The microcontroller of claim 8, wherein said reprogramming control routine stored in said ROM unit is used to control said microprocessor unit to receive the data to be reprogrammed into said flash memory unit from said main-unit interface.
- 10. The microcontroller of claim 8, wherein said reprogramming control routine stored in said ROM unit is used to control said microprocessor unit to receive the data to be reprogrammed into said flash memory unit from said main-unit interface.
- 11. The microcontroller of claim 10, wherein said data to be reprogrammed into said flash memory unit include a data signal, an address signal, and a control signal.
- 12. The microcontroller of claim 8, wherein said latch buffer comprises:
- a first latch, in response to a first latch-enable signal from said microprocessor unit, for latching the address signal on a data bus connected to said flash memory unit;
- a second latch, in response to a second latch-enable signal from said microprocessor unit, for latching a flash read/write request signal on a signal line connected to said flash memory unit; and
- a transceiver coupled between said flash memory unit and said microprocessor unit; said transceiver operating in response to a transmission/reception control signal in such a manner that during a write operation, said transmission/reception control signal setting said transceiver to a transmission mode, causing said transceiver to transfer the data signal received by said microprocessor unit from said main-unit interface to said flash memory unit; and during a read operation, said transmission/reception control signal setting said transceiver to a reception mode, causing said transceiver to transfer the data read from said flash memory unit to said microprocessor unit.
CROSS-REFERENCE TO RELATED APPLICATION
This application claims the priority benefit of Taiwan application serial no. 86116153, filed Oct. 30, 1997, the full disclosure of which is incorporated herein by reference.
US Referenced Citations (11)