??? 07/20/05 08:49 Read: times |
#97668 - Delay ? Responding to: ???'s previous message |
Your delay routine is weird, and probably is not what you expect from it
void DelayMS(unsigned int ms) { ms; _asm mov r0, dpl 00001$: mov r1, #230 00002$: nop nop nop nop nop nop djnz r1, 00002$ djnz r0, 00001$ retYou give an integer (speed=8000) to it, but how is this 2 byte parameter used in the routine ? You only say: ms; (?). I don't see why DPL is used in the routine as a delay parameter (and NOT ms). You should see to which 2 registers is an integer variable copied, and then use them to construct a similar delay loop. Regards, Slobodan |