Emulation device for emulating a non-bond-out microcontroller amd microcontroller for use in such emulation device

Abstract: For use in emulation a non-bond-out microcontroller has in-microcontroller multiplexing means for multiplexing a port among user data and program store addresses. It has a multistate machine cycle with plural clock pulses per state. Various additionally provided emulation pins allow for outputting any or all of the following signals: a start-of-cycle pulse indicating non-sleep mode a state-wise recurrent signal signalling progress of said states during non-sleep mode a signal discriminating between idle and reset a multiplexed signalization among any or all of the following: that a next-following machine cycle is the first of a next instruction; that presently an interrupt is being processed; that an external program memory access is forthcoming; that an external data memory access occurs; that an external data memory write access occurs.

Description: The invention relates to an emulation device for emulating a non-bond-out-version of a microcontroller that has standard port means, said device comprising in-microcontroller multiplexing means for multiplexing said port means among user data and program store addresses and externally to said microcontroller, register means connected to said port means for latching said program store addresses and wherein said microcontroller has a machine cycle that comprises a plurality of states which each comprise at least two clock pulses. On one hand the transferring in multiplex version, of both program store adresses and user data, along a single port diminishes the quantitative requirements for many ports. Further, US patent 4,809,167 to Metalink Corporation discloses an extension of the general principle, in that a particular 8-bit wide port transfers successively an opcode, a program counter byte, and a user data item. Such an emulation device has been described in the reference in particular with respect to an Intel 8051 single chip microcomputer or microcontroller. The use of a non-bond-out-emulating microcontroller naturally obviates the need for developing a bond-out version for emulation and test use only. In earlier standard organization, the 8051 shares port P⊘ among program opcode and program counter low byte address, whereas port P2 outputs program counter high byte address. The recurrency of outputting a program address is twice per machine cycle. The referenced Metalink "hooks" improvement provides for, within each half of the machine cycle separately, multiplexing of program opcode, program counter address data, and port data, which was not possible with the original timing. The inventors of the present invention have experienced that emulation according to the reference was insufficiently accurate and/or insufficiently reliable, in particular, because nearly all external timing was to be reconstructed externally to the microcontroller from either one of the address latch enable signal and/or program store enable signal, and in certain derivative microcontroller that had no provision for outputting any of these enabling signals, even from the external crystal clock. Such reconstruction always suffers from non-conforming gate delays that may be subject to temperature-caused time skew and other deformity. Another cause of disstress that externally to the microcontroller, no discrimination was visible between two non-operating modes, to wit, between idle and reset. The referenced 8051 microcontroller, in addition, has also a power down mode, in which processing capability is brought down for reasons of energy conservation. SUMMARY TO THE INVENTION According to one of its objects the present invention provides means to have the microcontroller signal various internal, static or recurrent situations effectively to an output for so allowing more accurate synchronization between the microcontroller and external emulation circuitry. Inter alia, such improvement would also allow a higher maximum clock frequency for present or future realization. This and other objects are solved in advantageous manner basically by applying the features laid down in the independent claims. Further enhancements are provided by the subclaims. According to one of its objects, in consequence, the invention provides a microcontroller comprising first emulation control pin means for under internal oscillator control outputting in non-sleep mode of the microcontroller first-valued signal pulse (S1ES) straddling each start instant of any said machine cycle, and second emulation control pin means for under internal oscillator control outputting a recurrent active signal (PH1S) in each of said plurality of states while being inactive during sleep mode. Of course, the microcontroller is synchronized by an internal means, such as an electronic oscillator, or by external means, such as a crystal. In both cases, the synchronization is embodied in an internally available clock pulse series, which herein for brevity is referred to as an "internal oscillator". Now, the direct external signalization of the internal states of the microcontroller's clock cycle allows for tighter coupling to external emulation circuitry, that would better discriminate between correct operation and malfunctioning. Advantageously, said active high signal pulse has a duration substantially equal to one of said states, wherein said recurrent signal has a period of substantially one of said states, and said first valued signal pulses and recurrent signal being inactive during powerdown mode. This provides for easy external organization. Moreover, deriving of these external signals from internal clock pulse edges, is straightforward, such as by means of edge-triggered flipflops and a few gates only. Generally, in idle mode the internal clock signals have their standard recurrency pattern. According to a related object realization, the invention provides a microcontroller comprising emulation control means for outputting multiplexed emulation control signals, in discrimination of an active mode versus any of a powerdown mode, an idle mode, and a reset mode, to wit during at least one state inverval of said machine cycle (S4E), a first indicator signal (C1) for selectively indicating whether a next-following machine cycle is a first machine cycle of a next machine instruction. Whereas the earlier solution allowed for clear-cut synchronization within a single machine cycle, the latter provision allows for synchronization on an inter-machine cycle pipelining level. This allows the external evaluation mechanism to better know in which kind of operation the microcontroller presently is, and what kind of operation is to be expected next to occur. Various execution parts of the instruction are fetching, interpreting, accessing memory, evaluating of an outcome and determining on whether a conditional operation must or must not be effected. Also in this case, the improved synchronization allows for better timing relationships, and, as the case may be, for a higher attainable clock frequency. Given such emulation control pin means, various other indicator signals allow for using the latter pin means as signalling any or all of present execution of an interrupt request, a forthcoming external programming memory access, during a "move external instruction" an external data memory access, or an external data memory write access. All of these signals may, if need be, multiplexed over a single one pin. According to a still further related object solution, the invention provides an emulation device as recited supra, wherein said microcontroller comprises emulation control pin means for outputting a static binary signal whereof a first, state indicates whether the microcontroller is in any of idle, powerdown, or reset states, as being distinct from a second state on said emulation control pin means. Such signalization effectively boils down to a synchronization mechanism on a longer time scale which effectively may extend to infinity. The invention also relates to a non-bond-out-microcontroller for use in an emulation device as recited supra, and comparing selected ones or all of said recited advantageous features. Additional advantages as realized by such features are recited in further dependent Claims. BRIEF DESCRIPTION OF THE DRAWING The invention will be explained extenso, in relation with the appended Figures, which successively show a preferred embodiment, as follows: Figure 1 a generalized diagram of a so-called microcontroller probe; Figure 2 timing diagrams related to a standard 8051 microcontroller; Figure 3 timing diagrams realted to the so-called Metalink "hooks" specified otherwise in the cited reference; Figure 4 timing diagrams relating to the present invention; Figure 5 a pinning diagram of a non-bond-out-microcontroller according to the invention. DESCRIPTION OF PRIOR ART EMBODIMENTS Figure 1 is a generalized diagram of a so-called microcontroller probe. Block 20 represents the target system that is the object of the emulation process, and which has been designed to accommodate a standard copy of the microcontroller in question provided with an application on user program and which system furthermore comprises such hardware to fulfill the intended user function in cooperation with and/or under control from the application program. The emulation checks for the correct functioning of the above program in cooperation with the hardware. By way of example, the target system may be a telephone handset provided with certain intelligent user functionality. Inasmuch as the present invention is not directed to improvement of the target system itself, no further explanation is given for reasons of brevity. Next, blocks 22, 30, 32 are sub-systems of what is conventionally called an "emulator probe" and which interfaces the various partner devices in the emulation process. First, block 22 is the reconstruct block which provides access to those internal connections of the target system that its microcontroller should use. During emulation the specifically adapted 8051 microcontroller (or its derivative or an otherwise suitable controller) is in position as given by block 40, to execute the application program in lieu of the corresponding microcontroller that during normal use should form part of the target system but is absent therefrom during emulation. The positioning of microcontroller 40 is by a standard type microcontroller socket, cf. Figure 5. Now, in particular, block 22 reconstructs ports P⊘, P2 in subblocks 24, 26, respectively. The reconstruction is so, that the operation of microcontroller 40 remains undisturbed, with respect to signal transfer in either direction. In similar manner, emulation block 32 interfaces to standard SDS block 38 that is a standalone device of conventional build, such as Philips PM4726/10, PM4726/30 or OM4120 and has buffered outputs to block 38 for each of ports P⊘, P2, as indicated (34, 36, respectively). For reasons of brevity, block 38 is not detailed further. Emulation block 32 selects the information that SDS device 38 needs for addressing the emulation memory and for tracing the emulation microcontroller 40. It sends the instructions of the emulated program to microcontroller 40 and inserts the emulation break routines. On a level higher than the machine cycle of microcontroller 40, emulation is a standard art which is not being detailed further for reasons of brevity. Control block 30 interfaces to reconstruct block 22, to emulation block 32, to emulation microcontroller 40, to target system 20 and to SDS block 38. It handles the adjustments needed in the control signals, and also handles the enable signals for various blocks. Moreover, after a reset operation it sets microcontroller 40 in microprocessor mode. In the above, the interconnection shown is not on a wire by wire basis, but only symbolically. Moreover, the set up of the above is on a block level approximately identical to the emulation system of the citation. Figure 2 is a timing diagram related to a standard 8051 microcontroller. The top trace shows the six states S1..S6 of each machine cycle, each state with its first and second clock pulses. The clock is synchronized on a machine cycle level by an external crystal or by an internal electronic oscillator, and various internal and external control signals are derived therefrom. However, this synchronization is not very accurate due to internal gate delays. The next trace shows the address latch enable (ALE) signal that has recurrency of twice per machine cycle, and signals availability of an external address if high. The next trace shows program store enable signal (PSEN), which if low enables reading from an external program store which is in addition to a non-bond-out, internal program store of the microcontroller. The next trace shows the usage of port P⊘, which outputs a program address counter low byte (PCL), and, in the same half machine cycle allows for sampling an instruction information item that is presented from outside (DSMPL). In any half cycle both information transfer directions may occur. The last trace shows the usage of port P2 which in each half machine cycle allows for outputting a program address counter high byte. In this way, a sixteen bit address is available externally. Port P⊘ has a multiplex function among PCL out and data in. For the remainder, ports P⊘, P2 are lost. Figure 3 has timing diagrams related to the so-called Metalink "hooks" specified otherwise in the cited reference. These represent a favourable extension to Figure 2. First, the machine cycle, states and clock pulses show unchanged with respect to Figure 2. Next trace shows the delayed address latch enable signal DALE that has its rear edge delayed by one half state, so its activity interval (high) covers both the standard state S2 and S2E, which corresponds to state S2 but is advanced half one state length. In the same way, program store enable signal DPSEN has had its rear edge delayed by one half state interval to cover all of the advanced states S2E, S3E. Under combined control of signals DALE and DPSEN, ports P⊘, P2 are now multiplexed among a whole set of signals, as shown: P⊘ has in state S1E opcode in (from the emulation control); in state S2E outputting of an 8-bit special function register SFR, which is the internal P⊘ latch; in state S3E, PCL (Program Counter Low byte) is outputted, which is advanced by one half state length with respect to Figure 2. State S4E corresponds to state S1E (E for Early), and allows for feeding the instruction opcode into the microcontroller. State S5E allows for inputting of information into the microcontroller of information present in an externally reconstructed/latched register to the P⊘ port pins. State S6E corresponds to state S3E. In consequence, the bidirectional transfer of data in state S2E/S5E is an extra to Figure 2 which sees that port P⊘ remains accessible. As to port P2, also a multiplex function is realized. First states S3E/S6E have PCH out in synchronism with port P⊘. Second, states S2E/S5E correspond to the functionality with respect to port P⊘, to wit outputting of the special function register SFR in state S2E and inputting from the externally reconstructed register in state S5E. Third, states S1E/S4E have availability of PCH. This longer availability feature obviates the need for externally latching of this byte. Generally, the sixteen bit address allows for a 16k address space. DESCRIPTION OF A PREFERRED EMBODIMENT ACCORDING TO THE PRESENT INVENTION Figure 4 gives a timing diagram of a machine cycle according to the present invention and Fig. 5 is a pinning diagram of a non-bond-out microcontroller according to the present invention. Regarding to the latter, in a 4x11 square configuration, the following standard pins occur: eight bit port P0 (P⊘.0..P⊘.7); eight bit port P1 (P1.0..P1.7); eigth bit port P2 (P2.0..P2.7); eight bit port P3(P3.0..P3.7); VDD; RST (reset); XTAL1; XTAL2 for attaching to an external crystal; VSS; PSEN ; ALE; EA . Furthermore the various pins of port P3 all double for communicating respective control signals, to wit RXD/Data, TXD/Clock, INT0, INT1, T0, T1, WR, RD. For further information on these standard pins, reference is had to the commercial documentation. A similar packaging is as 40-pin DIL, but the latter does not have the four unused pins n.c., that are utilized according to the invention. Extension to a 44-pin DIL is quite feasible however. In particular, the following emulation control signals are suitable for use with the Metalink hooks according to the reference, so the earlier extensions to the standard 8051 architecture remain in use. Alternatively, all or part of the provisions, infra, would be usefull in combination with various other emulatable microcontroller architectures. Now, the particular emulation control or signalization provisions are as follows: 1. S1ES, this pin is active low during machines states S2E through S6E, and high during machine state S1E that straddles the beginning of a standard machine cycle at the start of machine state S1, as long as the internal oscillator of the microcontroller is running as being either self-synchronized or synchronized by an external crystal, otherwise this pin being high continuously. The active interval is during machine cycle states S2E through S6E, for so signalling the sleep mode. Changeover between sleep mode, i.e. power down, and non-sleep mode can occur at instants that are spaced from each other by twelve oscillator periods, or clock pulses, notably at the end of state S1E. The relatively brief period of S1ES being high allows for good synchronization. During power down mode nothing happens so synchronization would not be crucial then. 2. PH1S, this pin signals the sleep mode. As shown, it is active low during all P2 clock pulse periods of all machine states, as long as the oscillator is running. It is continuously high when the oscillator is not running, and high anyway, during all P1 clock pulse periods of any machine state. Note that only in power down or sleep mode the internal oscillator is stopped. Otherwise, the oscillator keeps running at standard speed. 3. IDLPD is a static signal that is active high when the microcontroller is in either one of idle, powerdown, or reset modes. In each of these three modes the standard processing capability is not maintained, either because certain subsystems of the microcontroller are blocked from receiving cyclic activation by the internal clock pulses, for example during those intervals in which these subsystems should consume only minimal power, or are kept stationary by a specific signal, such as the reset. By itself, these three operating modes are standard. The signal IDLPD may be produced by a conventional OR of the control signals which internally to the microcontroller control these various modes. 4. EMUMPX, this a multiplexed emulation output used by the emulation logic for detecting various internal occurrences or events, that are as follows. Inasmuch as these occurrences are generally only relevant in particular machine states, they can be multiplexed according to the diagram of Figure 6, wherein in the following applies. Generally, there are three principal situations. In the first of these, IDLPD is low, signalling that the microcontroller is not in either of the modes wherein the processing is -temporarily- held back. Now, in these situations, the sequence A may occur during the first machine cycle of the execution of a move external instruction. Herein, early machine states S1E...S6E have the following signals. During state S1E, signal INTACK indicates that an interrupt request is being processed. This means, that the next machine cycle will be the first machine cycle of a forced LCALL (long call) instruction, from the standard instruction set, which long call allows for accessing a 0...64 kbyte address range. If no interrupt request is presently being processed, during S1E this signal is not active. The shape of an active signal versus a passive signal is generally a pulse having a length of the complete machine cycle, that is two clock pulses. However, if convenient, an other signal pattern may be adopted. During state S2E, signal PRGEXT indicates whether an upcoming external (target) program memory access will occur. The internal program memory has 16-bit addresses. This internal memory may be supplemented by an external program memory up to the same address range. During state S3E, this emulation output is continuously low. During state S4E, signal C1 indicates that the present machine cycle is the last cycle of an instruction so that the next cycle by necessity will the first cycle of a next machine instruction. During state S5E, signal MOVEXT indicates that a move external instruction is executed with an address greater than 255, which address would consequently not fit within a single address byte. Also this signalization would be useful to external emulation. During state S6E, signal WREXT indicates the occurrence of a MOVEXT instruction which causes a write access to the external data memory and having data pointer value greater than 255. With respect to these two signalizations during S5E, S6E the same register (DTPR register) would apply, whereas during both machine cycle states, an active signal could be present. So, as it were, the first 256 locations of external data memory are mapped inside. In the described sequence A, either of cases MOVEXT, WREXT may occur as explained supra. Sequence B, which slightly differs from sequence A is followed if neither of cases MOVEXT, WREXT occurs. The differences occur during only states S5E/S6E. During state S5E, the same signal may occur as during earlier state S2E, which allows frequent program memory access. During state S6E, the emulation signalization is low. Due to (standard) internal propagation delays, the signals INTACK, PRGEXT and MOVEXT are internally to the microcontroller available only a certain time after the start of their respective clock pulses PH2, which is the second clock pulses of the standard machine states and, in consequence, the first clock pulse of the "early" machine states used throughout in the above. In consequence, at the beginning of the corresponding early machine states there may exist invalid data on the multiplexed pin EMUMPX. However, at least during the next-following clock pulse PH1, the information will be valid. In Figure 6, sequences A, B relate to active mode. In addition to earlier features, signal C indicates the signalization of a fourth emulation control pin. The latter pin is used for outputting a signal discriminating between idle mode and reset mode. Note that existence of power down mode is already signalled otherwise as disclosed earlier. The signalization, according to sequence C may be a continous high signal, for idle, and continous low, for reset, or reversely. Other signal shapes could be applicable as well. Now, the four emulation control pins, so described, in the set-up of Figure 1, go to evaluation device 38, which as based on the respective situation, signals necessary indication to a human user in visual display or hardcopy. Further logging and other operations may apply. As such signal treatment in the art of emulation is generally known, no detailed disclosure is given for reasons of brevity.

