| In many high reliability system, the designer will protect the memory by coding via hardware, its implementation is mainly that adding some additional data parity and encoding and decoding circuit. However, in certain space electronic equipment, there does not have the hardware conditions when the software implemented coding method could protect data in memory. Software implemented protection method saves extra hardware cost and power consumption, but because of its occupation of computing resources, when using it one should be control the time overheads well, so as not to cause too much serious performance loss. In terms of memory space overhead, the redundancy caused by parities generated by encoding the data is much less than that of double calculation, so it is quite suitable to use data encoding protection where space overhead restrictions is quite harsh or hardware conditions are limited.The code and data in memory has played a vital role to the correctness of program execution, so it is necessary to check the key data in memory at run time. Checking the data with coding method gives the advantage of little overhead and rapid error checking which is suitable to be applied in real-time kernel. But because of the running time of the encoding methods is limited by the speed of memory data reading, when large amounts of data being checked, the lifecycle is longer. Completing coding to check in the kernel will lead to serious problem of real-time performance.This article put forward a kind of low cost and high reliability DSP memory protection scheme, which checks and restores the memory on the DSP with lower time overhead and space overhead. Specifically, this article adopts(39,32) optimal odd weighted code as the coding scheme, then gives the efficient implementation in the linear assembly language focusing on the system structure of DSP, and then puts forward a coding mechanism of stack section and code section based on real-time operating system, namely by adding checking tasks of lower priority, using the system of free time to encode the code section and the stack section. By analyzing the experimental result, it shows that the scheme will not affect the real-time performance of the original system while making a remarkable improvement to the system’s reliability. |