 |
|
 |
| Parallax Forums > Public Forums > SX Microcontrollers, SX/B Compiler and SX-Key Tool > Is it normal for interrupt initialization to trigger the ISR? RESOLVED- Thanks Mojorizing! | Forum Quick Jump
|
 |  mojorizing Registered Member

       Date Joined Jul 2004 Total Posts : 141 | Posted 1/31/2006 9:59 PM (GMT -8) |   | Hi Carl, In your intialization code you need to clear the WKPEND register before you enable the wake ups following a sequence such as;
;------------------------ INITIALIZATION ROUTINE -----------------------
Initialize ;Edge Detection Configuration
mov W,#$19 ;Allow Wake-Up Pending access mov M,W mov !rb,#%00000000 ;Clear Wake-Up Pending (WKPND_B)
mov W,#$1A ;Allow Wake-Up Edge configuration mov M,W mov !rb,#%11111111 ;Set port B bits 0-7 to falling edge
mov W,#$1B ;Allow Wake-Up Enable configuration mov M,W mov !rb,#%11110000 ;Set port B bits 4-7 to normal, bits 0-3 to Wake-Up Enable
mov W,#$1E ;disAllow Pull-up configuration mov M,W mov !rb,#%11111111 ;Port B bits 0-7 without pullups
mov W,#$1F ;Allow Direction configuration mov M,W mov !rb,#%11111111 ;Set port B bits 0-7 to input direction
mov W,#$19 ;Allow Wake-Up Pending access mov M,W mov !rb,#%00000000 ;Clear Wake-Up Pending (WKPND_B)
does this answer your question? Bad spellers of the world untie! | | Back to Top | | |
 |  CarlC Registered Member
        Date Joined Oct 2005 Total Posts : 29 | Posted 1/31/2006 10:18 PM (GMT -8) |   | Thanks mojo,
that was exactly my problem. I forgot to clear all the interrupt flags before enabling the interrupts. | | Back to Top | | |
| Forum Information | Currently it is Friday, November 20, 2009 10:32 PM (GMT -8) There are a total of 393,733 posts in 55,521 threads. In the last 3 days there were 82 new threads and 701 reply posts. View Active Threads
| | Who's Online | This forum has 17687 registered members. Please welcome our newest member, mark09. 66 Guest(s), 6 Registered Member(s) are currently online. Details JRetSapDoog, Chris Savage (Parallax), mpark, Kye, Sal Ammoniac, micromang |
Forum powered by dotNetBB v2.42EC SP2.02 dotNetBB © 2000-2009 |
|
|