A METHOD FOR EMULATING A NON-BOND-OUT VERSION OF A MICROCONTROLLER THAT HAS STANDARD PORT MEANS, A MICROCONTROLLER ALLOWING SUCH EMULATING, AND A SYSTEM FOR EXECUTING THE EMULATION

Abstract: For emulating a non-bond-out version of a microcontroller, a standard port is multiplexed amongst user data and program store addresses. An external register is connected to the port for therein latching program store addresses. The microcontroller is synchronized according to a machine cycle that has a plurality of states which each comprise at least two clock pulses. In particular, the port is used for outputting mutually exclusive parts of a single program store address in contiguous sections of a single machine state for external parallel evaluation.

Description: A method for emulating a non-bond-out version of a microcontroller that has standard port means, a microcontroller allowing such emulating, and a system for executing the emulation. BACKGROUND OF THE INVENTION The invention relates to a method according to the preamble of Claim 1 , which method has been disclosed in US Patent 5,574,852 (PHN 13562) to the present assignee. At present, the in-circuit emulation of many microcontrollers, such as, but not being limited, to use with the well-known 80C51 microcontroller, requires the presence of at least two 8-bit IO-ports. One port, usually port PO, is then used as a multiplexed 8 bit low address/data bus, whereas the another one, normally port P2, provides the high bits of the 16 bit address space. Since both of these ports therewith will have lost their standard IO-facility, this IO facility must be reconstructed externally from the chip. The data that is necessary for the PO, P2 reconstruction is then supplied in multiplexed fashion via the PO, P2 lines. This needs to be done only in emulation mode, because in normal mode the port lines operate in a manner that has been defined specifically for the microcontroller in question. Further, restricting the operation to 8-bit memory addresses would be out of the question. For many microcontroller applications that need only limited IO, the cost of two ports has been found excessive. SUMMARY TO THE INVENTION In consequence, amongst other things, it is an object of the present invention to provide facilities to allow emulation of a microcontroller that has a program memory space which needs more address bits than according to the width of the parallel port. Now therefore, according to one of its aspects the invention is characterized by the characterizing part of Claim 1. Advantageously, the method uses said port means according to the wordings of Claim 2. This external synchronization facility has proven to be reliable, whilst surmounting the prejudice leading to universal usage of a synchronizing crystal. The invention also relates to a microcontroller allowing such emulation, and to an emulation system arranged for executing the method according to the invention. Further advantageous aspects of the invention are recited in dependent Claims. BRIEF DESCRIPTION OF THE DRAWING These and further aspects and advantages of the invention will be discussed more in detail hereinafter with reference to the disclosure of preferred embodiments, and in particular with reference to the appended Figures that show: Figure 1, a microcontroller emulation setup; Figure 2, a pin configuration of an exemplary microcontroller; Figure 3, a timing diagram for the emulation operation. DETAILED DESCRIPTION OF PREFERRED 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 or user program and which system furthermore comprises such hardware to fulfil the intended user function in cooperation with and/or under control from the application program. The object of the emulation is to check 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 microcontroller (or its derivative or an otherwise suitable controller) is in position as indicated 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. Now, in particular, block 22 reconstructs port P0 in subblock 24. 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 a standard, emulator system 38 that has address and data buses connected to block 32, which are derived from port P0, as indicated by blocks 34, 36, respectively. For reasons of brevity, block 38 is not detailed further. Emulation block 32 selects the information that emulator 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 emulator 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 emulation mode. In the above, the interconnection shown is not on a wire by wire basis, but only symbolically. More information on the setup of the above may be derived from the emulation system of the reference. Figure 2 is a pin configuration of an exemplary microcontroller 50, in particular one that has a low pin count. In the preferred embodiment of an 80C51 derivative, only 14 pins are present. In practice, the invention is in particular applicable to a microcontroller that has a relatively large program memory combined with only a single parallel port, possibly in addition only one or more serial ports. Nevertheless, in principle the invention might also be useful if two parallel ports are present. In general, the invention envisages to minimize the overall pin count. In the embodiment shown, item 52 is the first crystal pin and 54 the second crystal pin, which pins usually get a bridging clock crystal thereacross. Further, pin 56 is a RESET pin, 58 a VDD pin, 60 a VSS pin, 62 an 8-bit parallel port, and 64 an interrupt pin. The above in fact is a minimal configuration that may be enhanced with one or more further control and/or power pins; the number of control pins could then be three or four, and the skilled art practitioner would know how to choose an advantageous configuration if the overall pin count should be restricted to 16, 18, or 20 pins, taking into account an intended field of application, versatility level, and cost. The interfacing of a microcontroller like the one shown in Figure 2 to external circuitry can be effected according to well-known principles, whilst taking into account the particularities of the present invention, that will become obvious from ascertaining the present patent application hereinafter and the general state of the art of emulation. Since often at least 64 kBytes of read-only program memory are needed, a 16-bit address must be provided. According to previous technology, for low pin-count microcontrollers, in particular those that have only a single parallel IO port, an additional parallel port should then be added exclusively for emulation purposes. Moreover, often such microcontrollers are not able to signal the internal timing of the microcontroller: there is no Address Latch Enable ALE, no Program Store Enable PSEN, no state timing information. no OPCODE fetch signal, and no interrupt acknowledge output. In such case, the timing synchronization is usually based only on the external crystal clock XTAL in combination with a single synchronization instant via the RESET input. This may cause problems, in particular because newer IC technologies tend to have higher clock rates. The following multiplexing scheme according to the invention for low pin count microcontrollers solves the above problems. It is based on outputting both the 16 bit address and the 8 bit code byte via a single 8 bit port; this new multiplexing scheme may also provide rigid timing and control information for the externally attached emulation system through using the same single port. Figure 3 is a timing diagram for the emulation multiplexing operation for low pin-count microcontrollers, such as have been described supra. In the Figure, CODE indicates the input of an instruction code byte, SFRPO out indicates outputting of the content of the PO internal SFR latch, SFRPO in indicates inputting of the reconstructed PO input data, AL indicates outputting of the lower half of the Program counter, AH indicates outputting of the upper half of the Program counter, CNTL1 indicates an interval for allowing the output of various signals Opcode Fetch Cl, Interrupt Acknowledge INTACK, IDLE, Power Down PD, as well as the inputting of Interrupt Disable/Emulation Halt signal INTD, all of which signals getting their reserved pin in the port PO. CNTL2 indicates an interval for allowing the output of further signals or data, such as the content of an Interrupt in Progress Register or an Accumulator. Again, all of these signals get their reserved pin. The microcontroller does not have external data memory, nor program memory access, and in consequence, no ALE, PSEN, RDN, or VVRN pins are available. Initially, the microcontroller is set to emulation mode through applying a predetermined ten- bit control code to the reset pin. By itself, this way of applying a control code is known in the art. Now, in emulation mode, the input XTALl receives a clock input signal, instead of the free-running clock that is provided in normal operating conditions by the crystal that bridges XTALl and XTAL2. As a first measure according to the invention, the emulation mode provides an external synchronization output signal from pin XTAL2. This particular signal is active during the clock phase S1EP2, which in the embodiment of Figure 3 occurs every twelfth clock period on XTALl, and allows external reconstruction of all state-timing and also of all early state-timing signals. Outputting of the Address Low via the port occurs during first clock of state S2 (indicated by AL). Outputting of the Address High via the port occurs during the second clock of state S2 (indicated by AH). The inputting of the program memory code byte occurs during the first clock of state S4. Addressing of the next following byte occurs during S5 (first clock: AL output, second clock: AH output). Inputting of the addressed program memory byte is done in the first clock period of SI. For external reconstruction of the port, the internal port latch information is output during the second clock of SI, indicated by SFRPO out , the external port input data is read into the processor during second clock of S4, indicated by SFRPO in. The CNTL1 data in/out the processor is an 8 bit data word, through which the following control information is output to the external emulator logic during the first clock of S3 and S6. The bits of CNTL1 during this moment have the following meaning: - Cl ouφut; one bit cycle 1 indication. Bit 0 is used for this. It is set to T by the processor when the next following code fetch is an opcode fetch - Interrupt Acknowledge: Is set to T when the processor executes the internal CALL vector operation upon an interrupt. Bit 1 is used for this. - INTD in: INTD input. When activated by external hardware, the processor stops timers, watch dog timer, and also inhibits interrupts. Bit 2 is used for this. - IDLE ouφut: Is set to T when the processor enters the IDLE power saving mode. Bit 3 is used for this. - Power down ouφut: Is set to ' 1 ' when the processor enters the Power Down energy saving mode. Bit 4 is used for this. - The remaining 3 bits are free to be used for ouφutting any other (real-time) information out of the processor. The CNTL2 data in/out moment is used to transfer important processor data. This may be e.g. the Interrupt in Progress register, but can be also another register e.g. the accumulator. The described emulation multiplexing organization has the following advantages compared to current multiplexing schemes: - Uses only one 8 bit IO port instead of two IO ports - Program memory access time is about 2.5 clock period, which is between the so-called Standard Hooks and Enhanced Hooks emulation schemes access times. For non-emulation timing this is about three clocks - Internal timing information is available at no pin cost - Internal control information available at no pin cost - Internal register information available at no pin cost Particular aspects are that this is again another multiplexing scheme, and that it requires fast external logic, because time slots are now only a single clock period each, instead of two successive clock periods.

