EPM having an improvement in accounting update security5021963Abstract An electronic postage meter has two non-volatile memories for storing postage meter accounting data under control of a CPU operating under a program in ROM. An accounting data recovery routine is stored in ROM. Prior to updating critical information in the non-valatile memories, a recovery address which calls the recovery program is stored in NVM and cleared after a successful update. At each power-up of the meter, the non-volatile memory is checked to see if the address is present and if it is, the accounting data is done again from the start of the accounting cycle. Claims What is claimed is: Description RELATED APPLICATIONS
______________________________________
1. ascending register value = ascending register
value in data store +
(postage value * print counter value)
2. descending register = descending register value
in data store -
(postage value * print counter value)
3. batch amount = batch amount +
(postage value * print counter value)
4. piece count = piece count + print counter value
5. batch count = batch count + print counter value
______________________________________
It will be seen that if the print counter value is 0, the values will be those stored in the accounting data store. FIGS. 5A and 5B through FIG. 11 illustrate a flow chart of the accounting driver routine 500 in the postage meter for accounting for postage meter funds and for updating non-volatile memory in accordance with the trip routine discussed in conjunction with FIG. 12. It will be understood that other postage meter CPU routines will control performance of the other tasks required for tasks such as setting the printwheels, allowing postage to be printed by energizing and de-energizing the die-protection solenoids, communicating with peripherals and the like. It will be understood that these tasks may be performed in sequences as described in U.S. Pat. 4,301,507 and 4,710,883. FIGS. 5A and 5B comprise a flow chart illustrating the top-level control process for the accounting driver. The routine examines an ACCT-OPERATION input and passes control to either the Read Trip or Write Trip routine. If the Read Trip routine returns a status of CMOS.RECOVERY, control is again passed to the Write Trip routine to perform the recovery of CMOS data. In all other circumstances, the status from Read Trip routine or the Write Trip passes control back to Task Processing. In the ACCOUNTING DRIVER routine 500, as shown in FIG. 5A, the ACCT-OPERATION input is tested in decision block 510. If the ACCT-OPERATION=READ is negative, the WRITE-TYPE=ACCOUNTING OPERATION is selected, block 520 and the WRITE TRIP subroutine is called at block 530. The WRITE TRIP routine is discussed below. Continuing again from decision block 510, if the TEST for ACCT-OPERATION=READ is YES, the routine attempts to READ the current trip information store from NVM. It will first try to retrieve the data from the CMOS memory 104. If the data cannot be retrieved, the routine attempts to get the trip data from E.sup.2 PROM memory 106. In the event that this retrieve is required, the accounting values are reconstructed as discussed previously by multiplying the count stores in the E.sup.2 PROM trip counter by the set postage value stored in the trip data. The routine proceeds to set up to READ the trip information from the CMOS NVM 104, block 540, and the NVM DRIVER routine is called, block 550, to READ the information stored in the CMOS memory buffers. If the status after the READ has been completed returns as OK, block 560, the program control is returned to task processing. If the READ status checked at block 560 is not OK, then the routine sets up to READ the information from the buffers of the E.sup.2 PROM memory, block 570 and NVM DRIVER is again called at 580 to READ the E.sup.2 PROM. If the status of this READ out of the E.sup.2 PROM, checked at decision block 590 is not OK, a fatal error flag is set since both devices cannot be read and meter fatal error processing is initiated to shut down the postage meter. If status of this Read at block 590 is OK, then the Trip Counters in the E.sup.2 PROM memory are READ, block 600 in FIG. 5B, and the result of this READ is tested at decision block 610. In the event that the READ is OK, the routine proceeds to reconstruct the accounting data in RAM for the CMOS memory from that in the E.sup.2 PROM, block 630. If the READ of the trip counters is not OK, the routine attempts to fix corrupted print count data by copying the data stored in the random access memory into a new buffer in the E.sup.2 PROM, block 620. The fix is tested at decision block 640. If it is not achieved, a FATAL ERROR is set since both memories again cannot be READ. However, if the appropriate fix has been achieved, the routine proceeds as well to block 630 to reconstruct CMOS data as noted previously. The ACCT.OPERATION is set to CMOS-RECOV, block 650, and the routine loops back. FIG. 6 shows the WRITE subroutine for the accounting driver at 700. At decision block 710, the WRITE TYPE is tested and if the CMOS RECONSTRUCT is set, the YES branch of the decision block 710 sets up the WRITE CMOS memory with the "Auto-Advance to the next buffer" set to false at block 720. At block 730, the NVM DRIVER routine is called to overwrite the CMOS accounting data as described previously with the accounting driver routine. The program then returns to the accounting driver routine. Returning to decision block 710, if the WRITE-TYPE is not equal to CMOS reconstruct, the NO branch is selected and the routine tests for whether the WRITE-TYPE is a non-trip, block 740. Such non-trip accounting is called for, for example, when the requirement is to clear a batch register, set postage recharging information and the like. At the YES branch of decision block 740, that is, when the WRITE-TYPE equals non-trip, the routine progresses to check the trip counters in the E.sup.2 PROM memory, block 750. If the trip counters are set equal to zero, the YES branch proceeds to set the WRITE-TYPE equal to OVER-WRITE, block 760 and returns to the main line of the WRITE Accounting Driver routine. In the event that the trip counter is not equal to zero, the NO branch sets the WRITE-TYPE equal to E.sup.2 PROM Memory Update, block 770, and returns to the mainline of the WRITE Accounting driver routine. Returning to decision block 740, if the WRITE-TYPE equal non-trip is NO, the NO branch proceeds directly to test whether the WRITE-TYPE is equal to OVER-WRITE, decision block 780. If the WRITE-TYPE equals OVER-WRITE, the YES branch proceeds to call the OVER-WRITE subroutine, block 790. If the WRITE-TYPE does not equal OVER-WRITE, the NO branch of decision block 780 falls to block 800 to check whether the WRITE-TYPE equals ACCOUNT. If the WRITE-TYPE is equal to ACCOUNT, the YES branch of decision block 800 proceeds to call the ACCOUNT routine, block 810. If the WRITE-TYPE does not equal ACCOUNT, the NO branch of block 800 proceeds to call the E.sup.2 PROM MEMORY UPDATE routine block 820. FIG. 7 illustrates the OVER-WRITE routine at 900. This routine serves to simply copy data from RAM buffers into the data store in a particular non-volatile memory. This routine begins at block 910 by placing the trip count pointer into the RAM buffers. The program sets up, at block 920, for the WRITE to the CMOS memory with the Auto-Advance flag set false. That is, the buffers in CMOS memory will simply be overwritten by the data in corresponding RAM buffers. The NVM DRIVER routine is then called at block 930 to WRITE the data to CMOS and when it returns successfully, an update recovery address which has been previously set will be cleared at 940. The purpose of this block 940 will be discussed below in conjunction with TRIP ACCOUNTING and power-up of non-volatile memory. The routine proceeds to block 950 to set up for writing to the E.sup.2 PROM memory, again with the Auto-Advance set to false. The non-volatile memory driver is called at 960 and the recovery address is cleared at block 970. The routine then returns to the ACCOUNTING DRIVER routine. FIG. 8 illustrates the ACCOUNT routine beginning at 1000. The routine is initiated by putting the trip count pointer in RAM buffer, block 1010 and it proceeds to set up for writing to the CMOS memory with, in this case, the Auto-Advance being true, block 1020. The non-volatile memory driver is called to WRITE the CMOS block 1030 and upon successful completion of the WRITE, the recovery address is cleared, block 1040. The program proceeds to set up to increment the trip counters in the E.sup.2 PROM, block 1050, and the trip counters are tested at decision block 1070 to determine whether the trip counter has reached a predetermined number, suitably 15, for the E.sup.2 PROM used in the present postage meter. If the trip counters have reached 15, the YES branch returns a status of "Need-to-Update E.sup.2 PROM memory" to the calling module, block 1080, and the program returns to the WRITE Accounting Driver routine to call the UPDATE E.sup.2 PROM routine. If the trip counter value does not equal 15, the NO branch of decision block 1070 returns to the TRIP ACCOUNTING routine with a status indicating success block 1090. The UPDATE OF E.sup.2 PROM routine is shown in FIG. 9 beginning at 1100. This routine proceeds at block 1110 to calculate the next Trip Count pointer and to initialize new trip counters to zero, block 1120. The new Trip Count pointer is then stored in the RAM buffer, block 1130 and the set up to WRITE CMOS memory with the Auto-Advance false is made, block 1140. The NVM DRIVER is called at block 1150 to WRITE to the CMOS memory and an update to the recovery address with Power Fail Acct-E.sup.2 PROM Update is made at block 1160, after successful completion of the WRITE to CMOS memory. The WRITE from RAM to E.sup.2 PROM memory with the Auto-Advance set to TRUE is carried out at block 1170, the NVM DRIVER is called at block 1180 and finally, the recovery address buffer is cleared at block 1190. The routine then returns to TRIP ACCOUNTING. Turning now to FIG. 10, the NVM DRIVER routine is shown at 1200. A routine called NVM DRIVER may elect to read information from the CMOS memory, from the E.sup.2 PROM memory or from both memories. As seen from Table 1, the NVM devices are numbered. In this routine, at block 1210, save device non-volatile memory equals device number. This number is tested at block 1220 and if the number corresponding to "BOTH DEVICES" is selected, the YES branch of the block proceeds to choose the Device Number equals CMOS at block 1230 to initiate the routine. Next, at block 1240, the operational flag is tested to see whether a READ operation is requested, and if not, the NO branch of decision block 1240 calls the WRITE routine (for non-volatile memory driver) at block 1250. The YES branch of decision block 1240 proceeds to check whether the buffer to be read is marked BAD at decision block 1260. The NO branch of this decision block 1260 indicates that the buffer is not BAD and the program proceeds to READ the data from the selected non-volatile memory device at block 1270. The READ is tested at decision block 1280 and if it is OK, the YES branch returns to the ACCOUNTING DRIVER program. If the READ was not OK, the buffer is marked BAD, block 1290 FIG. 10B and a test is made if there are sufficient GOOD buffers left at block 1300. If there are sufficient buffers, the YES branch sets a non-fatal error code at 1310. If there are not suffiCient GOOD buffers left, the NO branch proceeds to set a fatal error code at 1320 and both branches then proceed to decision block 1330 where the SAVE DEVICE NUMBER is again tested to see if it was set to read "BOTH DEVICES". Returning again to decision block 1260, if the answer is that the buffer was marked BAD, an error code is set at block 1265 and a return is made to the main line as above to test at block 1330 whether the device NVM is equal to "BOTH". The NO branch of this decision block 1330 returns an error code. If the answer is YES, the device number is checked to see whether it is equal to CMOS ONLY at decision block 1345. If NO, the DEVICE NUMBER is checked to see whether it is equal to E.sup.2 PROM at decision block 1350. The NO branch of decision block 1350 proceeds to block 1360 where the device is set equal to E.sup.2 PROM and a return is made to check whether the buffer is marked BAD at decision block 1260. If the selected branch at decision block 1350 is YES, a fatal error code is set at block 1370 and the error code is returned. Returning to decision block 1345, if the answer is YES, the YES branch proceeds to decision block 1380 to determine if the CMOS Memory Alternate is set. If it is, the routine returns. If NO, the NO branch proceeds to set the device equal to CMOS ALT, block 1390 and loops back for reading the data. The WRITE routine for non-volatile memory driver is illustrated in FIG. 11 at 1400. When the WRITE is called, the store code is tested at block 1410 to determine if the store is circular. If the store is circular, the YES branch leads to a test in decision block 1420 whether the Auto-Advance to set to TRUE. If Auto-Advance is TRUE in block 1420, the YES advances the pointer to the next buffer, block 1430 and returns to the main line. Similarly, if the test of the Auto-Advance in block 1420 is NO or if the store is not circular, the NO branch proceeds to the main line to decision block 1440 to determine if the buffer is marked BAD, decision block 1440. If the buffer is not BAD, the NO branch at decision block 1440 proceeds to the WRITE data block 1450. If the buffer is marked BAD, the YES branch proceeds to block 1460 which advances the pointer to the next buffer, block 1460, and loops back to test the buffer at block 1440. The WRITE is tested at decision block 1470 and if it is not GOOD, the NO branch proceeds to block 1480 to mark the buffer BAD and the test is made at block 1490 to determine whether there are sufficient GOOD buffers are left for operation. The YES branch of decision block 1490 loops back to the start of the WRITE program. If there are not sufficient GOOD buffers, the NO branch proceeds to set a fatal error code at block 1500 and rejoins the main line at the YES branch from decision block 1470. In either event, the SAVE DEVICE NVM number is checked to see whether it is equal to BOTH DEVICES, block 1510 and if the answer is NO, the NO branch returns to the NVM DRIVER routine. If the answer at decision block 1510 is YES, the YES branch proceeds to decision block 1515 to determine if the store is to CMOS Memory Only. If the CMOS Memory Only is set, the YES branch of decision block 1515 proceeds to decision block 1540 to test whether CMOS.ALT is set. If it is, the routine returns to the NVM Driver routine if no, the NO branch from block 1540 sets the device equal to CMOS Alternate, block 1550, and loops back. Returning to decision block 1515, if the answer is NO, the routine falls to decision block 1520 to test whether the device number is equal to E.sup.2 PROM at block 1520. If the answer is YES, the routine again returns to the main NVM DRIVER routine and if not, the device number is set equal to E.sup.2 PROM block 1530 and the program loops back to the start of the WRITE routine. We are now in position to discuss the actual trip accounting process. FIG. 12 is a flow chart of the accounting and NVM update which is required for each "trip" or print of postage value. The printwheels will have either remained in a previously set condition or have been changed to a new postage setting by a communication from the operator or a peripheral device. As discussed previously, every time postage is printed, the following information has to be updated within the postage meter non-volatile memories to account for the printing of the postal value set on the printwheels: the ascending register, descending register, piece count, batch count, and batch amount. The ascending register accounts for the total amount of money expended by the postage meter whereas the descending register accounts for the funds remaining in the postage meter. Piece count, batch count and batch amount are normally set to zero at the start of a run so that the number of envelopes to which postage is applied. The batch amount and batch count are normally resettable to zero by the operator to allow the operator to keep track of the actual postage used during a current run as well as the number of pieces in the run. An additional value stored in accordance with the invention is the value of postage to which the printwheels are set. The first step in the trip account routine 1555 is therefore to perform a check of the setting of the printwheels to determine whether there has been a change in the set value since the last meter trip, block 1560. If there has been a change, the YES branch proceeds, block 1565, to place a Power Fail-Non Trip recovery address into a main and alternate buffer in CMOS NVM 104. The ACCOUNTING DRIVER routine is then called, with parameter set to NON-TRIP, block 1570, to update the data stores, both in the CMOS and in the E.sup.2 PROM. During the course of a successful memory update, the recovery address buffer is cleared and the program returns to join the NO CHANGE branch from block 1560. The next step, block 1575, is to perform a scratch pad accounting in RAM. The newly computed ascending and descending register information, etc., is placed in RAM buffers for transfer to corresponding buffers in the NVMs. It will be appreciated that this is a critical moment because when power to the electronic postage meter is lost, the contents of this temporary memory is lost. To avoid the loss of critical information as the status of critical data changes, it is now immediately transferred to NVM. In order to protect the data transfer, in accordance with the invention, each time such an update to the CMOS non-volatile memory is required, there is set up a Power Fail-Account Recovery address as shown in block 1580. This address is a pointer to a program in ROM which will cause the postage meter program to call a routine to restart in power-up from the initial point of the TRIP ACCOUNTING in order to cycle through the routine from the beginning of the trip. No attempt is made to continue the accounting from the exact point of power fail. For best results, the Power Fail Trip recovery address is stored both in a main and an alternate memory buffer in CMOS memory along with a CRC for each. The next block, 1585 calls the ACCOUNTING DRIVER (500) for the accounting process. It will be remembered that in the discussion of the ACCOUNTING DRIVER routine, the significance of the clearing of this Power Fail Account address was not specifically discussed Here it becomes evident that the address set in this TRIP ACCOUNTING routine will allow recovery by returning the calculations to the start of this trip even if the update process has been nearly completed. The address is then cleared once the NVM memory update has been completed. When ACCOUNT returns to the Trip routine, the status of the Trip Counter is checked, decision block 1590, if the counter has not reached 15, the NO branch of the routine returns to Task Processing. If the counter has reached 15, the YES branch of decision block 1590 proceeds to set up a Power Fail-Trip E.sup.2 PROM UPDATE address, block 1595, and to invoke the ACCOUNTING DRIVER with parameter set to E.sup.2 PROM UPDATE, block 1598. After a successful WRITE, the TRIP routine returns to Task Processing. FIGS. 13 and 14 comprise a flow chart illustrating the power-up procedure of the accounting portions of non-volatile memory. In FIG. 13, the NVM power-up routine is shown at 1600. A power-up flag is checked and the routine initializes the device bit map, block 1610. It will be recalled that each device maintains four (4) copies of the bit map in its lower address registers. The first GOOD copy is determined and the bit map for each device is transferred to RAM. At block 1620, the counters representing the numbers of GOOD buffers are READ from non-volatile memory. Next, at block 1630, the starting addresses for the stores are transferred to RAM. It will be appreciated that this was the initial address data that is placed in ROM. The next step is to initialize the store pointers at block 1 640 based upon the current non-volatile memory status and bit maps initialized in block 1610. The routine then proceeds at block 1650 to the POWER FAIL recovery processing The routine then falls to block 1660 where the CMOS and E.sup.2 PROM trip buffers are checked to determine whether the buffers are equal. If at decision block 1670, the E.sup.2 PROM and CMOS are not equal, the NO branch proceeds to set the buffers equal using the copy with the highest piece count, block 1680, and returns to the application program, otherwise, the routine returns directly to application program at the YES branch. FIG. 14 shows the power-fail processing at 1700. It will be recalled that the recovery addresses are stored in a main and alternate buffer in CMOS memory. The power-up processing routine reads the recovery data in the main CMOS memory block 1710 and if the CRC is GOOD at decision block 1720, the YES branch proceeds to block 1730 to check the recovery address. If the recovery address equals zero at block 1740, there is no indication of incomplete accounting and the YES branch returns to main NVM power-up program. If the check says that the recovery address is not zero at decision block 1740, the NO branch causes a call of the recovery routine at the recovery program address in non-volatile memory, block 1750. Returning to decision block 1720, if the CRC is determined not be GOOD, the NO branch falls to block 1760 to read the recovery data in the alternate CMOS register. The CRC is checked in block 1770 and if it is also found not GOOD, the NO branch sets a fatal error since neither memories' recovery data can be read. If, however, the CRC is GOOD on this decision block 1770, the YES branch falls to decision block 1780 to determine whether recovery address is equal to zero. If YES, the routine returns to NVM power-up since no further action is required. If the recovery address is not zero, the NO branch causes a jump to recovery program address stored in the non-volatile memory block 1790. The Appendix comprising Table 1 is attached hereto. Table 1 illustrates the memory store definitions in accordance with the invention.
|
Same subclass Same class Consider this |
||||||||||
