[go: up one dir, main page]

CN102446138B - A Calibration Method of MAP Data in Single Chip Microcomputer System - Google Patents

A Calibration Method of MAP Data in Single Chip Microcomputer System Download PDF

Info

Publication number
CN102446138B
CN102446138B CN201110277714.3A CN201110277714A CN102446138B CN 102446138 B CN102446138 B CN 102446138B CN 201110277714 A CN201110277714 A CN 201110277714A CN 102446138 B CN102446138 B CN 102446138B
Authority
CN
China
Prior art keywords
map
flash
address
data
calibration
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.)
Active
Application number
CN201110277714.3A
Other languages
Chinese (zh)
Other versions
CN102446138A (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.)
CHANGZHOU ECTEK AUTOMOTIVE ELECTRONIC SYSTEMS Co Ltd
Tsinghua University
Original Assignee
CHANGZHOU ECTEK AUTOMOTIVE ELECTRONIC SYSTEMS Co Ltd
Tsinghua University
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 CHANGZHOU ECTEK AUTOMOTIVE ELECTRONIC SYSTEMS Co Ltd, Tsinghua University filed Critical CHANGZHOU ECTEK AUTOMOTIVE ELECTRONIC SYSTEMS Co Ltd
Priority to CN201110277714.3A priority Critical patent/CN102446138B/en
Publication of CN102446138A publication Critical patent/CN102446138A/en
Application granted granted Critical
Publication of CN102446138B publication Critical patent/CN102446138B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention relates to a method for calibrating the MAP data of a single chip system, comprising the following steps of: 1) setting a plurality of areas in the internal memory of a single chip; 2) storing the original data of all MAPs in the internal memory of the single chip; 3) storing the initial address and the occupied space size of each MAP in the internal memory of the single chip; 4) storing the index sequence number of each MAP in the internal memory of the single chip; 5) at the initialization of the system, building and initializing an MAP pointer array; 6) in the online calibration process, copying the MAP which is calibrated now into an RAM (Random-Access Memory) in the single chip from the FLASH in the single chip, and modifying the corresponding data in the RAM; and 7) obtaining the initial address of the present storage space of the MAP by searching for the corresponding MAP pointer, thereby performing table look-up interpolation operation on the data in the internal memory area which is started with the initial address and has a corresponding space size. With the method provided in the invention, the complexity degree and manufacturing cost of the single chip system can be reduced.

Description

一种单片机系统MAP数据标定方法A Calibration Method of MAP Data in Single Chip Microcomputer System

技术领域 technical field

本发明涉及一种MAP数据标定方法,特别是关于一种用于小容量RAM单片机系统中的MAP数据标定方法。The invention relates to a MAP data calibration method, in particular to a MAP data calibration method used in a small-capacity RAM single-chip computer system.

背景技术 Background technique

在汽车电子领域,嵌入式系统大都使用单片机作为控制核心。由于控制系统的复杂性和对象的多样性,单片机系统中有大量的参数无法在系统设计时确定,需要在系统开发完成后通过匹配标定来确定。而这种匹配标定,往往是利用PC机上的标定工具软件,通过基于总线的协议与单片机系统建立连接,将标定工具软件上的操作,传送给单片机,由单片机完成相应的操作。在单片机内的FLASH上,保存有这些需要标定的参数即MAP的初始值;通过基于总线的协议接收标定工具软件的操作,对MAP进行数据更新;由于FLASH中的数值只能通过FLASH编程软件才能更新,而在运行FLASH编程软件的时候,一般不能同时执行读取FLASH的程序,需要停止正常程序的运行,进入专门的FLASH编程模块,因此这种方式无法支持MAP的在线标定;针对这个问题,目前常用的解决方案是把MAP数据从单片机内的FLASH中拷贝到单片机内的RAM中,在线标定的时候,修改的是RAM中的MAP数据,通过数据查询函数,检测到MAP数据修改后的结果。但是,这种方法也有缺陷:由于单片机片内的RAM容量往往很小,而一些嵌入式系统中需要标定的MAP很多,例如发动机的控制系统ESP、变速箱的控制系统ABS和汽车动力学控制系统TCS等,往往无法把所有的MAP数据从单片机内的FLASH中全部拷贝到单片机内的RAM中。目前,对此常用的解决方法有两种:一是在单片机的外部扩展RAM用于标定,这需要在单片机管脚上把地址总线和数据总线引出,占用了大量的管脚资源,而且会使系统的电磁兼容性恶化,增加系统成本;二是通过分块标定,把所有的标定MAP分块,一次标定只把一块区域的MAP数据拷贝到单片机内的RAM中,因此一次只能标定一块区域内的MAP数据,这种方法局限性很大,事先无法确定一次标定需要修改多少MAP,在MAP分区的时候也就无法选择一种适应整个标定阶段的划分方法,并且需要在多个标定页之间来回切换,而对于这种在线切换,会将先前进行的标定工作丢失。In the field of automotive electronics, most embedded systems use single-chip microcomputers as the control core. Due to the complexity of the control system and the diversity of objects, there are a large number of parameters in the single-chip microcomputer system that cannot be determined during the system design, and need to be determined through matching calibration after the system development is completed. And this kind of matching calibration often uses the calibration tool software on the PC to establish a connection with the single-chip system through a bus-based protocol, and transmits the operations on the calibration tool software to the single-chip microcomputer, and the single-chip microcomputer completes the corresponding operation. On the FLASH in the single-chip microcomputer, these parameters that need to be calibrated are saved, that is, the initial value of the MAP; the operation of the calibration tool software is received through the bus-based protocol, and the data of the MAP is updated; because the value in the FLASH can only be obtained through the FLASH programming software. Update, and when running the FLASH programming software, it is generally impossible to execute the program to read the FLASH at the same time. It is necessary to stop the normal program operation and enter the special FLASH programming module. Therefore, this method cannot support the online calibration of MAP; for this problem, The commonly used solution at present is to copy the MAP data from the FLASH in the MCU to the RAM in the MCU. During online calibration, the MAP data in the RAM is modified. Through the data query function, the modified result of the MAP data is detected. . However, this method also has defects: because the RAM capacity in the single-chip microcomputer is often small, and there are many MAPs that need to be calibrated in some embedded systems, such as the engine control system ESP, the gearbox control system ABS and the vehicle dynamics control system TCS, etc., often cannot copy all MAP data from the FLASH in the single-chip microcomputer to the RAM in the single-chip microcomputer. At present, there are two commonly used solutions to this problem: one is to expand the RAM outside the microcontroller for calibration, which requires the address bus and data bus to be drawn out on the pins of the microcontroller, which takes up a lot of pin resources and will cause The electromagnetic compatibility of the system deteriorates, which increases the system cost; the second is to divide all the calibrated MAP into blocks through block calibration, and only copy the MAP data of one area to the RAM in the single-chip microcomputer for one calibration, so only one area can be calibrated at a time This method has great limitations. It is impossible to determine in advance how many MAPs need to be modified for one calibration. When MAP is partitioned, it is impossible to choose a division method suitable for the entire calibration stage, and it needs to be divided between multiple calibration pages. Switch back and forth between, and for this kind of online switching, the previous calibration work will be lost.