Claims: CLAIMS: 1. A method for emulating a non-bond-out version of a microcontroller that has standard port means, whilst using in-microcontroller multiplexing means for multiplexing said port means amongst user data and program store addresses, and furthermore using externally to said microcontroller a register means connected to said port means for latching therein said program store addresses, and synchronizing said microcontroller according to a machine cycle that has a plurality of states which each comprise at least two clock pulses, characterized by furthermore using said port means for ouφutting mutually exclusive parts of a single program store address in contiguous sections of a single machine state for external evaluation of the address in parallel. 2. A method as claimed in Claim 1 , whilst furthermore using a first synchronizing-crystal pin of the microcontroller as synchronizer drive input, and using a second synchronizing crystal pin of the microcontroller as an external synchronization signal ouφut, and reconstructing externally to the microcontroller all necessary state-timing signals. 3. A method as claimed in Claim 1 , whilst using a further machine state for communicating selective control signals through said port means. 4. A method as claimed in Claim 3, whilst dividing said further machine state into respective sections for in each such section communicating respective different control signals. 5. A method as claimed in Claim 3, whilst using at least one section of said further machine state for one or more control signals in either direction. 6. A method as claimed in Claim 1 , whilst furthermore repeating a like- formatted sub-cycle within each such cycle at least twice, and wherein two correspondingly positioned sections of respective sub-cycles within a particular cycle are used for communication port latch data in mutually opposite directions. 7. A method as claimed in Claim 1 , whilst further reconstructing externally to the microcontroller all necessary early state-timing signals. 8. An emulation system for executing a method as claimed in Claim 1. 9. A microcontroller being arranged for allowing to undergo a method as claimed in Claims 1.

Inventors: BAKKER JACOBUS MARIA, BAKKER, JACOBUS, MARIA
Applicants: KONINKL PHILIPS ELECTRONICS NV, PHILIPS SVENSKA AB, KONINKLIJKE PHILIPS ELECTRONICS N.V., PHILIPS AB
Application year: 1998
Main classification: G06F
IPC codes: G06F11