| ??? 03/16/07 04:07 Read: times |
#135072 - Help with the delay program |
The program using keil software, and it about delay 1 second, then the AT89S51 microprocessor's port1 will light on the led.
But it's seem doesn't work Is my program have any mistake? Thank you~ #include <stdio.h> #include <regx51.h> void delay() { #pragma asm call dy500ms call dy500ms dy500ms: mov r2, #250 dy500: call dy500us call dy500us call dy500us call dy500us djnz r2, dy500 ret dy500us: mov r0,#248 djnz r0,$ nop ret #pragma endasm } void main(void) { delay(); P1=0x00; } |
| Topic | Author | Date |
| Help with the delay program | 01/01/70 00:00 | |
| What does it do? | 01/01/70 00:00 | |
| Hints. | 01/01/70 00:00 | |
| Check with debugger | 01/01/70 00:00 | |
| could this be it ? | 01/01/70 00:00 | |
| Difficult to see | 01/01/70 00:00 | |
| that depends | 01/01/70 00:00 | |
| RET in main | 01/01/70 00:00 | |
| nope - and compiler dependent | 01/01/70 00:00 | |
| RET in functions | 01/01/70 00:00 | |
| how do you know that ? | 01/01/70 00:00 | |
| Because of Startup | 01/01/70 00:00 | |
| ah | 01/01/70 00:00 | |
| some contra | 01/01/70 00:00 | |
in other words - and who cares | 01/01/70 00:00 |