发明内容 Contents of the invention

针对上述问题,本发明的目的是提供一种能够较好地支持单片机系统,特别是小容量RAM单片机系统在线标定的单片机系统MAP数据标定方法。In view of the above problems, the purpose of the present invention is to provide a single-chip system MAP data calibration method that can better support the online calibration of the single-chip system, especially the small-capacity RAM single-chip system.

为实现上述目的,本发明采取以下技术方案:一种单片机系统MAP数据标定方法,其特征在于:它包括以下步骤:To achieve the above object, the present invention takes the following technical solutions: a single-chip microcomputer system MAP data calibration method is characterized in that: it comprises the following steps:

1)在单片机内存中设置若干个区域,包括以下步骤:1) Set up several areas in the single-chip memory, including the following steps:

①根据MAP的数据总量的大小设置一块内存区域,作为标定FLASH;① Set a memory area according to the total amount of data in the MAP as the calibration FLASH;

②根据一次能够标定的MAP数据量的大小设置一块内存区域,作为标定RAM;② Set a memory area according to the size of the MAP data that can be calibrated at one time, as the calibration RAM;

③根据MAP的个数设置一块内存区域,作为信息FLASH;③ Set a memory area according to the number of MAPs as the information FLASH;

④根据MAP的数据总量的大小设置一块内存区域,作为索引FLASH;④ Set a memory area according to the total amount of data in the MAP as the index FLASH;

2)在由步骤1)设置的标定FLASH区域内保存所有MAP的原始数据;2) save the original data of all MAPs in the calibration FLASH area that is set by step 1);

3)通过已有的工具软件获取每个MAP在标定FLASH中存放的起始地址和占用空间大小,将其保存在由步骤1)设置的信息FLASH区域内;3) Obtain the starting address and the occupied space size of each MAP stored in the calibration FLASH through the existing tool software, and store it in the information FLASH area set by step 1);

4)通过已有的工具软件获取标定FLASH区域内每个字节所保存的MAP的索引序号,将其保存在由步骤1)设置的索引FLASH区域内;4) Obtain the index sequence number of the MAP stored in each byte in the calibration FLASH area by existing tool software, and store it in the index FLASH area set by step 1);

5)在系统初始化时,建立并初始化一个MAP指针数组,包括以下步骤:5) When the system is initialized, a MAP pointer array is established and initialized, including the following steps:

①在MAP管理模块中,设置一个指针数组,该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为指针,指向MAP在内存中存放空间的起始地址;① In the MAP management module, set a pointer array, the subscript of the array element is the index number of the MAP, the number of the array elements is the same as the number of the MAP, and the array element is a pointer, pointing to the starting point of the storage space of the MAP in the memory origin address;

②在系统初始化时,根据MAP个数,依次从信息FLASH中获取每个MAP在标定FLASH中的起始地址,然后,将步骤①中的各个MAP指针,分别指向各个MAP在标定FLASH中的起始地址;②When the system is initialized, according to the number of MAPs, the starting address of each MAP in the calibration FLASH is sequentially obtained from the information FLASH, and then each MAP pointer in step ① points to the starting address of each MAP in the calibration FLASH. origin address;

如果需要对MAP数据进行修改,进入步骤6);If you need to modify the MAP data, go to step 6);

如果需要对MAP数据进行查询,进入步骤7);If you need to query the MAP data, go to step 7);

6)在线标定过程中,把正在标定的MAP从单片机内的FLASH拷贝到单片机内的RAM内,在RAM中对相应的数据进行修改,包括以下步骤:6) During the online calibration process, copy the MAP being calibrated from the FLASH in the microcontroller to the RAM in the microcontroller, and modify the corresponding data in the RAM, including the following steps:

①PC机上的标定工具软件与单片机系统建立连接后,在标定工具软件中对一个MAP中的一个数据进行修改,此时,标定工具软件计算该数据点相对于该MAP起始地址的地址偏移,然后根据该MAP在标定FLASH中的起始地址,进一步确定该数据点在标定FLASH中存放的地址,标定工具软件把该地址和修改后的数据发送给单片机;① After the calibration tool software on the PC is connected to the single-chip microcomputer system, modify a data in a MAP in the calibration tool software. At this time, the calibration tool software calculates the address offset of the data point relative to the starting address of the MAP, Then according to the starting address of the MAP in the calibration FLASH, further determine the address of the data point stored in the calibration FLASH, and the calibration tool software sends the address and the modified data to the single-chip microcomputer;

②单片机根据由步骤①标定工具软件发送来的地址,查询索引FLASH内对应地址中所保存的MAP索引序号,然后根据这个索引序号,访问信息FLASH内结构体数组中下标为此索引序号的元素,继而得到该MAP在标定FLASH内的起始地址和占用空间大小;② According to the address sent by the calibration tool software in step ①, the single-chip microcomputer queries the MAP index number stored in the corresponding address in the index FLASH, and then according to the index number, accesses the element with the index number in the structure array in the information FLASH , and then obtain the starting address and occupied space of the MAP in the calibrated FLASH;

③单片机根据步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP指针当前指向的地址:③ According to the MAP index serial number obtained in step ②, the MCU queries the corresponding MAP pointer to obtain the address currently pointed to by the MAP pointer:

如果该地址位于标定FLASH内,进入步骤④;If the address is in the calibrated FLASH, go to step ④;

如果该地址位于标定RAM内,进入步骤⑤;If the address is located in the calibration RAM, go to step ⑤;

④根据步骤②获得的起始地址和占用空间大小,单片机将位于标定FLASH中以该起始地址开始的,相应空间大小内的数据全部拷贝到标定RAM的空白区域中;记录当前标定RAM区域中使用的空间大小;然后修改该MAP的指针,使其指向标定RAM区域内该MAP存放空间的起始地址,进入步骤⑤;④According to the starting address and occupied space obtained in step ②, the microcontroller will be located in the calibrated FLASH starting with the starting address, and all the data in the corresponding space size will be copied to the blank area of the calibrated RAM; record the current calibrated RAM area The size of the space used; then modify the pointer of the MAP to point to the starting address of the MAP storage space in the marked RAM area, and enter step 5;

⑤已知需要修改的数据点在标定FLASH中的存放地址,单片机根据该数据点所在MAP在标定FLASH内的起始地址和在标定RAM内的起始地址,得到该数据点在标定RAM中的存放地址,将该地址内的数据修改为更新后的数据;⑤The storage address of the data point to be modified in the calibration FLASH is known, and the single-chip microcomputer obtains the address of the data point in the calibration RAM according to the start address of the MAP where the data point is located in the calibration FLASH and the start address in the calibration RAM. Store the address, modify the data in the address to the updated data;

7)已知MAP在FLASH中的起始地址和占用空间大小,通过查询相应的MAP指针,得到该MAP当前存放空间的起始地址,从而对以该起始地址开始的,相应空间大小的内存区域中的数据,进行查表插值操作,包括以下步骤:7) Knowing the starting address and occupied space of the MAP in FLASH, by querying the corresponding MAP pointer, the starting address of the current storage space of the MAP is obtained, so as to start with the starting address, the memory of the corresponding space size The data in the area is used for table lookup and interpolation operations, including the following steps:

