CN1536494A - Method for accessing exterior memory of microprocessor - Google Patents

Method for accessing exterior memory of microprocessor Download PDF

Info

Publication number
CN1536494A
CN1536494A CNA03110374XA CN03110374A CN1536494A CN 1536494 A CN1536494 A CN 1536494A CN A03110374X A CNA03110374X A CN A03110374XA CN 03110374 A CN03110374 A CN 03110374A CN 1536494 A CN1536494 A CN 1536494A
Authority
CN
China
Prior art keywords
memory set
microprocessor
memory
storehouse
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CNA03110374XA
Other languages
Chinese (zh)
Other versions
CN1296837C (en
Inventor
曾宝庆
宋秉乘
陈炳盛
杜立群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
MediaTek Wuhan Inc
Original Assignee
MediaTek Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by MediaTek Inc filed Critical MediaTek Inc
Priority to CNB03110374XA priority Critical patent/CN1296837C/en
Publication of CN1536494A publication Critical patent/CN1536494A/en
Application granted granted Critical
Publication of CN1296837C publication Critical patent/CN1296837C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The invention provides a microprocessor external memory accessing method, containing: store interruption service program in one of many memory groups; when interruption happens, use the microprocessor to store working program address and memory group addressing codes into a stack; switch the microprocessor to execute the interruption service program; read the addressing codes and program address from the stack; and switch the microprocessor to execute the work before interruption.

Description

The method of access microprocessor external memory storage
Technical field
The invention provides a kind of method of access memory, refer to that especially a kind of access is connected in the method for the external memory storage of microprocessor.
Background technology
MCS (Micro Computer System) is the general name of Intel Company to microprocessor, and the microprocessor of the MCS-51/52 series that it is developed is applied in the industry member especially at large.Generally speaking, microprocessor only contains a spot of storer and input/output port, microprocessor with MCS-51 series is an example, it has the program storage of 4K byte, data-carrier store and 32 input/output port of 128 bytes, the microprocessor of MCS-52 series then is that program storage is increased to the 8K byte, and data-carrier store increased to 256 bytes, and the microprocessor of MCS-52 and MCS-51 series is to use one 8 CPU (central processing unit) equally.Program storage is used for depositing the program that the user writes, belong to ROM (read-only memory) (ROM), data-carrier store then is a random-access memory (ram), can the time read or write data for the CPU (central processing unit) running, normally is used for the working storage of when program is carried out temporary transient store data.The microprocessor of MCS-51/52 series can be by outside extended storage, and maximum can expand to the 64K bit byte.
Yet among some were used, the user may need to write very big procedure code or use very big array table, and the outside expanding program storer of 64K bit byte still uses inadequately thus.It is a kind of method that storer significantly can be expanded that memory set is switched (bank switch), use the pin that has more on the microprocessor to do addressing to surpassing 64K bytes of memory device as decoding line, if external memory storage is a jumbo storage arrangement, the pin that then has more can be directly as address wire, if external memory storage is the storage arrangement of a plurality of low capacities, the pin that then has more can be used to the selection memory chip.Because the outside extended storage of microprocessor maximum is the 64K byte, so available 64K byte as the basic tankage of single memory set, is called one page (page), and switches the page number with the pin that microprocessor has more, to select different memory set.Memory set is switched the address that maximum problem is interrupt vector table (interrupt vector table) configuration; because interrupt vector table can be placed on certain specific address in the storer usually; though program can be switched at each page or leaf when running; when but central broken hair is given birth to; the program particular address in the page or leaf of place at once removes to seek interrupt vector table; and program also can't be done the memory set switching at this moment, when program can not find interrupt vector table, just can produce mistake.The method that generally addresses this problem, be in each memory set, all to keep common area (common area), store interrupt vector table, interrupt service routine (interrupt service routine in the common area, ISR), general purpose function storehouse and memory set changeover program, so no matter procedure operation is at that page or leaf, when program took place to interrupt, program can find interrupt vector table to continue program implementation in the page or leaf at place.
Please refer to Fig. 1, Fig. 1 is the synoptic diagram of known external program memory 12 configurations.Suppose to have the microprocessor of MCS-51/52 series to use the mode that memory set is switched externally to expand 512K bytes of memory device 12, be divided into 8 pages or leaves, each page or leaf is the 64K byte, and the common area of reservation 10K byte is used for depositing interrupt vector table, interrupt service routine, general purpose function storehouse and memory set changeover program.For instance, when when first page program need be called out second page program, can skip to the memory set changeover program in the common area immediately, the memory set changeover program can be set the page number of required memory set, because for microprocessor, changing the page number in common area can't influence reading of any routine data, then microprocessor just can access required program in second page.After second page routine processes finished, program can be got back to earlier in the common area, switches back original memory set by the memory set changeover program, and executive routine is continued in the address that returns original program in first page.
From the above, the program storage that microprocessor provided of known MCS-51/52 series, maximum can only be utilized and expand external program memory to the 64K byte, but skill by the memory set switching, use the pin that has more on the microprocessor, can again external program memory be done significantly to expand, but memory set is switched individual shortcoming is arranged, be exactly all must reserve part among each memory set the space as common area, be used for depositing interrupt vector table, interrupt service routine, general purpose function storehouse and memory set changeover program, and these data can be duplicated and be stored among the common area of each memory set, thus, the space of storer just can't effectively be utilized.
Summary of the invention
Therefore fundamental purpose of the present invention provides the method that a kind of access connects the storer of microprocessor, to address the above problem.
Claim of the present invention provides a kind of access to connect the method for the storer of microprocessor, this storer comprises a plurality of memory set (memory bank), wherein the size of each memory set is the maximum address space of this microprocessor internal addressed line, this microprocessor comprises the Interrupt Process unit, and being used for the memory set selector switch of switchable memory group, this method comprises: (a) interrupt service routine (interruptservice routine) is stored in one of them of this a plurality of memory set; (b) when interrupting taking place, use the program address of this CPU (central processing unit) in will working to deposit in (push) storehouse, the page number of the memory set in then will working pushes in this storehouse, sets this memory set selector switch again for storing the page number of the memory set with this interrupt service routine; (c) this CPU (central processing unit) is switched to this interrupt service routine of execution in the memory set that stores this interrupt service routine; (d) use this CPU (central processing unit) from this storehouse, take out (pop) in step (b), deposit in this storehouse memory set the page number and deposit it in this memory set selector switch, then by taking out the program address that in step (b), deposits this storehouse in this storehouse; And (e) after execution in step (d), the page number that stores according to this memory set selector switch and the program address of taking-up are switched back the pairing memory set of this page number and are continued in this memory pool address execution in step (b) interruption work before.
With respect to known technology, method provided by the present invention makes the CPU (central processing unit) of microprocessor can utilize storehouse to get up to write down the address date of program in the execution when taking place to interrupt, so the interrupt service routine that is present among the common area of each memory set can be shifted out, reduce the common area occupation space, increased the free space of each memory set on the one hand, also reduced the chance of switchable memory group on the other hand, improve the efficient of CPU (central processing unit) access external memory storage, when known technology expands external memory storage in the mode of using the memory set exchange, must in each memory set, all duplicate the common area data that portion contains interrupt service routine, and interrupt service routine has accounted for the very big part of common area, the suitable space of waste storer, the space that the present invention then can the more efficient use storer.
Description of drawings
Fig. 1 is the synoptic diagram of known external program memory configuration.
Fig. 2 is the synoptic diagram of the memory set configuration of external memory storage of the present invention.
Fig. 3 is the process flow diagram of the present invention's switchable memory group when interrupting taking place.
Fig. 4 uses the synoptic diagram of storehouse when switching the note storehouse for the present invention.
Embodiment
Please refer to Fig. 2, Fig. 2 is the synoptic diagram of external memory storage 22 its memory set configurations of microprocessor of the present invention.The external memory storage 22 of microprocessor (figure does not show) is when using the memory configurations mode of memory set exchange, the data that need in each memory set, all need to duplicate a common area, quite expend storage space, if can reduce the size of store data in the common area, just can significantly save the space of storer.The present invention takes out the interrupt service routine that the common area 24 of each memory set of external memory storage 22 is comprised, just the common area 24 of memory set does not comprise interrupt service routine, and only externally store a interrupt service routine 26 among one of them memory set of storer, when interrupting taking place, switch to reading of data in the memory set that stores interrupt service routine 26 again, so the common area of each memory set has just all dwindled, each relative memory set just has more free space, also can reduce the probability that memory set is switched.For instance, the size of case of external storer 22 is the 512K byte, be divided into 8 memory set, the size of each memory set is the 64K byte, and each memory set needs 10K bytes of memory device space to store the common area data, and wherein interrupt service routine has accounted for the 4K byte, so the taking-up of the interrupt service routine in each common area is only stored a interrupt service routine 26 the 0th page in memory set, except the 0th page of memory set, the free space of each database increases to the 58K byte by original 54K byte, has increased 4K* (8-1)=28K bytes of memory device space altogether.Because 26 of interrupt service routines are stored in the 0th page of memory set, when so central broken hair is given birth to, the CPU (central processing unit) of microprocessor need switch to the memory set in the work the 0th page of memory set, at first the memory set page number at executory data address and place is successively deposited among (push) storehouse, make Interrupt Process for the 0th page that then switches to memory set, take out the memory set page number and the data address that (pop) before deposited in by priority in the storehouse again after waiting to finish Interrupt Process, work on according to the data address of switching back by the memory set page number that takes out in the storehouse and data address before interrupting taking place.
Please refer to Fig. 3, Fig. 3 is the process flow diagram of the present invention's switchable memory group when interrupting taking place.The present invention is in order to save the usage space of storer, with interrupt service routine by taking out in the common area, only store a interrupt service routine 26 among one of them memory set, so not only increased the free space of each memory set, also, raise the efficiency because the increase of free space makes the probability of switchable memory group reduce.Owing to do not contain interrupt service routine in the common area of memory set, if program is interrupted when carrying out, the CPU (central processing unit) of microprocessor can use storehouse to come the data address in the writing task and the memory set page number at place, switch to after the database that stores interrupt service routine finishes Interrupt Process in memory set, just can get back to the address of interrupting the preceding place of generation according to the data that write down in the storehouse.The detailed step description of contents of the present invention's switchable memory group when interrupting taking place is as follows:
Step 110: interrupt to take place, CPU (central processing unit) receives interrupt request and the program that must stop to carry out is carried out Interrupt Process;
Step 120: the address date of executory program is deposited among the storehouse, at first 8 low order address of recording address data are deposited among the storehouse, then 8 high addresses of recording address data are deposited among the storehouse again;
Step 130: the page number of executory program place database is deposited among the storehouse, and 8 bit data that just will store in the memory set selector switch (page selector) of the page number deposit among the storehouse;
Step 140: the switchable memory group, just the memory set selector switch is set at the page number of the memory set that stores interrupt service routine, make CPU (central processing unit) can switch to the memory set that stores interrupt service routine and make Interrupt Process;
Step 150: carry out interrupt service routine, carry out Interrupt Process;
Step 160: by the page number that takes out the memory set in the previous work in the storehouse;
Step 170: switch back the memory set in the previous work, just the memory set selector switch is set at the page number that previous step is taken out by storehouse in rapid;
Step 180: by the address date that takes out the previous program of carrying out in the storehouse, earlier with 8 high addresses of recording address data by taking out in the storehouse, then again with 8 low order address of recording address data by taking out in the storehouse;
Step 190: proceed to interrupt taking place preceding performed program according to the address date that previous step is taken out by storehouse suddenly.
Please refer to Fig. 4, Fig. 4 uses the synoptic diagram of storehouse 28 during for switchable memory group of the present invention.Stacked memory 28 in the microprocessor typically uses stack pointer and points to the reference position of a position of internal data memory as storehouse, storehouse normally is used for depositing the programmed counting of calling out subroutine, or the data made by oneself of user, and because the CPU (central processing unit) of microprocessor is carried out 8 instruction set, so each the group data in the storehouse also are 8.The processing mode of stacked data is for first-in last-out, just deposits data in the storehouse in and must wait until that next group deposits in and just can be removed use after data in the storehouse are removed that last group deposits the data that the data in the storehouse then can be removed at first in.In above-mentioned method, when CPU (central processing unit) is received interrupt request, the low order address of program in can successively will carrying out according to above-mentioned step, the memory set page number at high address and place deposits among the storehouse 28, in other words, when central broken hair is given birth to, CPU (central processing unit) can utilize storehouse 28 to write down the address date of program in the execution earlier, so after completing steps 130, stored data just as shown in Figure 4 in the storehouse, then carrying out step 140 comes switch data storehouse and step 150 to make Interrupt Process, when making Interrupt Process, may also can use storehouse 28 and store some parameters, but after finishing Interrupt Process, stored data still can be as shown in Figure 4 in the storehouse 28, and this moment, CPU (central processing unit) just can be utilized data in the storehouse 28 to carry out the address that step 160 to step 190 gets back to before interrupting taking place to continue the interrupted program of execution.
From the above, microprocessor of the present invention is when externally storer 22 uses the method for memory set exchange, the interrupt service routine of the common area 24 of each memory set is taken out, and only store a interrupt service routine 26 memory set therein, and when interrupting taking place, use storehouse 28 to write down the address date of program in the CPU (central processing unit) execution, switch to the memory set that stores interrupt service routine again and make Interrupt Process, wait to finish after the Interrupt Process, by taking out the address date that interrupts taking place the preceding performed program of CPU (central processing unit) in the storehouse 28, make CPU (central processing unit) to continue executive routine according to this address date.
With respect to known technology, method provided by the present invention makes the CPU (central processing unit) of microprocessor can utilize storehouse to get up to write down the address date of program in the execution when taking place to interrupt, so the interrupt service routine that is present among the common area of each memory set can be shifted out, reduce the common area occupation space, increased the free space of each memory set on the one hand, also reduced the chance of switchable memory group on the other hand, improve the efficient of CPU (central processing unit) access external memory storage, when known technology expands external memory storage in the mode of using the memory set exchange, must in each memory set, all duplicate the common area data that portion contains interrupt service routine, and interrupt service routine has accounted for the very big part of common area, the suitable space of waste storer, the space that the present invention then can the more efficient use storer.
The above only is the preferred embodiments of the present invention, and all identical variation and improvement of doing according to claims of the present invention all should belong to the covering scope of patent of the present invention.

Claims (6)

1. an access is greater than the method for the storer of microprocessor internal addressed line addressable space, this storer comprises a plurality of memory set, and this microprocessor comprises storehouse, the Interrupt Process unit, and be used for the memory set selector switch of selection memory group, this method comprises:
(a) interrupt service routine is stored in one of them of this memory set;
(b) when interrupting taking place, use the program address of this Interrupt Process unit in will working to deposit in the storehouse, the addressing sign indicating number of the memory set in then will working pushes in this storehouse, sets this memory set selector switch again for storing the addressing sign indicating number of the memory set with this interrupt service routine;
(c) this microprocessor is switched to this interrupt service routine of execution in the memory set that stores this interrupt service routine;
(d) use this Interrupt Process unit from this storehouse, to take out the addressing sign indicating number of the memory set that in step (b), deposits this storehouse in and it is stored in this memory set selector switch, then by taking out the program address that in step (b), deposits this storehouse in this storehouse; And
(e) after execution in step (d), according to the memory group addressing codes of this memory set selector switch storage and the program address of taking-up, this microprocessor is switched back the pairing memory set of this memory group addressing codes continue to interrupt work before in this program address execution in step (b).
2. the method for claim 1, wherein this microprocessor is the microprocessor for MCS series.
3. the method for claim 1, it also is included in each memory set and stores common area.
4. method as claimed in claim 3, wherein the data in this common area do not comprise interrupt service routine.
5. the method for claim 1, it is to be realized according to the procedure code in the program storage that is stored in this microprocessor by this microprocessor.
6. single-chip microprocessor of implementing the described method of claim 1.
CNB03110374XA 2003-04-10 2003-04-10 Method for accessing exterior memory of microprocessor Expired - Fee Related CN1296837C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB03110374XA CN1296837C (en) 2003-04-10 2003-04-10 Method for accessing exterior memory of microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB03110374XA CN1296837C (en) 2003-04-10 2003-04-10 Method for accessing exterior memory of microprocessor

Publications (2)

Publication Number Publication Date
CN1536494A true CN1536494A (en) 2004-10-13
CN1296837C CN1296837C (en) 2007-01-24

Family

ID=34319678

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB03110374XA Expired - Fee Related CN1296837C (en) 2003-04-10 2003-04-10 Method for accessing exterior memory of microprocessor

Country Status (1)

Country Link
CN (1) CN1296837C (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107209721A (en) * 2015-02-20 2017-09-26 高通股份有限公司 Local and non-local memory adaptive memory is accessed

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100488555C (en) * 2005-03-29 2009-05-20 吴宝海 Chinese medicinal composition for treating gastritis and duodenal ulcer

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107209721A (en) * 2015-02-20 2017-09-26 高通股份有限公司 Local and non-local memory adaptive memory is accessed
CN107209721B (en) * 2015-02-20 2020-10-23 高通股份有限公司 Adaptive memory access to local and non-local memory

Also Published As

Publication number Publication date
CN1296837C (en) 2007-01-24

Similar Documents

Publication Publication Date Title
US6049802A (en) System and method for generating a linked list in a computer memory
RU2405189C2 (en) Expansion of stacked register file using shadow registers
JPH03126144A (en) Method and apparatus for using memory in virtual address type information processing system
WO2001052068A1 (en) A memory device search system and method
JPH07175698A (en) File system
JPH06309224A (en) Method for data page control and data processing system
TWI254856B (en) Memory interleave method
CN1426558A (en) Multi-tiered memory bank with different data buffer capacity with programmable bank selection
CN1296837C (en) Method for accessing exterior memory of microprocessor
CN101084484B (en) Method and system for fast access to stack memory
US5519860A (en) Central processor index sort followed by direct record sort and write by an intelligent control unit
KR19990013576A (en) Forced Page Zero Paging Method of Microcontroller Using Data Random Access Memory
TWI222597B (en) Method for accessing external memory of a microprocessor
US5794240A (en) Multi-threaded sorting system for a data processing system
CN1258147C (en) Method of managing external storage by processor
CN1261863C (en) Microcontroller of data stored in storage by multi appliance access
US7130857B2 (en) Method for accessing a memory unit in which sequences of notes are stored, corresponding memory unit and corresponding program
US8812813B2 (en) Storage apparatus and data access method thereof for reducing utilized storage space
JPS62151940A (en) Register saving/return system
CN87104487A (en) In having the data handling system of virtual memory address, carry out the apparatus and method of page frame replacement
CN100353335C (en) Method of increasing storage in processor
TWI241485B (en) Microcontroller which accesses data stored in memory banks through a multiplexer
GB2282470A (en) Expanded memory management for multi-tasking environment.
Melnyk et al. Organization and application of the programmable ordered access memory
EP1251431A3 (en) Reduction of bank switching instructions in main memory of data processing apparatus having main memory and plural memory banks

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: MEDIATEK SOFTWARE (WUHAN) CO., LTD.

Free format text: FORMER OWNER: LIANFA SCIENCE AND TECHNOLOGY CO., LTD.

Effective date: 20150825

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20150825

Address after: 430070, Hubei, East Lake Wuhan Development Zone Finance port 1, A4, building 7-8

Patentee after: MediaTek software (Wuhan) Co., Ltd.

Address before: Hsinchu, Hsinchu, China Science and Technology Industrial Park, Taiwan

Patentee before: MediaTek.Inc

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070124

Termination date: 20160410

CF01 Termination of patent right due to non-payment of annual fee