delay time coding make me puzzled. for example: void delay() { int x=20000; do{x=x-1;}while(x>1); } how to understand it's delay.and how long time??? sincere your in advance!
every assembly instruction takes 12 clock cycles to execute. That is not correct "every assembly instruction takes a multiple of 12 clock cycles to execute" see chapter 2 of "the bible" http://www.semiconductors.philips.com/acrobat/various/80C51_FAM_PROG_GUIDE_1.pdf as to what that multiple is for the various instructions for a "standard" '51 For "unique" derivatibves such as SILabs, refer to the datasheet/user manual. ALSO delay routines should never be written in C they may cange when the compiler is revised. Erik
Erik, Good catch... Sorry if I led anyone astray. As a matter of fact, the loop presented would almost certainly generate a DJNZ which would leave someone pulling out their hair.
leave someone pulling out their hair. <.i> not me, don't have any :) Erik