①单片机把MAP在标定FLASH中的起始地址作为参数传递给查表插值函数;①The single-chip microcomputer passes the starting address of MAP in the calibrated FLASH as a parameter to the look-up table interpolation function;

②查表插值函数根据由步骤①获得的起始地址,查询索引FLASH内对应地址中所保存的MAP索引序号;② The table look-up interpolation function queries the MAP index serial number stored in the corresponding address in the index FLASH according to the starting address obtained by step ①;

③单片机根据由步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP当前存放空间的起始地址;3. the single-chip microcomputer queries the corresponding MAP pointer according to the MAP index serial number obtained by step 2., and obtains the starting address of the current storage space of the MAP;

④基于由步骤③获得的起始地址,对相应空间大小的内存区域中的数据,进行查表插值操作,结束。④ Based on the starting address obtained in step ③, perform a lookup table interpolation operation on the data in the memory area of the corresponding space size, and end.

上述步骤3)中,通过已有的MAP存储分析软件获取每个MAP在标定FLASH中存放的起始地址和占用空间大小。In the above step 3), the starting address and occupied space of each MAP stored in the calibrated FLASH are obtained through the existing MAP storage analysis software.

上述步骤4)中,通过已有的MAP存储分析软件获取标定FLASH区域内每个字节所保存的MAP的索引序号。In the above step 4), the index sequence number of the MAP stored in each byte in the calibration FLASH area is obtained through the existing MAP storage analysis software.

上述步骤4)中,在索引FLASH内,每个字节存放一个索引序号。In the above step 4), in the index FLASH, each byte stores an index sequence number.

上述步骤4)中,当MAP个数大于255时,在索引FLASH内,每两个字节存放一个索引序号。In the above step 4), when the number of MAPs is greater than 255, an index sequence number is stored in every two bytes in the index FLASH.

上述步骤3)中,采用结构体数组保存每个MAP的起始地址和占用空间大小;该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为结构体,包括两个成员:MAP占用空间大小和MAP在标定FLASH内的起始地址。Above-mentioned step 3) in, adopt structure array to save the initial address of each MAP and the occupied space size; The structure includes two members: the space occupied by the MAP and the starting address of the MAP in the calibrated FLASH.

本发明由于采取以上技术方案,其具有以下优点:1、由于本发明只把需要标定的MAP数据在线实时地拷贝到RAM中,从而占用的RAM空间较小,解决了小容量RAM单片机系统标定大量数据的问题。2、由于本发明能够在线标定所有需要标定的MAP数据,解决了现有的因分块标定或RAM空间不够不能一次标定所有MAP的问题。采用本发明可以降低单片机系统的复杂程度和制造成本。The present invention has the following advantages due to the adoption of the above technical scheme: 1, because the present invention only copies the MAP data that needs to be calibrated into the RAM in real time online, thereby occupying less RAM space and solving the problem of a large number of small-capacity RAM single-chip microcomputer system calibrations data problem. 2. Since the present invention can calibrate all MAP data that needs to be calibrated online, it solves the existing problem that all MAPs cannot be calibrated at one time due to block calibration or insufficient RAM space. By adopting the invention, the complexity and manufacturing cost of the single-chip microcomputer system can be reduced.

附图说明 Description of drawings

图1是本发明单片机内存区域划分示意图;Fig. 1 is a schematic diagram of the division of the memory area of the single-chip microcomputer of the present invention;

图2为本发明初始化时的MAP指针示意图;Fig. 2 is the schematic diagram of the MAP pointer when the present invention is initialized;

图3为本发明在线标定时的MAP指针示意图。Fig. 3 is a schematic diagram of the MAP pointer in the online calibration of the present invention.

具体实施方式 Detailed ways

如图1所示,本发明方法包括以下步骤:As shown in Figure 1, the inventive method comprises the following steps:

1)在单片机内存中设置若干个区域;1) Set several areas in the single-chip memory;

2)在单片机内存中保存所有MAP的原始数据;2) Preserve the original data of all MAPs in the single-chip memory;

3)在单片机内存中保存每个MAP的起始地址和占用空间大小;3) Save the starting address and the occupied space size of each MAP in the single-chip memory;

4)在单片机内存中保存每个MAP的索引序号;4) store the index sequence number of each MAP in the single-chip microcomputer memory;

5)在系统初始化时,建立并初始化一个MAP指针数组;5) When the system is initialized, a MAP pointer array is established and initialized;

6)在线标定过程中,把正在标定的MAP从单片机内的FLASH拷贝到单片机内的RAM内,在RAM中对相应的数据进行修改;6) During the online calibration process, copy the MAP being calibrated from the FLASH in the microcontroller to the RAM in the microcontroller, and modify the corresponding data in the RAM;

7)已知MAP在FLASH中的起始地址和占用空间大小,通过查询相应的MAP指针,得到该MAP当前存放空间的起始地址,从而对以该起始地址开始的,相应空间大小的内存区域中的数据,进行查表插值操作。7) Knowing the starting address and occupied space of the MAP in FLASH, by querying the corresponding MAP pointer, the starting address of the current storage space of the MAP is obtained, so as to start with the starting address, the memory of the corresponding space size The data in the area is used for table lookup and interpolation operations.

下面结合附图和实施例对本发明进行详细的描述。The present invention will be described in detail below in conjunction with the accompanying drawings and embodiments.

1)在单片机内存中设置若干个区域,包括以下步骤:1) Set up several areas in the single-chip memory, including the following steps:

①根据MAP的数据总量的大小设置一块内存区域,作为标定FLASH,用于保存所有的MAP数据。① Set a memory area according to the total amount of MAP data, as a calibration FLASH, used to save all MAP data.

在本发明实施例中,如图1所示,将单片机内存中地址0x140000开始的128K空间设置为标定FLASH。In the embodiment of the present invention, as shown in FIG. 1 , the 128K space starting from the address 0x140000 in the memory of the single-chip microcomputer is set as the calibrated FLASH.

②根据一次能够标定的MAP数据量的大小设置一块内存区域,作为标定RAM,用于保存在线标定过程中更新过的MAP最新数据。② According to the amount of MAP data that can be calibrated at one time, set up a memory area as a calibration RAM, which is used to save the latest MAP data updated during the online calibration process.

在本发明实施例中,如图1所示,将单片机内存中地址0x400000开始的64K空间设置为标定RAM。In the embodiment of the present invention, as shown in FIG. 1 , the 64K space starting from the address 0x400000 in the memory of the single-chip microcomputer is set as the calibration RAM.

③根据MAP的个数设置一块内存区域,作为信息FLASH,用于保存每个MAP在标定FLASH中的起始地址和该MAP的占用空间大小。③A memory area is set according to the number of MAPs as the information FLASH, which is used to save the starting address of each MAP in the calibration FLASH and the space occupied by the MAP.

在本发明实施例中,如图1所示,将单片机内存地址0x100000开始的8K空间设置为信息FLASH。In the embodiment of the present invention, as shown in FIG. 1 , the 8K space starting from the memory address 0x100000 of the single-chip microcomputer is set as the information FLASH.

