Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 12th February 2005, 08:23 PM   (permalink)
Default delay program

hi every one
i have a 89c51 microcontroller and i need to make a program to make a delay for 1ms would u help me plz ops:
Peter Nabil is offline  
Old 13th February 2005, 10:37 AM   (permalink)
Default Dear Peter

in order to calculate the time delay you have to tell us what is the speed of your crystal oscillator that you use
Josephselim is offline  
Old 13th February 2005, 11:07 AM   (permalink)
Default

For 8051's you should asume 12 clocks per instruction. So If you have 51 running @ 12Mhz, it gives you 1us per instruction. Just make a program that will have 1000 instructions to make 1ms delay. Use DJNZ and JMP instructions...
__________________
"I share, thus I am"
Jay.slovak
Read this!
ICD2 Clone
Best PIC/DsPIC Bootloader

Read my Inchworm ICD2 review!
Jay.slovak is offline  
Old 14th February 2005, 02:01 AM   (permalink)
Default

Just use a timer - this sort of stuff is why they're put into microcontrollers.
bmcculla is offline  
Old 14th February 2005, 05:35 PM   (permalink)
Default

Hi Josephselim,Jay.slovak( nice photo by the way )and bmcculla

thanks for your support but i managed to do a one second delay using NOP instructions thank u again bye
Peter Nabil is offline  
Old 14th February 2005, 06:55 PM   (permalink)
Default

BTW, How many NOPs did you use? Because 1s = 1000000 NOPs ! Or have you used a cycle....? Just curious.
__________________
"I share, thus I am"
Jay.slovak
Read this!
ICD2 Clone
Best PIC/DsPIC Bootloader

Read my Inchworm ICD2 review!
Jay.slovak is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:08 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker