![]() ![]() This example describes how the watch-dog timer should not operate. MOV P1,#0FFh All pins are configured as inputsĮND End of program Using Watch-dog Timer XRESET: MOV SP,#STACK_START Define Stack pointer * DESCRIPTION: Program turns on/off LED on the pin P1.0 ![]() After returning from the subroutine, the pin state is inverted and the same procedure is repeated. It is a triple loop in which the program remains for approximately 0.5 seconds and decrements values stored in registers R0, R1 or R2. ![]() In this example time delay is provided by executing a subroutine called Delay. Simply put, in order to enable LED blinking to be visible, it is necessary to provide sufficient amount of time to pass between on/off states of LEDs. The purpose of this example is not to demonstrate the operation of LEDs, but the operating speed of the microcontroller. These are used to indicate the operation of the program.Īll LEDs are polarized in such a way that they are activated by driving a microcontroller pin low (logic 0). The schematic below is used in the several following examples:Īpart from components necessary for the operation of the microcontroller such as oscillator with capacitors and the simplest reset circuit, there are also several LEDs and one push button.
0 Comments
Leave a Reply. |