④根据MAP的数据总量的大小设置一块内存区域,作为索引FLASH,用于保存标定FLASH对应地址所存放的MAP的索引序号。④ According to the size of the total amount of data in the MAP, a memory area is set as the index FLASH, which is used to save the index number of the MAP stored in the corresponding address of the calibrated FLASH.

在本发明实施例中,如图1所示,将单片机内存中地址0x160000开始的128K空间设置为索引FLASH。In the embodiment of the present invention, as shown in FIG. 1 , the 128K space starting from the address 0x160000 in the memory of the single-chip microcomputer is set as the index FLASH.

2)在单片机内存中保存所有MAP的原始数据,具体为:2) Save the original data of all MAPs in the single-chip memory, specifically:

在由步骤1)设置的标定FLASH区域内保存所有MAP的原始数据。Save the original data of all MAPs in the calibration FLASH area set by step 1).

3)在单片机内存中保存每个MAP的起始地址和占用空间大小,包括以下步骤:3) Preserving the starting address and the size of the occupied space of each MAP in the single-chip memory, including the following steps:

①通过已有的工具软件,如MAP存储分析软件,获取每个MAP在标定FLASH中存放的起始地址和占用空间大小;① Obtain the starting address and occupied space of each MAP stored in the calibrated FLASH through existing tool software, such as MAP storage analysis software;

②将每个MAP在标定FLASH中的起始地址和占用空间大小保存在由步骤1)设置的信息FLASH区域内。② Save the starting address and occupied space of each MAP in the calibrated FLASH in the information FLASH area set by step 1).

其中,可以采用结构体数组记录每个MAP的起始地址和占用空间大小;该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为结构体,包括两个成员:MAP占用空间大小和MAP在标定FLASH内的起始地址。Among them, a structure array can be used to record the starting address and occupied space of each MAP; the subscript of the array element is the index number of the MAP, the number of array elements is the same as the number of MAP, and the array elements are structures. It includes two members: the space occupied by the MAP and the starting address of the MAP in the calibrated FLASH.

上述结构体中,可以采用一个16位变量记录MAP占用空间大小,采用一个32位变量记录MAP在标定FLASH内的起始地址。In the above structure, a 16-bit variable can be used to record the space occupied by the MAP, and a 32-bit variable can be used to record the starting address of the MAP in the calibrated FLASH.

假设在本发明实施例中,标定FLASH内有6张MAP,第一张MAP(MAP0)保存在0x140000~0x1400FF的范围内,第二张MAP(MAP1)保存在0x140100~0x1401FF的范围内,第三张MAP(MAP2)保存在0x140200~0x1402FF的范围内,第四张MAP(MAP3)保存在0x140300~0x1403FF的范围内,第五张MAP(MAP4)保存在0x140400~0x1404FF的范围内,第六张MAP(MAP5)保存在0x140500~0x1405FF的范围内,这6张MAP对应的MAP序号分别为0、1、2、3、4和5,于是:信息FLASH中的结构体数组相应地包括六个数组元素,数组元素0为{0x100,0x140000}(表示MAP0的大小为0x100,起始地址为0x140000),数组元素1为{0x100,0x140100},数组元素2为{0x100,0x140200},数组元素3为{0x100,0x140300},数组元素4为{0x100,0x140400},数组元素5为{0x100,0x140500}。Suppose in the embodiment of the present invention, there are 6 MAPs in the calibration FLASH, the first MAP (MAP0) is stored in the range of 0x140000~0x1400FF, the second MAP (MAP1) is stored in the range of 0x140100~0x1401FF, and the third MAP is stored in the range of 0x140100~0x1401FF One MAP (MAP2) is stored in the range of 0x140200~0x1402FF, the fourth MAP (MAP3) is stored in the range of 0x140300~0x1403FF, the fifth MAP (MAP4) is stored in the range of 0x140400~0x1404FF, the sixth MAP (MAP5) is stored in the range of 0x140500~0x1405FF, and the MAP serial numbers corresponding to these 6 MAPs are 0, 1, 2, 3, 4 and 5 respectively, so: the structure array in the information FLASH correspondingly includes six array elements , the array element 0 is {0x100, 0x140000} (indicating that the size of MAP0 is 0x100, and the starting address is 0x140000), the array element 1 is {0x100, 0x140100}, the array element 2 is {0x100, 0x140200}, and the array element 3 is { 0x100, 0x140300}, array element 4 is {0x100, 0x140400}, array element 5 is {0x100, 0x140500}.

4)在单片机内存中保存每个MAP的索引序号,包括以下步骤:4) saving the index sequence number of each MAP in the single-chip microcomputer memory, comprising the following steps:

①通过已有的工具软件,如MAP存储分析软件,获取标定FLASH区域内每个字节所保存的MAP的索引序号(从0开始);①Use the existing tool software, such as MAP storage analysis software, to obtain the index number of the MAP stored in each byte in the calibration FLASH area (starting from 0);

②在由步骤1)设置的索引FLASH区域内,以字节为单位存放标定FLASH对应地址所存放的MAP的索引序号。②In the index FLASH area set by step 1), store the index sequence number of the MAP stored in the corresponding address of the calibration FLASH in units of bytes.

其中,如果MAP个数大于255,在索引FLASH内,可以每两个字节存放一个索引序号。Among them, if the number of MAPs is greater than 255, an index sequence number can be stored in every two bytes in the index FLASH.

在本发明实施例中,0x160000~0x1600FF内保存的都是0,0x1600100~0x1601FF内保存的都是1,0x1600200~0x1602FF内保存的都是2,0x1600300~0x1603FF内保存的都是3,0x1600400~0x1604FF内保存的都是4,0x1600500~0x1605FF内保存的都是5。In the embodiment of the present invention, all stored in 0x160000~0x1600FF are 0, stored in 0x1600100~0x1601FF are all 1, stored in 0x1600200~0x1602FF are all 2, stored in 0x1600300~0x1603FF are all 3, 0x1600400~0x1604FF All 4 are stored in 0x1600500~0x1605FF, and 5 are stored in 0x1600500~0x1605FF.

5)在系统初始化时,建立并初始化一个MAP指针数组,包括以下步骤:5) When the system is initialized, a MAP pointer array is established and initialized, including the following steps:

①在MAP管理模块中,设置一个指针数组,该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为指针,指向MAP在内存中存放空间的起始地址,用于表示MAP保存在以该起始地址开始的内存区域内;① In the MAP management module, set a pointer array, the subscript of the array element is the index number of the MAP, the number of the array elements is the same as the number of the MAP, and the array element is a pointer, pointing to the starting point of the storage space of the MAP in the memory The start address is used to indicate that the MAP is stored in the memory area starting with the start address;

②在系统初始化时,根据MAP个数,依次从信息FLASH中获取每个MAP在标定FLASH中的起始地址,然后,将步骤①中的各个MAP指针,分别指向各个MAP在标定FLASH中的起始地址;②When the system is initialized, according to the number of MAPs, the starting address of each MAP in the calibration FLASH is sequentially obtained from the information FLASH, and then each MAP pointer in step ① points to the starting address of each MAP in the calibration FLASH. origin address;

如果需要对MAP数据进行修改,进入步骤6);If you need to modify the MAP data, go to step 6);

