METHOD AND APPARATUS FOR CONTROLLING WRITING TO MEMORY

Abstract: The invention relates to a method and apparatus for controlling writing to a memory. The apparatus comprises control means (1-8) for the formation of a memory activation signal (C &cir& NOt E &cir& NOt ) in response to the applying of a predetermined key code to the control means, the control means comprising timer means (2) which are started by applying the key code and which prevent the formation of the memory activation signal (C &cir& NOt E &cir& NOt ) when a predetermined time has elapsed from the applying of the key code. In order to speed up the writing of long data blocks into a memory, the invention is characterized in that the control means further comprise means (3, 5, 6) for restarting the time means (2) within a predetermined time interval from the applying of the key code or the previous memory write operation as a result of a performed memory write operation.

Description: Method and apparatus for controlling writing to memory The invention relates to a method for control¬ ling writing to a memory, in which method a memory write operation is permitted only within a predetermined time interval from the writing of a predetermined key code to a predetermined memory location. Random-access memory (RAM) is a semiconductor memory to which information can be rapidly stored, wherefore RAM is used in microcomputers when rapid storing or reading of information is required. On the other hand, it is also characteristic of RAM that the information written into it is erased when supply voltage is shut off. However, the types of RAM that require only a little power to store information can be used to store information even during a power failure if they are provided with a standby power supply, e.g. a battery or an accumulator. In a slot machine RAM can be used, for example, for storing information on money and failures. This information is important for the operation of the whole machine, since without reliable information the opera¬ tion of the machine can stop. The same information can be stored simultaneously in several different memory circuits so that when a failure occurs, the operation can be continued with proper information. When several memory circuits are used, the likelihood that the same information would be erroneously treated reduces if an interrupted writing operation is considered to have caused the error. In a known solution, unintentional alteration of RAM contents is prevented by keeping one of the signals controlling the memory write operation in a state preventing writing to a memory. In this known solution, a so-called chip enable signal CE is used for this purpose in such a manner that the CE signal can be activated only by such memory write sequences addressed to RAM that are written within a fixed interval of time from the writing of a key code word to a memory location outside the RAM storage space. Thus, the likelihood that the right code word is inadvertently given to the right memory location and erroneous writing to RAM takes place is extremely small. When the information is secured by copying the memory contents to another memory circuit, functioning as a so-called backup memory, the copying rate is of great significance: the supply voltage of the apparatus may be shut off any time, and the copying may be left uncompleted. However, the faster the copying can be per- formed, the smaller is the likelihood that the copying would be left uncompleted and fail. The object of the present invention is to provide a memory control enabling more rapid writing to a memory. This object is achieved by a method of the type described in the introductory portion, said method being characterized in that after a successful memory write operation following the writing of each key code, a new memory write operation is permitted within a predeter- mined time interval from the previous one without re¬ writing of the key code. In the invention, a property which enables a new write operation is connected with the giving of a key code: after each successful write operation to RAM, memory protection permits a new write operation without a new key code within a fixed time interval. In other words, if the first write operation is correctly per¬ formed, the following write operation can be performed without separate opening of the time window by a key code. Time control is, however, maintained in the inven- tion. Due to the invention, a long data block can be written to RAM as rapidly as the apparatus controlling the memory can - provided, however, that there is not too long a pause between the write operations - without the time consuming operation of giving the key code in connection with each write operation. A further object of the invention is an apparatus for controlling writing to a memory, compris¬ ing control means for forming a memory activation signal in response to the applying of a predetermined key code to the control means, the control means comprising timer means which are started by applying the key code and which prevent the formation of the memory activation signal when a predetermined time has elapsed since the applying of the key code. The apparatus is characterized in that the control means further comprise means for restarting the timer means within a predetermined time interval from the applying of the key code or the previous memory write operation as a result of a performed memory write operation. Still another object of the invention is the use of the apparatus according to the invention in a slot machine for copying cash and operation data from one memory to another for backup storage of the data. In the following the invention will be described, by way of example, in greater detail by means of an embodiment with reference to the attached drawing. The figure shows an embodiment of the inven¬ tion, which generates one of the signals, in this case a chip enable signal CE. The signal CE can control a memory formed by one or several memory circuits. The circuitry shown in the figure generates the chip enable signal CE for both read and write opera¬ tions. Information can be read without restrictions from a semiconductor RAM: when the storage space con¬ trolled by the circuitry is addressed for a RAM memory read operation, a decoder circuit 4 sets its output signal RAMREAD in an active state or 0, whereby an out¬ put signal of an AND gate 8, i.e. the chip enable signal CE, also changes to its active state 0, activating the memory. Writing to RAM is, however, protected accord- ing to the invention. Writing to the memory is started by addressing a RAM enable register 1 located in a memory location outside the RAM memory space to be written into and writing a key code word of at least two bits, preferably eight bits, to the register. The correct key code word activates an output signal RAMOK of the enable register 1 by setting it in state 0. The signal RAMOK is passed by an AND gate 5 to a time control timer 2, which sets its output signal TIMEOK in an active state 0 and starts to count the time interval. The TIMEOK signal is fed to a second input of an OR gate 7. A signal RAMWR is fed to the second input of the OR gate 7 from a decoder circuit 3, which sets the signal RAMWR in an active state 0 when the RAM memory space controlled by the circuitry is addressed for RAM memory write. If a write operation is performed within a certain time interval, i.e. when the signal TIMEOK is 0, the output of the OR gate 7 changes its state to active or 0 and thereby activates even the signal CE. If a write operation is not performed within the given time interval, the time control timer 2 forces the signal TIMEOK to assume a state 1, which prevents the activation of the output of the OR gate 7 and there¬ by the activation of the signal CE, even though RAMWR would activate as a result of a write attempt. The signals RAMWR and TIMEOK are also applied to the inputs of an OR gate 6. The output of the OR gate 6 is connected to an input of an AND gate 5, another input of which receives the signal RAMOK. If a write operation is performed within the given time interval, i.e. when the signal TIMEOK is in state 0, both of the inputs of the OR gate 6 are simul¬ taneously in state 0, which activates the output of the gate 6 and resets the timer 2 through the AND gate 5. It is then again possible, within the given time interval, to perform a new write operation, which again resets the timer 2. If a read operation is not performed within the time interval and the signal TIMEOK changes its state, the setting of the timer 2 through the OR gate 6 is prevented. In this case, a write operation can be performed only by rewriting the key code word to the register 1. The invention is particularly suitable for a system which is provided with at least two RAM circuits for storing information and in which one RAM circuit is used for copying the information in the other RAM circuit(s). The information to be stored is thereby copied as blocks from a memory circuit to another. Several memory circuit write operations are used for the copying of each block. According to the invention, it is necessary to write a key code word of at least two bits to an external register in order that copying might be started. There must not be a delay exceeding the given time interval between the instants of writing two pieces of information to be copied subsequently, or otherwise the key code word must be given again. The time interval is the time required for the control apparatus to read information out of one memory circuit and to write information into another memory circuit plus the time taken by the additional measures needed in copying. In the preferred embodiment of the inven¬ tion, the time interval is of the magnitude 5 μm. The invention is particularly well suitable for use in the copying of cash and operation data in a slot machine or the like. The figure and the description pertaining thereto are intended merely to illustrate the invention. In its details the invention can vary within the scope of the attached claims.

