In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Staryi wrote: This show the bug without debugger. RA.0 stay high when debug is detected. Used internal RC-oscillator at 32 kHz [code] ; Demonstrate the inc/dec bug without debugger ; Need one LED connected from RA.0 to GND ; (whis current limiter resistor, of course) ; When right work, must be one short LED flash after reset ; When this bug occur, the LED stay light. ; Use internal clock oscillator at 32 kHz. DEVICE SX48,OSC32KHZ IRC_CAL IRC_SLOW RESET start org 0x0a R0 ds 1 ; checked counter R1 ds 1 ; cycle counter org 0 ; Interrupt service routine (dummy) nop nop reti start page main jmp main main mov W,#0x1f ; DDIR_W mode mov M,W ; Mov !RA,#11111110b ; RA.0 for output Mov RA,#1 ; The LED is light Mov RTCC,#19 Mov !option,#10001000b ; RTCC start jmp @Work org 0x800 ; The critically routine Work nop clr R0 Mov R1,#200 :loop nop nop inc R0 djnz R1,:loop mov W,#200 ; Check R0 value (here must be 200) xor W,R0 ; Is equal? snz ; Skip if not equal clrb RA.0 ; Switch off LED, if equal (bug not detected) ; If not equal, the LED stay light (bug detected) :q nop jmp :q ; The end (empty unlimited loop) end [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=146451#m146590 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)