MICROCONTROLLER CONDITIONALLY SKIPS UPDATING LATCH FOR MSB AND DIRECTLY DRIVES LSB OF MEMORY ADDRESS

Abstract: A microcontroller directly drives a memory with low order address bits during a fetch operation. Driving the low order address bits directly while the high order bits are latched during an address/data multiplex on the same pins allows the latch enable cycle to be skipped during sequential fetches. A sequential address detector indicates when the latch enable cycle can be skipped.

Description: Microcontroller conditionally skips updating latch for MSB and directly drives LSB of memory address. FIELD OF THE INVENTION The invention relates to a data processing system comprising a microcontroller with a bus interface unit, and further comprising a memory and an address latch coupled between the bus interface unit and the memory for enabling the microcontroller to supply a current address to the memory. BACKGROUND ART Microcontrollers typically operate in a mode where instructions and data are fetched from an external memory in a sequential order for a large proportion of any period of execution. These microcontrollers typically time division multiplex address and data bits over some or all of the same external lines or pins to conserve external pin use. Because the same pins are used for both address and data, an external address latch is provided between the microcontroller and the external memory. This external latch stores the address output by the microcontroller and presents it to the memory while the external pins are used for data, so that the address can be applied to the memory throughout the read cycle. Each of the fetch cycles occupies several clock cycles one of which is a clock cycle where a latch enable signal is provided to the external latch. Because microcontrollers are being requested that operate at higher and higher speeds there is a need to reduce the number of clock cycles required for an instruction or data fetch and a need to speed up or optimize the fetch cycle. Some microcontrollers directly drive address bits at the high order portion or most significant bits (MSB) of the address. However, because the high order address bits change relatively infrequently during sequential address fetches reducing address latching for the high order pins is not particularly helpful in reducing the length of a fetch cycle. OBJECT OF THE INVENTION It is an object of the invention to provide a system and microcontroller as specified in the preamble wherein the cycle time for a fetch is reduced with regard to prior art solutions. It is an object of the present invention to reduce the cycle time for sequential data and instruction fetches. SUMMARY OF THE INVENTION The above objects are attained by a system as specified in the preamble and characterized in that the bus interface unit is operative to directly supply low order bits of the current address to the memory and to supply high order bits to the memory via the address latch. This configuration enables suppressing updating of the latch when the microcontroller is in a sequentially addressing mode and when the high order bits have not changed. In an embodiment of the system in the invention, the bus interface unit comprises a detection circuit receiving the low order bits of the current address for determining if any of the high order bits of the current address have changed with regard to the high order bits of a preceding address in a logically sequential addressing mode of the microcontroller. The bus interface unit further comprises latch control means coupled to the detection circuit for disabling updating of the latch if the detection circuit determines that no change has occurred. The detection circuit may comprise a first logic gate, such as an OR or an AND gate, that receives the low order bits and supplies a first gate output signal determining whether or not the received low order bits all have a same specific logic value. The detection circuit may include, in addition, a second logic gate that receives the first gate output signal and a further signal indicating that the microcontroller is in the sequential addressing mode and that supplies a control signal to the latch control means. The detection circuit allows to determine when the high order bits change, so that the latching of the high order bits can be effected. The latching does not occur, i.e., the address latch is not updated, whenever the high order bits do not change, allowing the latch enable clock cycle to be skipped during a fetch cycle. These, together with other objects and advantages which will be subsequently apparent, reside in the details of construction and operation as more fully hereinafter described and claimed, reference being had to the accompanying drawings forming a part hereof, wherein like numerals refer to like parts throughout. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 depicts the architecture of a microcontroller according to the present invention; Figure 2 illustrates a first embodiment of the present invention; and Figure 3 illustrates a second embodiment of the present invention. DESCRIPTION OF THE PREFERRED EMBODIMENTS When sequential memory locations of an external memory are addressed one after another, for a large part of the time only the low order bits of the address supplied to the memory change. If the sequential addressing continues for a long enough period the higher order address bits also change (are incremented). However, the change in the high order bits is relatively infrequent. By driving the low order bits directly and not multiplexing the low order bits while only the low order bits are changing, there is no need to latch the upper order bits into an external memory latch since they have not changed. That is, the external address latch need not be updated for a subsequent transfer if the new transfer address differs from the previous address only in the low order bits. This allows the latch enable clock cycle of the fetch cycle to be skipped, thereby reducing the time required for fetching data (instructions or operand data) from external memory. If only the lower order four (or the four least significant) bits are directly driven only 1 in 16 sequential transfers require the overhead of address latching. The present invention, as described in detail below, preferably directly drives, or does not multiplex, only the four least significant bits, however, additional lower order bits, such as six, eight or more, can be directly driven. The architecture of a microcontroller system 10 of present invention is illustrated in figure 1. This system 10 includes a single chip microcontroller 12 that performs 16 bit arithmetic operations and includes internal instruction and data storage. The microcontroller 12 supports external devices 14 and 16 and, through 24 bit external address capability, can support sixteen megabytes of external instruction storage 18 and sixteen megabytes of external data storage 20. Although addresses of less than 24 bits, such as 20 bits as discussed below, can also be used. The microcontroller 12 includes a bus interface unit 22 which communicates with the external memories 18 and 20 over an external bi¬ directional address and data bus 24. Where a portion of the memory location address is presented to the memories 18 and 20 by an address latch 21. The microcontroller 12 communicates with the external devices 14 and 16 through I/O ports 26 - 28 which are addressable as special function registers (SFR) 40. The ports 26-28, as well as other special function registers, are addressable over an internal peripheral bus 42 through the bus interface unit 22. The data memory 20 can also be accessed as off-chip memory mapped I/O through the I/O ports 26 - 28. The on-chip special function registers 40, some of which are O 96/08768 PCMB95/00690 4 bit addressable, also include a program status word (PSW) register 44 coupled to an interruption control unit 84 communicating with the external devices as well as the ALU the execution unit 70 and decode unit 74 for flag and general control, an interrupt register 46, timer registers 50 and a system configuration register (SCR) 54 containing system configuration bits. The program status word register is addressable over the peripheral bus 42 for general register operations and is also addressable over a connection to the internal bus 86 for other execution related operations. The bus interface unit 22 isolates the peripheral special function registers 40 and the external memories 18 and 20 from the microcontroller core 60. The core 60 includes a microcode programmable execution unit 70 which controls execution of instructions by an ALU 72 and the other units. The instructions decoded by a decode unit 74 are fetched from an internal EPROM 76, which is part of the instruction memory space, or from the external instruction memory 18 by a fetch unit 78 using the program counter (PC). Static RAM 80, which is part of the data memory space, a well as general purpose registers of a register file 82 are also available for instruction and data storage. Addressing the external memory 18 or 20 is performed through the bus interface unit (BIU) 22 which, as illustrated in more detail in figure 2, receives a program counter (PC) value from the fetch unit 78 indicating the address of an instruction to be fetched. During operand data fetches the address presented to the BIU 22 is provided by the execution unit 70 instead of the fetch unit 78. The address presented by the execution unit 7 is the address of the data being fetched. The execution unit 70 also presents data read and write control signals indicating whether the transfer is a read or write. The operations described below for the instruction fetch operation apply to the operand read or write. The fetch unit 78, during an instruction fetch, also presents a signal that indicates that the transfe request is a nonsequential request (NS) and a signal that indicates that the transfer is a sequential request (SR) which means that the current address being presented is logically the next sequential memory address after the last address presented. The SR signal is presented while the sequential fetching of instructions is in progress and NS is presented whenever a branch in the instruction stream is encountered. During a nonsequential instruction fetch cycle the four lower order or least significant bits (LSB) of the address, bits 0-3 in the example of figure 2, are presented to the external memory 18 from the fetch unit 78 and the sixteen upper order or most significant bits (MSB), bits 4-19 in this example, are presented to a driver 200 which is activated by a state machine 202. The driver 200 presents the address bits to the external latch 21. In the next clock cycle the latch 21 is activated by the state machine 202 to store the MSB in the latch 21 and the MSB are substantially immediately presented to the memory 18. The state machine 202 then turns off the driver 200 and presents the enable signal to the memory 18. The memory 18 performs a read and presents the data (an instruction in this case) to the BIU 22 over the same lines or pins of the microcontroller as the MSB address bits were earlier presented. In the last clock cycle of the fetch cycle an instruction storage register 204 is activated to capture the data output by the memory 18 and to present it back to the fetch unit 78 if the data is an instruction or to present the data to the internal bus 86 if the data is an operand. Note that if the operation is a data write rather than a code fetch, a data register (not shown) would be provided for transferring data from the bus 86 to the memory 18/20 and would store the data being transferred. During an instruction fetch cycle in which a sequential fetch is performed the SR signal is presented to the BIU 22. In the first clock cycle the four LSB of the current address are examined by an OR gate 208 to determine if any of the bits are non-zero. If any of the bits are non-zero it indicates that an address increment carry has not been produced and the upper order bits of the address have not changed. If the upper order bits have not changed, the gate 208 produces a signal which means that an optimization of the fetch cycle is possible. The signal from the OR gate 208 is presented to an AND gate 210 which generates an optimization signal when the output from the gate 208 and the SR signal match. That is, when the fetch unit 78 indicates that a sequential address is being presented and the OR gate 208 indicates that the upper order address bits have not changed then the state machine 202 receives a signal indicating that the latch enable clock cycle can be skipped. The state machine in the next clock cycle proceeds to turn the driver 200 off and present the enable signal to the memory 18, thereby stopping the latch enable clock cycle. The last cycle as discussed above is then performed. The OR gate 208 in the circuit discussed above is used to detect whether the high order bits have changed during a sequence of incremental addresses. It is clear that an AND gate can be used to detect a change in high order bits during a decremental sequence. The circuit discussed above is one example of the present invention and an alternate embodiment is illustrated in figure 3. In this embodiment an AND gate 220, in the last clock cycle of the fetch instruction, produces a signal when all of the LSB of the address are " 1". This occurs in a sequential instruction fetch cycle just before the higher MSB of the address changes or are incremented. That is, if the LSB are binary " 1111" and the next instruction fetched is sequential, the MSB portion of the address is incremented for the next fetch and the address latching clock cycle must be performed in the next fetch. To save this nonsequential indication for the next instruction fetch cycle a flip-flop 222 is provided to store the indication. The FF 222 is clocked at the same time the register 204 captures the data transferred. In the first clock cycle of the next fetch the content of the FF 222 is inverted by inverter 224 and presented to the gate 210. The gate 210 produces the optimization signal as long as the SR signal is presented and the last instruction LSB are not all binary " 1". The many features and advantages of the invention are apparent from the detailed specification and, thus, it is intended by the appended claims to cover all such features and advantages of the invention which fall within the true spirit and scope of the invention. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the invention to the exact construction and operation illustrated and described. For example, it is possible to bring the latch 21 into the chip 12 and perform an upper order address comparison to determine whether the latch cycl for the upper order bits is necessary. It is also possible to incorporate a prefetch circuit, that performs prefetch address generation and instruction fetch initiation, into the present invention and further improved sequential fetch transfer speed. Accordingly all suitable modifications and equivalents may be resorted to, falling within the scope of the invention.

