In SX Microcontrollers, SX/B Compiler and SX-Key Tool, hainguyen51 wrote: Hi Bean, I tried the codes you suggest. What I expect to see is as soon as I send a + slope rb.0 for example, I should see a permanent "hi" signal on rc.0. The reality is I just saw a short hi pulse then rc.0 turns "lo" right away. Please advise. Thanks Hai start MOV M,#$0F ;Set up MODE register. MOV !RB, #$FF ;Set $00 make RB all Inputs. MOV !RC, #$00 ;Set $00 make RC all Outputs. MOV M,#$0E ;Set up MODE for PULL-UP configuration. MOV !RB, #$00 ;Set $00 make RB all inputs' Pullup. MOV !RC, #$00 ;Set $00 make RC all Outputs' Pullup. ; MOV M,#$0A MOV !RB, #$00 ;Set $00 make +slope detect at RB pins. ; MOV M,#$09 ; Prepare to use WKPND_B register MOV W,#$00 ; Assume all bits off initially MOV !RB,W ; Zero all edge detection bits NOP ; Might be needed ??? ; main MOV !RB,W ; This will put the register bits in W TEST W ; Is W zero ? SZ ; Yes, then no edges detected, so skip SETB SETB RC.0 ; Edge detected so set RC.0 JMP main Bean ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=302755#m302787 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)