In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dkemppai wrote: Be patient...That's less than a day, not everyone who uses the SX gets on that much. I'm sure someone has tried it. [/quote] Yeah, I'm guess I'm just starting to get impatient... ...I posed the following code snippit over a month ago dealing with my first issue. No one appears to have looked at it since then. Anyway, I was trying to get someone to try this code with SOURCING curent to an LED and oscilloscope on the RB.0 pin. Try it... ...You'll be confused if you look into the datasheet/app notes for reset conditions. Then try it with the "; MOV RB, SHADOW" uncommented. You would think, that in both cases the LED would flash at about 4 second rate, with a roughtly 50% duty cycle... ...anyway. It won't. It only works with the shadow register enabled. As posted, the code will only generate a 3.800uS wide 'glitch' on the output pin. With the shadow move enabled, it works as expected. Oh, yeah, you can add some nop's around the "READ MODIFY WRITE"'s to prevent additional glitches... -Dan ----------------Code example------------------------ NOCASE ;No Case Sensitive ASM DEVICE SX28L ;28 pin chip DEVICE OSCXT1 DEVICE BOR22 ;Brownout at 2.2Volts IRC_CAL IRC_FAST ;(Faster programming) DEVICE STACKX ;Use the Extended Stack. DEVICE IFBD ;Disable Internal Feedback. DEVICE TURBO ;Turbo Mode DEVICE WATCHDOG ;Enable Watchdog timer. FREQ 4_000_000 ;START WITH A XXMHz Clock RESET Main org $08 counter DS 3 SHADOW DS 1 Main ; MOV RB, SHADOW MODE $0F ;Mode for Direction Registers MOV !RA, #%0000 ;0 = output, 1 = input MOV !RC, #%00000000 MOV !RB, #%00000000 MOV !option, #%11111111 ;Check to see if Start is from WatchDog timeout. MOV W,status AND W,#%00011000 ;Bits TO = 0 and PD = 0 on WDT reset. JZ WDTStart ;Skip Following code on WatchDog Reset ;Place code to be skipped on WDT reset here... WDTStart JB RB.0,:clrbit SETB RB.0 jmp :bitdne :clrbit clrb RB.0 nop :bitdne CLR !WDT MOV SHADOW, RB SLEEP ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=78775#m78907 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)