Claims: CLAIMS: 1. A data processing system comprising: - a microcontroller (10) having a bus interface unit (22); - a memory (18/20); - an address latch (21) coupled between the bus interface unit and the memory for enabling the microcontroller to supply a current address to the memory; characterized in that: -_ - the bus interface unit is operative to directly supply low order bits of the current address to the memory and to supply high order bits to the memory via the address latch. 2. The system of claim 1, wherein the bus interface unit comprises: - a detection circuit (208; 220) receiving the low order bits of the current address for determining if any of the high order bits of the current address have changed with regard to the high order bits of a preceding address in a logically sequential addressing mode of the microcontroller; - latch control means (200, 202, 210) coupled to the detection circuit for disabling updating of the latch if the detection circuit determines that no change has occurred. 3. The system of claim 2, wherein the detection circuit comprises: - a first logic gate (208) receiving the low order bits and supplying a first gate output signal determining whether or not the received low order bits all have a same specific logic value; - a second logic gate (210) receiving the first gate output signal and a further signal (SR) indicating that the microcontroller is in the sequential addressing mode and supplying a control signal to the latch control means. 4. The system of claim 3, wherein the first logic gate is an OR gate or an AND gate. 5. A microcontroller for use in the system of claim 1 , 2, 3 or 4.

Inventors: GOODHUE GREGORY, MIZRAHI-SHALOM ORI, OSTLER FARRELL, GOODHUE, GREGORY, MIZRAHI-SHALOM, ORI, OSTLER, FARRELL
Applicants: PHILIPS ELECTRONICS NV, PHILIPS NORDEN AB, PHILIPS ELECTRONICS N.V.
Application year: 1995
Main classification: G06F12
IPC codes: G06F9, G06F12, G06F13, G11C8