如果需要对MAP数据进行查询,进入步骤7)。If the MAP data needs to be queried, go to step 7).

在本发明实施例中,如图2所示,系统初始化后,MAP指针指向的地址依次为:MAP0指针指向0x140000,MAP1指针指向0x140100,MAP2指针指向0x140200,MAP3指针指向0x140300,MAP4指针指向0x140400,MAP5指针指向0x140500。In the embodiment of the present invention, as shown in Figure 2, after the system is initialized, the addresses pointed to by the MAP pointers are successively: the MAP0 pointer points to 0x140000, the MAP1 pointer points to 0x140100, the MAP2 pointer points to 0x140200, the MAP3 pointer points to 0x140300, and the MAP4 pointer points to 0x140400, The MAP5 pointer points to 0x140500.

6)在线标定过程中,把正在标定的MAP从单片机内的FLASH拷贝到单片机内的RAM内,在RAM中对相应的数据进行修改,包括以下步骤:6) During the online calibration process, copy the MAP being calibrated from the FLASH in the microcontroller to the RAM in the microcontroller, and modify the corresponding data in the RAM, including the following steps:

①PC机上的标定工具软件与单片机系统建立连接后,在标定工具软件中对一MAP中的一个数据进行修改,此时,标定工具软件计算该数据点相对于所在MAP起始地址的地址偏移,然后根据该MAP在标定FLASH中的起始地址,进一步确定该数据点在标定FLASH中的存放地址,标定工具软件把该地址和修改后的数据发送给单片机;① After the calibration tool software on the PC is connected to the single-chip microcomputer system, modify a data in a MAP in the calibration tool software. At this time, the calibration tool software calculates the address offset of the data point relative to the starting address of the MAP, Then according to the starting address of the MAP in the calibration FLASH, further determine the storage address of the data point in the calibration FLASH, and the calibration tool software sends the address and the modified data to the single-chip microcomputer;

在本发明实施例中,假设对MAP2中的一个数据点进行修改,标定工具软件计算该点相对于MAP起始地址的地址偏移为0x10,因为MAP2保存在标定FLASH中以地址0x140200开始的内存区域,且修改后的数据为0x66,那么标定工具软件把0x140210和0x66发送给单片机;In the embodiment of the present invention, assuming that a data point in MAP2 is modified, the calibration tool software calculates that the address offset of this point relative to the MAP start address is 0x10, because MAP2 is stored in the memory starting at address 0x140200 in the calibration FLASH area, and the modified data is 0x66, then the calibration tool software sends 0x140210 and 0x66 to the microcontroller;

②单片机根据由步骤①标定工具软件发送来的地址,查询索引FLASH内对应地址中所保存的MAP索引序号,然后根据这个索引序号,访问信息FLASH内结构体数组中下标为此索引序号的元素,继而得到该MAP在标定FLASH内的起始地址和占用空间大小;② According to the address sent by the calibration tool software in step ①, the single-chip microcomputer queries the MAP index number stored in the corresponding address in the index FLASH, and then according to the index number, accesses the element with the index number in the structure array in the information FLASH , and then get the starting address and occupied space of the MAP in the calibrated FLASH;

在本发明实施例中,单片机根据接收到的地址0x140210,查询索引FLASH地址0x160210中所保存的MAP索引序号,该索引序号为2,根据该索引序号,访问信息FLASH内结构体数组中下标为2的元素,继而得到MAP2在标定FLASH内的起始地址0x140200,占用空间大小0x100;In the embodiment of the present invention, according to the received address 0x140210, the single-chip microcomputer queries the MAP index serial number stored in the index FLASH address 0x160210, and the index serial number is 2. According to the index serial number, the subscript in the structure array in the access information FLASH is 2 elements, and then get the starting address 0x140200 of MAP2 in the calibrated FLASH, occupying a space size of 0x100;

③单片机根据步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP指针当前指向的地址:③ According to the MAP index serial number obtained in step ②, the MCU queries the corresponding MAP pointer to obtain the address currently pointed to by the MAP pointer:

如果该地址位于标定FLASH内,进入步骤④;If the address is in the calibrated FLASH, go to step ④;

如果该地址位于标定RAM内,进入步骤⑤;If the address is located in the calibration RAM, go to step ⑤;

④根据步骤②获得的起始地址和占用空间大小,单片机将位于标定FLASH中以该起始地址开始的,相应空间大小内的数据全部拷贝到标定RAM的空白区域中;用一个整型32位的变量,记录当前标定RAM区域中使用的空间大小;然后修改该MAP的指针,使其指向标定RAM区域内该MAP存放空间的起始地址,进入步骤⑤;④According to the starting address and occupied space obtained in step ②, the MCU will start with the starting address in the calibrated FLASH, and copy all the data in the corresponding space size to the blank area of the calibrated RAM; use an integer 32-bit variable to record the size of the space used in the currently calibrated RAM area; then modify the pointer of the MAP to point to the initial address of the MAP storage space in the calibrated RAM area, and enter step ⑤;

⑤已知需要修改的数据点在标定FLASH中的存放地址,单片机根据该数据点所在MAP在标定FLASH内的起始地址和在标定RAM内的起始地址,得到该数据点在标定RAM中的存放地址,将该地址内的数据修改为更新后的数据。⑤The storage address of the data point to be modified in the calibration FLASH is known, and the single-chip microcomputer obtains the address of the data point in the calibration RAM according to the start address of the MAP where the data point is located in the calibration FLASH and the start address in the calibration RAM. Store the address, and modify the data in the address to the updated data.