Claims: Claims: 1. A method for controlling writing to a memory, in which method a memory write operation is permitted only within a predetermined time interval from the writing of a predetermined key code to a predeter¬ mined memory location, c h a r a c t e r i z e d in that after a successful memory write operation following the writing of each key code, a new memory write opera- tion is permitted within a predetermined time interval from the previous one without rewriting of the key code. 2. A method according to claim 1, c h a r a c ¬ t e r i z e d in that the key code is written in a memory space into an area different from the one to which the memory write operation is to be addressed. 3. An apparatus for controlling writing to a memory, comprising control means (1-8) for forming a memory activation signal (CE) in response to the apply¬ ing of a predetermined key code to the control means, the control means comprising timer means (2) which are started by applying a key code and which prevent the formation of the memory activation signal (CE) when a predetermined time has elapsed since the applying of the key code, c h a r a c t e r i z e d in that the control means further comprise means (3, 5, 6) for restarting the timer means (2) within a predetermined time interval from the applying of the key code or the previous memory write operation as a result of a performed memory write operation. 4. Use of the apparatus according to claim 3 in a slot machine for copying cash and operation data from one memory to another for backup storage of the data.

Inventors: LAATIKAINEN JOUKO, LAATIKAINEN, JOUKO
Applicants: RAHA AUTOMAATTIYHDISTYS, RAHA-AUTOMAATTIYHDISTYS
Application year: 1991
Main classification: G07F17
IPC codes: G06F11, G06F12, G06F21, G11C7, G11C8