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.

pic 16f876 delay routine

Status
Not open for further replies.

kenobe

New Member
Hi
I am working on a 16f876 data acquisition project.
I need a short assembly delay routine which can produce delay of 1 ms to 100 ms. I have search the net and do not get one.
Can someone pls tell me how to do it ? .
I am not using timer interrupt.
Thanks
 
delay

HI gremcc

Thanks for your help, I have visited the site and got the codes.
But my problem is how do I transform these codes into a assembly routine so that I can call it from a C program.
I will appreciate very mush if you can help me in this.
Thanks
 
If your using C, then there should be a 'pre-made' routine to perform a delay. Coming from a PIC Basic perspective its something like

Code:
DelaymS(100)                ' Delay for 100 mS

However, if you want to place assembler code in your program, then check your compilers help file, search for "asm", and it should look something like this

Code:
While 1 = 1

     Gosub Assembler_Code

Wend


Assembler_Code:
[INDENT][ASM]
'ASM Code goes here
'
[ENDASM]

Return[/INDENT]
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top