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.

Pic16f877a

Status
Not open for further replies.

Mortalo

New Member
Hi, how're all of you doing ?

I have a question regarding delays.
How can i calculate the exact time that i use in a delay, without using
any timer ?

This is a function that i made a little time ago for program.

delay
movlw 0xfff
movwf Cont1
again
movlw 0xff
movwf Cont2
loop
decf Cont2
movlw 0x00
xorwf Cont2
btfss STATUS,Z
goto loop
decf Cont1
movlw 0x00
xorwf Cont1
btfss STATUS,Z
goto again

return

I want to know this because i have to use a LCD for a project and on top of that i dont know how to use one yet :confused:
So i was reading that i need to use some delays for initializations
and if im going to do those delays i want to do it like the example
that i wrote up there without using a Timer.

And i would like to know how to do it if im going to use a delay of 5ms, 20ms for example.

Thank you again.
 
You can also use the stopwatch in MPLABs simulator. However, your movlw 0xfff instruction is going to cause an error.

Mike.
 
FUTZ...
Quick, Easy and Practical...
You rule.

Pommie
Nope it didnt make any errors when i did it.
Stop watch ??? thats something you use in MPLAB or something that you san use with PIC16f877a ?
 
If you use MPLAB then you can use the simulator. In the sim you can set break points and time how long your code takes. Have a read up on the Microchip Simulator.

Mike.
 
Status
Not open for further replies.

Latest threads

Back
Top