Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Program For Detrmine Delay Parametrs

Status
Not open for further replies.

besho741

New Member
peace for all of you
that is first try of me to help assembly programmers
it was so difficult for me to determine prametrs of delay before i decide
to make this program no its so easy with any clk frequancy
note the program calculate delay starting from call inst. to return inst.
to make delay
>>>
CALL DELAY
>>>
DELAY......MOVLW D'P1'
...............MOVWF T1
LP3..........MOVLW D'P2
...............MOVWF T2
LP2..........MOVLW D'P3'
...............MOVWF T3
LP1..........DECFSZ T3,1
...............GOTO ...LP1
...............DECFSZ T2,1
...............GOTO ...LP2
...............DECFSZ T1,1
...............GOTO ...LP3
...............NOP (MAY BE NOT EXIST IF 0 )
...............RETURN
note
in the program you use accurecy when you cann't get p1,p2,p3
as you increase accurecy as more nop instruction you put in delay as less time to find parameters
clk is in mhz not in htz
 

Attachments

  • Project1.zip
    5.6 KB · Views: 194
Your first port of call for all things PIC should be the PICList, they even have an on-line delay code generator - you simply tell it your clock frequency, the delay you require, and it generates the code for you. I use it all the time :)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top