在本发明实施例中,当前MAP2的指针指向地址0x140200,位于标定FLASH内,单片机把标定FLASH中地址0x140200~0x1402FF内共0x100字节的数据全部拷贝到标定RAM中地址0x400000~0x4001FF的区域内;设置一个整型32位的变量,其值为0x100,表明标定RAM区域中已经使用了0x100字节的空间;然后修改MAP2指针,使其指向0x400000(如图3所示);已知需要修改的数据点在标定FLASH中的存放地址为0x140210,单片机根据该点所在MAP在标定FLASH内的起始地址0x140200和在标定RAM内的起始地址0x400000,得到需要修改的数据点在标定RAM中的存放地址0x400010,然后把地址0x400010内储存的数据修改为0x66。如果在完成上述标定后,在标定工具软件中又修改了MAP2中另一数据点,假设这次需要修改的数据点在标定FLASH中的存放地址为0x140220,修改后的数据为0x55,那么标定工具软件把0x140220和0x55发送给单片机;单片机根据接收到的地址0x140220,查询索引FLASH中地址0x160220内储存的MAP索引序号,该索引序号为2,根据该索引序号,访问信息FLASH内结构体数组中下标为2的元素,继而得到MAP2在标定FLASH内的起始地址0x140200,占用空间大小0x100;查询MAP2指针,由于该指针已经指向了地址0x400000,位于标定RAM内,表明之前已经把该MAP所有的数据从标定FLASH中拷贝到了标定RAM中,所以这次不再需要拷贝原始数据;已知需要修改的数据点在标定FLASH内的存放地址为0x140220,单片机根据该点所在MAP在标定FLASH内的起始地址0x140200和在标定RAM内的起始地址0x400000,得到需要修改的数据点在标定RAM内的存放地址0x400020,然后把地址0x400020内储存的数据修改为0x55。In the embodiment of the present invention, the pointer of the current MAP2 points to the address 0x140200, which is located in the calibrated FLASH, and the single-chip microcomputer copies all the data of 0x100 bytes in the calibrated FLASH address 0x140200~0x1402FF to the area of the calibrated RAM address 0x400000~0x4001FF; Set an integer 32-bit variable with a value of 0x100, indicating that the space of 0x100 bytes has been used in the calibration RAM area; then modify the MAP2 pointer to make it point to 0x400000 (as shown in Figure 3); it is known that it needs to be modified The storage address of the data point in the calibration FLASH is 0x140210, and the single-chip microcomputer obtains the storage of the data point to be modified in the calibration RAM according to the starting address 0x140200 of the MAP where the point is located in the calibration FLASH and the starting address 0x400000 in the calibration RAM address 0x400010, and then modify the data stored in address 0x400010 to 0x66. If after the above calibration is completed, another data point in MAP2 is modified in the calibration tool software, assuming that the storage address of the data point to be modified this time in the calibration FLASH is 0x140220, and the modified data is 0x55, then the calibration tool The software sends 0x140220 and 0x55 to the single-chip microcomputer; the single-chip microcomputer queries the MAP index number stored in the address 0x160220 in the index FLASH according to the received address 0x140220, and the index number is 2. The element marked as 2, and then get the starting address of MAP2 in the calibrated FLASH 0x140200, and the occupied space size is 0x100; query the MAP2 pointer, since the pointer has pointed to the address 0x400000, which is located in the calibrated RAM, it indicates that all the MAP has been set before The data is copied from the calibrated FLASH to the calibrated RAM, so there is no need to copy the original data this time; it is known that the storage address of the data point that needs to be modified is 0x140220 in the calibrated FLASH. Start address 0x140200 and start address 0x400000 in the calibration RAM, get the storage address 0x400020 of the data point to be modified in the calibration RAM, and then modify the data stored in the address 0x400020 to 0x55.

7)已知MAP在FLASH中的起始地址和占用空间大小,通过查询相应的MAP指针,得到该MAP当前存放空间的起始地址,从而对以该起始地址开始的,相应空间大小的内存区域中的数据,进行查表插值操作,包括以下步骤:7) Knowing the starting address and occupied space of the MAP in FLASH, by querying the corresponding MAP pointer, the starting address of the current storage space of the MAP is obtained, so as to start with the starting address, the memory of the corresponding space size The data in the area is used for table lookup and interpolation operations, including the following steps:

①单片机把MAP在标定FLASH中的起始地址作为参数传递给查表插值函数;①The single-chip microcomputer passes the starting address of MAP in the calibrated FLASH as a parameter to the look-up table interpolation function;

②查表插值函数根据由步骤①获得的起始地址,查询索引FLASH内对应地址中所保存的MAP索引序号;② The table look-up interpolation function queries the MAP index serial number stored in the corresponding address in the index FLASH according to the starting address obtained by step ①;

③单片机根据由步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP当前存放空间的起始地址;3. the single-chip microcomputer queries the corresponding MAP pointer according to the MAP index serial number obtained by step 2., and obtains the starting address of the current storage space of the MAP;

④基于由步骤③获得的起始地址,对相应空间大小的内存区域中的数据,进行查表插值操作,结束。④ Based on the starting address obtained in step ③, perform a lookup table interpolation operation on the data in the memory area of the corresponding space size, and end.

在本发明实施例中,如果是对MAP2进行查表插值操作,已知MAP2在FLASH中的起始地址0x140200和占用空间大小0x100,单片机把MAP2在标定FLASH中的起始地址0x140200作为参数传递给查表插值函数,查表插值函数根据该起始地址,在索引FLASH中查询地址0x160200中所保存的MAP索引序号,得到该序号为2,由此得知需要进行操作的是MAP2,查询MAP2指针,得到该MAP当前位于以地址0x400000开始的内存区域内,对以地址0x400000开始的,大小为0x100的内存区域中的MAP数据,进行查表插值操作。如果是对MAP1进行查表插值操作,则已知MAP1在FLASH中的起始地址0x140100和占用空间大小0x100,单片机把MAP1在标定FLASH中的起始地址0x140100作为参数传递给查表插值函数,查表插值函数根据该起始地址,在索引FLASH中查询0x140100中所保存的MAP索引序号,得到该索引序号为1,由此得知需要进行操作的是MAP1,查询MAP1指针,得到该MAP当前位于以地址0x140100开始的内存区域内,对以地址0x140100,大小为0x100的内存区域中的MAP数据,进行查表插值操作。In the embodiment of the present invention, if the look-up table interpolation operation is performed on MAP2, the starting address 0x140200 and the occupied space size of MAP2 in FLASH are known to be 0x100. Table lookup interpolation function, according to the start address, the lookup table interpolation function queries the MAP index serial number stored in the address 0x160200 in the index FLASH, and obtains the serial number as 2, thus knowing that MAP2 needs to be operated, and querying the MAP2 pointer , it is obtained that the MAP is currently located in the memory area starting from address 0x400000, and the table look-up interpolation operation is performed on the MAP data in the memory area starting from address 0x400000 and having a size of 0x100. If the table lookup interpolation operation is performed on MAP1, the starting address of MAP1 in FLASH is 0x140100 and the occupied space size is 0x100. The table interpolation function queries the MAP index number stored in 0x140100 in the index FLASH according to the start address, and obtains that the index number is 1, thus knowing that the operation needs to be performed is MAP1, querying the MAP1 pointer, and obtaining that the MAP is currently located at In the memory area starting with address 0x140100, perform a table look-up interpolation operation on the MAP data in the memory area with address 0x140100 and size 0x100.

上述实施例仅用于说明本发明,其中各个步骤的具体实施方式等都是可以有所变化的,凡是在本发明技术方案的基础上进行的等同变换和改进,均不应排除在本发明的保护范围之外。The above-described embodiments are only used to illustrate the present invention, and the specific implementation manners of each step etc. all can be changed to some extent, and all equivalent transformations and improvements carried out on the basis of the technical solutions of the present invention should not be excluded from the scope of the present invention. outside the scope of protection.

Claims (5)