Claims: An emulation device for emulating a non-bond-out version of a microcontroller that has standard port means, said device comprising in-microcontroller multiplexing means for multiplexing said port means among user data and program store addresses and externally to said microcontroller, register means connected to said port means for latching said program store addresses and wherein said microcontroller, has a machine cycle that comprises a plurality of states which each comprises at least two clock pulses, said microcontroller comprising first emulation control pin means for under internal oscillator control outputting in non-sleep mode of the microcontroller first-valued signal pulses (S1ES) straddling each start instant of any said machine cycle, and second emulation control pin means for under internal oscillator control outputting a recurrent active signal (PH1S) in each of said plurality of states while being inactive during sleep mode. An emulation device as claimed in Claim 1 wherein said first valued signal pulses have a duration substantially equal to one of said states, wherein said recurrent signal has a period of substantially one of said states, and said first valued signal pulses and recurrent signal being inactive during powerdown mode. An emulation device for emulating a non-bond-out version of a microcontroller that has standard port means, said device comprising in-microcontroller multiplexing means for multiplexing said port means among user data and program store addresses and externally to said microcontroller, register means connected to said port means for latching said program store addresses and wherein said microcontroller has a machine cycle that comprises a plurality of states which each comprise at least two clock pulses, said microcontroller comprising emulation control pin means for outputting multiplexed emulation control signals, in discrimination of an active mode versus any of a powerdown mode, an idle mode, and a reset mode, to wit during at least one state inverval of said machine cycle (S4E), a first indicator signal (C1) for selectively indicating whether a next-following machine cycle is a first machine cycle of a next machine instruction. An emulation device as in Claim 3, wherein said emulation control pin means furthermore allow during a first state interval of any machine cycle (S1E) outputting a second indicator signal indicating whether presently an interrupt request is being processed by said microcontroller. An emulation device as claimed in Claim 3 or 4, wherein said emulation control pin means furthermore allow during at least one of a second (S2E) and a fifth interval (S5E) state of any machine cycle outputting a third indicator signal (PRGEXT) indicating a forthcoming external program memory access. An emulation device as claimed in Claim 3, 4 or 5, wherein said emulation control pin means furthermore allow during a said second half of said machine cycle and after said first indicator signal during a move external instruction outputting a fourth indicator signal interval (S5E) indicating an external data memory access (MOVEXT). An emulation device as claimed in Claim 6, wherein said fourth indicator signal occurs during a fifth state interval of any machine cycle. An emulation device as claimed in Claim 6 or 7, wherein said emulation control pin means furthermore allow during said second half and after said fourth indicator signal (S6E) outputting a fifth indicator signal indicating an external data memory write access. An emulation device for emulating a non-bond-out version of microcontroller that has standard port means, said device comprising in-microcontroller multiplexing means for multiplexing said port means among user data and program store addresses and externally to said microcontroller, register means connected to said port means for latching said program store addresses, and wherein said microcontroller has machine cycle that comprises a plurality of clock cycles which each comprise at least two clock pulses, wherein said microcontroller comprises emulation control pin means for outputting a static binary signal whereof a first state indicates whether the microcontroller is in any of idle, power down, or reset modes, as being distinct from a second state on said fourth pin means. A non-bond-out microcontroller for use in an emulation device for emulating a user program, said microcontroller having standard port means, multiplexing means for multiplexing said port means among user data and program store addresses and machine cycle control means for generating a multistate machine cycle which has two clock pulses per state, and having first emulation control pin means for under control of said machine cycle control means outputting a signal pulse straddling any start instant of said machine cycle at a duration of substantial equality to the length of any said states. A microcontroller according to Claim 10, having second emulation control pin means for under control of said machine cycle control means in each of said states outputting a recurrent active high signal at a recurrency equal to the length of said states while being inactive during power down mode. A microcontroller as claimed in Claim 10 or 11, and having furthermore third emulation control pin means for outputting multiplexed emulation control signals in active mode in discrimination from any other mode, to wit during at least one state interval of said machine cycle a first indicator signal indicating whether or not a next-following machine cycle is a first machine cycle of a next machine instruction. A microcontroller as claimed in Claim 12, wherein said third emulation control pin means furthermore allow during a first state interval of any machine cycle outputting a second indicator signal indicating whether presently an interrupt request is being processed by the microcontroller and during at least one of a second and a fifth state interval of any machine cycle outputting a third indicator signal indicating a forthcoming external program memory access. A microcontroller as claimed in Claim 12 or 13, wherein said third emulation control pin means alternatively allow during said fifth state during a move external instruction outputting a fourth indicator signal indicating an external data memory access. A microcontroller as claimed in Claim 12, 13 or 14, wherein said third emulation control pin means allow during a sixth state of any machine cycle outputting a fifth indicator signal indicating an external data memory write access. A microcontroller in any of Claims 12 to 15, wherein any indicator signal is statewise synchronized with said active high signal straddling said start instant.

Inventors: BAKKER JACOBUS MARIA, HAGEDORN DIETER, BAKKER, JACOBUS MARIA, HAGEDORN, DIETER
Applicants: PHILIPS ELECTRONICS NV, PHILIPS ELECTRONICS N.V.
Application year: 1991
Main classification: G06F11
IPC codes: G06F11, G06F15