??? 08/16/07 14:40 Read: times |
#143351 - this will be a little bit too slow Responding to: ???'s previous message |
Assembling Kai's example (omitting the 'h's), then using the cycle counting feature of Jeff's disassembler (OK, a bit of self-advertisement again... :-) ):
; ; D52 V3.4.0 8052 Disassembly of loop.hex ; 08/16/07 16:31 ; org 0 ; X0000: mov r2,#64h X0002: mov r1,#0ffh ; 2 X0004: mov r0,#0ffh ; 2 X0006: djnz r0,X0006 ; 4 ; ; --- Cycle count 0006-0006 = 4 * 255x = 1020 ; djnz r1,X0004 ; 4 ; ; --- Cycle count 0004-0008 = 1026 * 255x = 261630 ; djnz r2,X0002 ; 4 ; ; --- Cycle count 0002-000a = 261636 * 100x = 26163600 ; cpl p1.0 sjmp X0000 ; end ; So, even if this is a singleclocker and assuming a +-20MHz crystal, the period of blinking will be over 2 seconds. As a demonstration of functionality viable, but not nice... JW PS: just for the record, I called it loop.a51->loop.hex, the loop.ctl file for the disassembler contained: z 6*ff z 4-8*ff z 2-a*64 and the command line was: d52 loop -zds89c4x0.cyc |