Using research of built-in internal storage of one piece of the Model OTPROM
With the development of speed regulation by frequency variation and computer control technique, Intel 8XC196MC series one-chip computer adapting to electric machine control employs more and more extensive. Compared with 80C196MC, 87C196MC one-chip computer has OTPROM (One Tline Programmable Read-Only Memory) of 16 KB ,Can go on on-chip the intersection of programming and operation, can strengthen cryptographic function. To ordinary control system, its memory capacity is enough large, needn't reuse the external expanded memory " >Memorizer. But OTPROM of 87C196MC one-chip computer has a shortcoming: No EPROM, that is to say that can only programme once, can't realize repeated programming, unfavorable to a large amount of popularization use. When the procedure transplants from the simulator to OTPROM of the one-chip computer, can not guarantee success of the procedure, because of the intersection of EPROM and of one-chip computer, if procedure off-lining to use one one-chip computer once, will obviously cause the huge wasteful use of resources. On the other hand, as to the complex system, if OTPROM capacity of 16KB is not enough, need adopting and expanding the external memory storage " >Memorizer, for guarantee, realize cryptographic function effectively, should it keeps some procedure to be here OTPROM on-chip, it is built-in to involve the one piece at this moment, the external memory " >Connecting the question of the memorizer. This text directs against Intel 87C196MC one-chip computer internal storage " >The intersection of EPROM and of memorizer, provide for using the question under two kinds of situations, can realize repeated method of programming effectively, and can popularize in any other application of programming with one-chip computer series of OTPROM. 1 87C196MC one-chip computer internal storage " >The memorizer programming way Intel 87C196MC one-chip computer supports three kinds of programming ways: The automated programing way (make 87C196MC one-chip computer not use EPROM programmer can be from the outside EPROM to one's own programming) , slave programming way (provided a standard interface for outside EPROM programmer) Real-time the intersection of programming and way (the intersection of programming and way run, can when it is real to make in software control to single the intersection of EPROM and Entrance programming) . Different from other ways, real-time programming can be finished under not entering the whole EPROM programming way. Can only programme OTPROM of Intel 87C196MC one-chip computer, can't erase, but can prove during programming whether have already really programmed. Can adopt 2 kinds of programming methods to 0TPROM: Programme in slave programming way or in the specialized OTPROM programming way. OTPROM has offered the auxiliary memorizer for 87C196MC one-chip computer " >Memory protection means, it can forbid the bus control unit to carry out the outside to fetch and mean cycle, if attempt to load a outside address to PC register, the chip will be reset. The code flying to running of such automatic reset function is offered a kind of extra recovery means too. Should take different programming ways according to the needs of reality while using. 2 87C196MC one-chip computer internal storage " >EA pin (outside visits and allows the end of one-chip computer 87C196MC of repeated programming method of the memorizer, 87C196MC PLCC84-36 foot) Used for controlling and visiting the internal storage " >The memorizer or external memory storage " >Memorizer. Act as EA =O hour, all visits are to one slice of external memories " >The memorizer one; Act as EA =1 o'clock, to 2000H- being to OTPROM/ ROM on-chip in visit of unit in 5FFFH. Under programming way, EA =12. 5 V. Because the level of EA is latched while resetting, it is difficult to realize the choice of the space of procedure by circuit of the external hardware. Control the program address range by employing the routine statement here, it is equivalent to the function of level fluctuation of EA. This text main long the intersection of jump instruction and UMP of assembler language, Intel of application, come realize control visit, external memory " >The function of the memorizer, now introduce two kinds of commonly used methods. 2.1 the intersection of programming and the intersection of operating method and so-called the intersection of 87C196MC and the intersection of one-chip computer and the intersection of EPROM and of OTPROM on-chip, can't realize from " the 0 " actually To " 1 " Programming,and can only finish from "1 " Get to " O " Programming. Introduce this kind of method by simple procedure embodiment as follows. LJMP NEXTl CSEG AT2600H NEXTl: What the above-mentioned sentence represented in fact is LJMP2600H. Its machine code is E79C04, when changing in address 2600H, gets a series of correspondent machine code, through analyzing to these a series of machine code, can receive the principle of this method, set out in Table 1. The representatives of the last one bytes of the machine code E79C04 collect the address (04 has represented 2600H in the routine statement, 14 has represented 3600H . Act as one byte until 4 all " 1" It is all " O " to turn into 4 ,And there is only one " l " each time Turn into " 0 " When, there can be many kinds of different constitutional reform, are set out in Table 2. Because 87C196MC one-chip computer OTPROM can only finish from " 1" Get to " O " Programming,begin to carry out the and 87C196MC one-chip computer one procedure since 2000H, be can skip after the procedure carries out a sub-paragraph from 2000H, for example jump to 4100H (correspondent machine code is E79C1F) at first Other parts of the memory program again. While leaving nonrecoverably, change the machine code E79C1F into E79C1E (correspond to the address is 4000H) ,The procedure jumps to 4000H to begin to carry out, 4100H program segment for the future no longer carried out. While leaving again nonrecoverably, change the machine code E79C1E into E79C1c (correspond to the address is 3A00H) ,The procedure jumps to 3A00H to begin to carry out, 4000H program segment for the future no longer carried out, so as to analogize (namely the final one byte of the machine code is varied to F E C, first groups of changes) while corresponding to Table 2 ,Can reuse the same one-chip computer and carry on numerous programming operation. In this kind of method, the pin EA of the one-chip computer 87C196MC connects the high level. It is suitable for the procedure being brief and has not expanded the external memory storage " >The memorizer, there are only internal storages " >Usable situation of the memorizer. 2. If the internal storage of operating method that 2 is programmed on-chip, outside " >Memory capacity is not enough or because other respects need, demand to expand the external memory storage " >At the memorizer, certainly can choose the intersection of capacity and loud external memory storage " >The memorizer, and does not use the internal storage " >The memorizer, but in this case, the confidentiality of the procedure will be difficult to realize, and waste the memorizer within the one-chip computer " >Storage space. The method to accord with while using can already meet the capacity demand, the realization ciphering operation that the fork can be convenient. In view of begin, carry out from 2000H by the intersection of 87C196MC and procedure of one-chip computer, pin of 87C196MC beautiful to put " 1 " one-chip computer ,Then the one-chip computer procedure will begin to carry out from internal 2000H. Can be after the procedure carries out a sub-paragraph from 2000H (presume arbitrarily according to the needs of reality) Skip, here is different from operation of skipping on-chip, it will jump out one-chip computer 87C196MC 2000H of OTPROM on-chip the range of unit 5FFFH directly. Will change over to the external memory storage automatically at the time of execution as ordering " >In the address range of the memorizer, for example: LJMP8000H, among them 8000H is the external memory storage " >The address in of the memorizer, in this way from one slice of internal memories " >The memorizer is changed over to the external memory storage " >Memorizer. Can pass and revise the external memory storage " >Memorizer (can wipe writing repeatedly) Procedure last procedure debugging,convenient very. Certainly, if need it from the external memory storage " >The memorizer is changed over to the internal storage " >Memorizer hour, the operating method is similar. The detailed analysis of this text has introduced two kinds of operation method of one-chip computer that can realize repeatable programming to conclude the speech, and these two kinds of methods can be popularized to any other programming of one-chip computer with 0TPROM, the thinking of programming is all the same, the concrete experiment has verified these two kinds of methods have practical feasibility.










