Home Login Sign Up Blogs & Articles Jobs Mobiles & Tablets Online Calculators Engineering Projects List Groomix Enterprises Publish your topics Ask Question About Blogs & Articles Feedback

programming

views : 215

Assembly program for accurate 1 second delay function

Delay function plays very important role in the accuracy of any embedded program code. So care must be take in coding a delay function. Delay function is depend on microcontroller architecture, oscillator input, crystal and many more.

Code for accurate 1 second delay function

;======================= DELAY 1 SEC ================ 

DELAY_1S DELAY_1S:

MOV r7,#1    ;Value of R7=no. of second delay for 12Mhz(1.0003S ACCURATE)
D1S0:   MOV r6,#0ffh
D1S1:   MOV  r5,#245
D1S2:   NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        NOP
        DJNZ r5,D1S2
        DJNZ r6,D1S1
        DJNZ r7,D1S0
        RET

Note : You can chance the value of r7 to get different value of delay. The delay function can be use in many different processors / microcontrollers (ATMEL, PIC microchip, Dallas, NXN Philips...) . Also not that is function is code for 12Mhz frequency, for different frequency, different value of register will be need to calculate.

Posted By :
Mr. Unique

2016-08-09/23:27:29

Share this Page

Comments...

Please, Login to comment or reply

More :programming

programming
Arduino UNO tachometer coding with variable resistor and DC motor speed control

p

programming
Here is the code to interface 2 serial devices with AVR

p

programming
Software Uart for AVR microcontroller tested on 1200 baud rate

p

programming
ATMEL STUDIO-While loop conditioning issues

p

programming
ATMEL STUDIO-While loop is not working using interrupt incremented conditioning

p

programming
Copy and paste code for facebook share button in your websites
programming
How to program atmel 8051 family microcontroller? (step by step)
programming
Embedded program code in C language for Digital Voltmeter for AVR microcontroller
programming
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
programming
Very simple and accurate Seven Segment Display program Code in Embedded C language

p

programming
Highway vehicle speed detector or checker Embedded C language code in MikroC AVR Framework also applicable for 8051 Microcontroller

p

programming
Assembly program for accurate 1 second delay function
programming
What is Embedded system programming?

Latest Updates

programming
Arduino UNO tachometer coding with variable resistor and DC motor speed control
views :282

p

programming
Here is the code to interface 2 serial devices with AVR
views :224

p

programming
Software Uart for AVR microcontroller tested on 1200 baud rate
views :913

p

programming
ATMEL STUDIO-While loop conditioning issues
views :326

p

programming
ATMEL STUDIO-While loop is not working using interrupt incremented conditioning
views :347

p

programming
Copy and paste code for facebook share button in your websites
views :371
programming
How to program atmel 8051 family microcontroller? (step by step)
views :443
programming
Embedded program code in C language for Digital Voltmeter for AVR microcontroller
views :447
programming
Assemby program code for Automatic Door Opening System (8051 family microcontroller)
views :330
programming
Very simple and accurate Seven Segment Display program Code in Embedded C language
views :287

p

programming
Highway vehicle speed detector or checker Embedded C language code in MikroC AVR Framework also applicable for 8051 Microcontroller
views :222

p

programming
Assembly program for accurate 1 second delay function
views :215
programming
What is Embedded system programming?
views :272

Reach Us From Google Map

DO MORE WITH US

PRODUCT CATEGORY