1.一种单片机系统MAP数据标定方法,其特征在于:它包括以下步骤:1. a single-chip system MAP data calibration method is characterized in that: it may further comprise the steps: 1)在单片机内存中设置若干个区域,包括以下步骤:1) Set up several areas in the microcontroller memory, including the following steps: ①根据MAP的数据总量的大小设置一块内存区域,作为标定FLASH;① Set a memory area according to the total amount of data in the MAP as the calibration FLASH; ②根据一次能够标定的MAP数据量的大小设置一块内存区域,作为标定RAM;② Set a memory area according to the size of the MAP data that can be calibrated at one time, as the calibration RAM; ③根据MAP的个数设置一块内存区域,作为信息FLASH;③ Set a memory area according to the number of MAPs as the information FLASH; ④根据MAP的数据总量的大小设置一块内存区域,作为索引FLASH;④ Set a memory area according to the total amount of data in the MAP as the index FLASH; 2)在由步骤1)设置的标定FLASH区域内保存所有MAP的原始数据;2) Save the original data of all MAPs in the calibrated FLASH area set by step 1); 3)通过已有的MAP存储分析软件获取每个MAP在标定FLASH中存放的起始地址和占用空间大小,将其保存在由步骤1)设置的信息FLASH区域内;3) Obtain the starting address and occupied space of each MAP stored in the calibration FLASH through the existing MAP storage analysis software, and save them in the information FLASH area set by step 1); 4)通过已有的MAP存储分析软件获取标定FLASH区域内每个字节所保存的MAP的索引序号,将其保存在由步骤1)设置的索引FLASH区域内;4) Obtain the index number of the MAP stored in each byte in the calibration FLASH area through the existing MAP storage analysis software, and save it in the index FLASH area set by step 1); 5)在系统初始化时,建立并初始化一个MAP指针数组,包括以下步骤:5) When the system is initialized, create and initialize a MAP pointer array, including the following steps: ①在MAP管理模块中,设置一个指针数组,该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为指针,指向MAP在内存中存放空间的起始地址;① In the MAP management module, set a pointer array, the subscript of the array element is the index number of the MAP, the number of the array elements is the same as the number of the MAP, and the array element is a pointer, pointing to the starting point of the storage space of the MAP in the memory origin address; ②在系统初始化时,根据MAP个数,依次从信息FLASH中获取每个MAP在标定FLASH中的起始地址,然后,将步骤①中的各个MAP指针,分别指向各个MAP在标定FLASH中的起始地址;②When the system is initialized, according to the number of MAPs, the starting address of each MAP in the calibration FLASH is sequentially obtained from the information FLASH, and then each MAP pointer in step ① points to the starting address of each MAP in the calibration FLASH. origin address; 如果需要对MAP数据进行修改,进入步骤6);If you need to modify the MAP data, go to step 6); 如果需要对MAP数据进行查询,进入步骤7);If you need to query the MAP data, go to step 7); 6)在线标定过程中,把正在标定的MAP从单片机内的FLASH拷贝到单片机内的RAM内,在RAM中对相应的数据进行修改,包括以下步骤:6) During the online calibration process, copy the MAP being calibrated from the FLASH in the microcontroller to the RAM in the microcontroller, and modify the corresponding data in the RAM, including the following steps: ①PC机上的标定工具软件与单片机系统建立连接后,在标定工具软件中对一个MAP中的一个数据进行修改,此时,标定工具软件计算该数据点相对于该MAP起始地址的地址偏移,然后根据该MAP在标定FLASH中的起始地址,进一步确定该数据点在标定FLASH中存放的地址,标定工具软件把该地址和修改后的数据发送给单片机;① After the calibration tool software on the PC is connected to the single-chip microcomputer system, modify a data in a MAP in the calibration tool software. At this time, the calibration tool software calculates the address offset of the data point relative to the starting address of the MAP, Then according to the starting address of the MAP in the calibration FLASH, further determine the address of the data point stored in the calibration FLASH, and the calibration tool software sends the address and the modified data to the single-chip microcomputer; ②单片机根据由步骤①标定工具软件发送来的地址,查询索引FLASH内对应地址中所保存的MAP索引序号,然后根据这个索引序号,访问信息FLASH内结构体数组中下标为此索引序号的元素,继而得到该MAP在标定FLASH内的起始地址和占用空间大小;② According to the address sent by the calibration tool software in step ①, the single-chip microcomputer queries the MAP index number stored in the corresponding address in the index FLASH, and then according to the index number, accesses the element with the index number in the structure array in the information FLASH , and then get the starting address and occupied space of the MAP in the calibrated FLASH; ③单片机根据步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP指针当前指向的地址:③ According to the MAP index serial number obtained in step ②, the MCU queries the corresponding MAP pointer to obtain the address currently pointed to by the MAP pointer: 如果该地址位于标定FLASH内,进入步骤④;If the address is in the calibrated FLASH, go to step ④; 如果该地址位于标定RAM内,进入步骤⑤;If the address is located in the calibration RAM, go to step ⑤; ④根据步骤②获得的起始地址和占用空间大小,单片机将位于标定FLASH中以该起始地址开始的,相应空间大小内的数据全部拷贝到标定RAM的空白区域中;记录当前标定RAM区域中使用的空间大小;然后修改该MAP的指针,使其指向标定RAM区域内该MAP存放空间的起始地址,进入步骤⑤;④According to the starting address and occupied space obtained in step ②, the microcontroller will be located in the calibrated FLASH starting with the starting address, and all the data in the corresponding space size will be copied to the blank area of the calibrated RAM; record the current calibrated RAM area The size of the space used; then modify the pointer of the MAP to point to the starting address of the MAP storage space in the marked RAM area, and enter step 5; ⑤已知需要修改的数据点在标定FLASH中的存放地址,单片机根据该数据点所在MAP在标定FLASH内的起始地址和在标定RAM内的起始地址,得到该数据点在标定RAM中的存放地址,将该地址内的数据修改为更新后的数据;⑤The storage address of the data point to be modified in the calibration FLASH is known, and the single-chip microcomputer obtains the address of the data point in the calibration RAM according to the start address of the MAP where the data point is located in the calibration FLASH and the start address in the calibration RAM. Store the address, modify the data in the address to the updated data; 7)已知MAP在FLASH中的起始地址和占用空间大小,通过查询相应的MAP指针,得到该MAP当前存放空间的起始地址,从而对以该起始地址开始的,相应空间大小的内存区域中的数据,进行查表插值操作,包括以下步骤:7) Knowing the starting address and space occupied by the MAP in FLASH, by querying the corresponding MAP pointer, the starting address of the current storage space of the MAP is obtained, so as to start with the starting address, the memory of the corresponding space size The data in the area is used for table lookup and interpolation operations, including the following steps: ①单片机把MAP在标定FLASH中的起始地址作为参数传递给查表插值函数;①The single-chip microcomputer passes the starting address of MAP in the calibrated FLASH as a parameter to the look-up table interpolation function; ②查表插值函数根据由步骤①获得的起始地址,查询索引FLASH内对应地址中所保存的MAP索引序号;② The table look-up interpolation function queries the MAP index serial number stored in the corresponding address in the index FLASH according to the starting address obtained by step ①; ③单片机根据由步骤②获得的MAP索引序号,查询相应的MAP指针,得到该MAP当前存放空间的起始地址;3. the single-chip microcomputer queries the corresponding MAP pointer according to the MAP index serial number obtained by step 2., and obtains the starting address of the current storage space of the MAP; ④基于由步骤③获得的起始地址,对相应空间大小的内存区域中的数据,进行查表插值操作,结束。④ Based on the starting address obtained in step ③, perform a lookup table interpolation operation on the data in the memory area of the corresponding space size, and end. 2.如权利要求1所述的一种单片机系统MAP数据标定方法,其特征在于:所述步骤4)中,在索引FLASH内,每个字节存放一个索引序号。2. A single-chip microcomputer system MAP data calibration method according to claim 1, characterized in that: in the step 4), in the index FLASH, each byte stores an index number. 3.如权利要求1所述的一种单片机系统MAP数据标定方法,其特征在于:所述步骤4)中,当MAP个数大于255时,在索引FLASH内,每两个字节存放一个索引序号。3. A single-chip system MAP data calibration method as claimed in claim 1, characterized in that: in said step 4), when the number of MAPs is greater than 255, an index is stored every two bytes in the index FLASH serial number. 4.如权利要求2所述的一种单片机系统MAP数据标定方法,其特征在于:所述步骤4)中,当MAP个数大于255时,在索引FLASH内,每两个字节存放一个索引序号。4. A single-chip system MAP data calibration method as claimed in claim 2, characterized in that: in said step 4), when the number of MAPs is greater than 255, an index is stored every two bytes in the index FLASH serial number. 5.如权利要求1或2或3或4任一项所述的一种单片机系统MAP数据标定方法,其特征在于:所述步骤3)中,采用结构体数组保存每个MAP的起始地址和占用空间大小;该数组元素的下标为MAP的索引序号,数组元素的个数与MAP的个数相同,数组元素为结构体,包括两个成员:MAP占用空间大小和MAP在标定FLASH内的起始地址。5. A single-chip system MAP data calibration method as claimed in any one of claims 1 or 2 or 3 or 4, characterized in that: in the step 3), a structure array is used to store the starting address of each MAP and the size of the occupied space; the subscript of the array element is the index number of the MAP, the number of the array elements is the same as the number of the MAP, and the array element is a structure, including two members: the size of the MAP occupied space and the MAP within the calibrated FLASH The starting address of .
CN201110277714.3A 2011-09-19 2011-09-19 A Calibration Method of MAP Data in Single Chip Microcomputer System Active CN102446138B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110277714.3A CN102446138B (en) 2011-09-19 2011-09-19 A Calibration Method of MAP Data in Single Chip Microcomputer System

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110277714.3A CN102446138B (en) 2011-09-19 2011-09-19 A Calibration Method of MAP Data in Single Chip Microcomputer System

