Realize software reset scheme with C51 single chip

How do I implement a software reset in my source program?

We know that 51 MCU can put data in the program memory, that is, there is no essential difference between the program and the data, and it is some specific data. If we store a program in the form of array data in the program memory, can it be executed? The answer is yes.

answer:

You can use the following program to jump to 0000H to implement a soft reset. The following program is actually a function pointer pointing to the 0000H address.

((void (code *) (void)) 0x0000) ();

The following example will implement software self-reset void reset (void)

{

((void (code *) (void)) 0x0000) ();

}

Void main (void)

{

Reset ();

}

You may notice that the above soft reset program does not clear the 8051 interrupt system and some 8051 peripherals. When you call the above software reset program in the interrupt program, the interrupt will not be triggered. Therefore, the above soft reset program cannot be called in the interrupt subroutine.

The following small assembly function can be called in the interrupt program or the main program. This function pushes 0x0000 onto the stack and then pops it out via "RETI". This will clear the interrupt environment and let the program restart from 0000H.

Realize software reset scheme with C51 single chip

The above program works well when selecting the bank 0 register set. If the bank0 register set is not selected, the expected result may not be obtained. You should select "MOV PSW, #0" in the above program or startup code to select the bank 0 register set.

Disposable Vape Pen

Tobacco control has been a common global concern, while the traditional tobacco industry gradually, new tobacco has become the new strategic layout of tobacco giants. In this context, the emergence of e-cigarettes has further led to the replacement of traditional tobacco. At present, there are already a thousand different types of e-cigarettes, which have undergone several stages of development. The e-cigarette we are introducing today is the CBD pod systewm, a new type of e-cigarette. In this article we will combine the characteristics of the CBD with a brief analysis of it.


·Anti-anxiety

According to scientific studies,CBD can help depressed patients reduce their anxiety. The use of CBD can help maintain endogenous cannabinoids at a reasonable level, making the patient feel good and happy physically, and without any dependence.

·Anti-ageing

CBD is very powerful in anti-ageing. As a non-psychoactive component of the cannabis plant CBD inhibits the glutamate toxic response of cortical neurons and suppresses excessive oxidative stress, helping the body to achieve anti-ageing effects.

·Anti-inflammatory

CBD reduces the free radicals that cause neurodegenerative diseases and reduces swelling through its anti-inflammatory effects. In addition, CBD stimulates appetite and relieves pain.

China Disposble Vape Pen,E-Cigarette Cbd Vaporizer,Best Disposable Cbd Vape Pen,Disposable Cbd Vape

Shenzhen MASON VAP Technology Co., Ltd. , https://www.cbdvapefactory.com