Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Secure Design Using a Microcontroller (II)

Secure Design Using a Microcontroller (II)

Ratings:

4.5

(2)
|Views: 48 |Likes:
Published by Ionela
The software trap is a programming feature used to capture an abnormal program running status. The general principle is to setup a trap for software, and redirect from the code out of control to a specified address, and get back to its normal running mode. The software traps can be placed between the user codes or after the jump instructions, or be placed in the unused space by a consecutive trap codes. The most popular trap code for 80C51 is 5 byte instruction, which is:
The software trap is a programming feature used to capture an abnormal program running status. The general principle is to setup a trap for software, and redirect from the code out of control to a specified address, and get back to its normal running mode. The software traps can be placed between the user codes or after the jump instructions, or be placed in the unused space by a consecutive trap codes. The most popular trap code for 80C51 is 5 byte instruction, which is:

More info:

Published by: Ionela on Jul 09, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/16/2009

pdf

text

original

 
Secure Design Using a Microcontroller (II)http://dev.emcelettronica.com/print/518281 din 209.07.2008 12:59
Your Electronics Open Source
(http://dev.emcelettronica.com)
Home > Blog > allankliu's blog > Content
Secure Design Using a Microcontroller (II)
By allankliuCreated 08/07/2008 - 11:33
BLOG Microcontrollers
Software Traps
The software trap is a programming feature used tocapture an abnormal program running status. The generalprinciple is to setup a trap for software, and redirect fromthe code out of control to a specified address, and getback to its normal running mode. The software traps canbe placed between the user codes or after the jumpinstructions, or be placed in the unused space by aconsecutive trap codes. The most popular trap code for80C51 is 5 byte instruction, which is :0x00: NOP0x00: NOP0x200000: LJMP SWRST, SWRST is 0x0000The purpose is quite clear. When the code is running outof order, the code will jump to this trap area sooner orlater. If the code runs to the LJMP SWRST, it will jumps to the very beginning of the wholesystem to perform a software triggered reset, and the system can be restored to a normalworking mode. The leading two NOPs are used to synchronize the code to the LJMP code.PS, actually it is not a 5 byte trap, it is a 3 byte trap, but the first trap code must be 5 byte,because the consecutive trap is 0x00 0x00 0x20 0x00 0x00 0x20 0x00 0x00 ..., instead of 0x000x00 0x20 0x00 0x00 0x00 0x00 0x20 0x00 0x00.There is another trap method with 4 byte instruction. It is:0x00: NOP0x200020: LJMP 0x0020At the address of 0x0020, which stands for trap vector, we can put AJMP trap hander here. The0x0020 of 80C51 is a spare code between T1 interrupt vector (0x001B) and SCON interruptvector (0x0023). It is enough to put both T1 handler and trap code here. Actually 4 bytes areused. This approach is a little complex than the first one with additional code placed at 0x0020.But the initial requirement for this approach is one byte less and in some critical application one

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->