Publications (2)

Publication Number Publication Date
CN102446138A CN102446138A (en) 2012-05-09
CN102446138B true CN102446138B (en) 2014-02-19

Family

ID=46008645

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110277714.3A Active CN102446138B (en) 2011-09-19 2011-09-19 A Calibration Method of MAP Data in Single Chip Microcomputer System

Country Status (1)

Country Link
CN (1) CN102446138B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714789B (en) * 2013-12-14 2018-08-03 中国航空工业集团公司第六三一研究所 A kind of design of nominal data storage method
CN109656607A (en) * 2019-01-03 2019-04-19 广西玉柴机器股份有限公司 A kind of full address scaling method that supporting super large nominal data amount and system
CN109871001B (en) * 2019-03-06 2023-04-18 普华基础软件股份有限公司 Method for calibrating large data volume of engine
CN111596863B (en) * 2020-05-20 2023-04-07 歌尔科技有限公司 Data reading method, device and equipment and readable storage medium
CN113190471B (en) * 2021-06-30 2021-09-28 飞天诚信科技股份有限公司 Method and device for managing mnemonics
CN114238159A (en) * 2021-12-17 2022-03-25 潍柴动力股份有限公司 Data calibration method, device, storage medium and electronic device for single-chip microcomputer

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5895487A (en) * 1996-11-13 1999-04-20 International Business Machines Corporation Integrated processing and L2 DRAM cache
CN1558334A (en) * 2004-01-16 2004-12-29 中兴通讯股份有限公司 Single-chip microcomputer background debug system and method
CN1580987A (en) * 2004-05-17 2005-02-16 清华大学 Method for electronic control unit for expanding single CAN bus module into double CAN
US7290116B1 (en) * 2004-06-30 2007-10-30 Sun Microsystems, Inc. Level 2 cache index hashing to avoid hot spots
US7571284B1 (en) * 2004-06-30 2009-08-04 Sun Microsystems, Inc. Out-of-order memory transactions in a fine-grain multithreaded/multi-core processor
CN101853630A (en) * 2010-03-27 2010-10-06 安徽师范大学 A RAM-mapped LED display drive system
CN101944011A (en) * 2010-06-29 2011-01-12 北京中星微电子有限公司 Device, chip and method for running program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI284806B (en) * 2003-02-27 2007-08-01 Mediatek Inc Method for managing external memory of a processor and chip for managing external memory

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5895487A (en) * 1996-11-13 1999-04-20 International Business Machines Corporation Integrated processing and L2 DRAM cache
CN1558334A (en) * 2004-01-16 2004-12-29 中兴通讯股份有限公司 Single-chip microcomputer background debug system and method
CN1580987A (en) * 2004-05-17 2005-02-16 清华大学 Method for electronic control unit for expanding single CAN bus module into double CAN
US7290116B1 (en) * 2004-06-30 2007-10-30 Sun Microsystems, Inc. Level 2 cache index hashing to avoid hot spots
US7571284B1 (en) * 2004-06-30 2009-08-04 Sun Microsystems, Inc. Out-of-order memory transactions in a fine-grain multithreaded/multi-core processor
CN101853630A (en) * 2010-03-27 2010-10-06 安徽师范大学 A RAM-mapped LED display drive system
CN101944011A (en) * 2010-06-29 2011-01-12 北京中星微电子有限公司 Device, chip and method for running program

Also Published As

Publication number Publication date
CN102446138A (en) 2012-05-09

Similar Documents

Publication Publication Date Title
CN102446138B (en) A Calibration Method of MAP Data in Single Chip Microcomputer System
CN102792285B (en) For the treatment of the apparatus and method of data
TWI544334B (en) Data storage device and operating method thereof
US7447870B2 (en) Device for identifying data characteristics for flash memory
CN105830022B (en) The method and apparatus for accessing file
US9405703B2 (en) Translation lookaside buffer
US9594675B2 (en) Virtualization of chip enables
EP3090346A1 (en) System and method to defragment a memory
CN101872326A (en) A data storage management method of OTP flash memory in an embedded environment
WO2020140354A1 (en) Full address calibration method and system supporting ultra-large calibration data volume
CN106020735A (en) Data storage method and data storage device
CN109871001B (en) Method for calibrating large data volume of engine
WO2019047142A1 (en) Method for program patching, device, micro control unit, and terminal device
CN103761060B (en) Data processing method and server
CN112003960B (en) Network interface management method, device and electronic device of industrial control equipment
EP3232320A1 (en) Transaction conflict detection method and apparatus and computer system
EP4330811A1 (en) Memory patching with associative and directly mapped patch data
CN115658588B (en) ID compression device and method of AXI bus
US11755211B2 (en) Overhead reduction in data transfer protocol for NAND memory
CN103117075B (en) Magnetic disk block detection method and device
JP2018502392A (en) Method for a master device to access a plurality of slave devices with registers over a network
CN117667789A (en) Data processing system for discrete DMA data access
CN109614349B (en) Cache management method based on binding mechanism
KR101470158B1 (en) Calibration apparatus and method thereof
CN104699721B (en) A kind of high-volume industrial data organizes and implements method

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