![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| in order to calculate the time delay you have to tell us what is the speed of your crystal oscillator that you use | |
| |
| | (permalink) |
| 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! | |
| |
| | (permalink) |
| Just use a timer - this sort of stuff is why they're put into microcontrollers. | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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! | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |