30.12.2014 Views

QDK PIC24/dsPIC-C30 - Quantum Leaps

QDK PIC24/dsPIC-C30 - Quantum Leaps

QDK PIC24/dsPIC-C30 - Quantum Leaps

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>QDK</strong><br />

<strong>PIC24</strong>/<strong>dsPIC</strong>-<strong>C30</strong><br />

www.state-machine.com/pic<br />

(21) 00A24 EAC000 com.b 0x0000,0x0000<br />

(22) 00A26 FC3FFF disi #16383<br />

(23) 00A28 B66993 and.b 0x0993<br />

(24) 00A2A E24993 cp0.b 0x0993<br />

(25) 00A2C 3A0003 bra nz, 0x000a34<br />

(26) 00A2E EF6042 clr.b 0x0042<br />

(27) 00A30 070178 rcall 0x000d22<br />

(28) 00A32 880218 mov.w 0x0010,0x0042<br />

(29) 00A34 FC0000 disi #0<br />

82: }<br />

(30) 00A36 78044F mov.w [--0x001e],0x0010<br />

(31) 00A38 BE034F mov.d [--0x001e],0x000c<br />

(32) 00A3A BE024F mov.d [--0x001e],0x0008<br />

(33) 00A3C BE014F mov.d [--0x001e],0x0004<br />

(34) 00A3E BE004F mov.d [--0x001e],0x0000<br />

(35) 00A40 F90036 pop.w 0x0036<br />

(36) 00A42 064000 retfie<br />

(1) The RCOUNT register (at address 0x36) is pushed to the stack. This is done to establish the same<br />

stack layout as the MPLAB <strong>C30</strong> compiler does for all ISRs.<br />

(2) The register pair w0-w1 is pushed to the stack. Now these registers can be clobbered.<br />

(3) The stacked SRCORCONPC bits (see Figure 6) are loaded from the stack to w0.<br />

Please note that after pushing RCOUNT and w0,w1 pair, this information is 8 words away from the<br />

current stack pointer in w15.<br />

(4) The register w0 is left-shifted by 13 bits, so that the stacked IPL ends up in w1.<br />

(5) The register w1 is compared with zero.<br />

(6) The stacked IPL indicates that an ISR has been preempted, so the corresponding bit in the<br />

QK_intNest_ bitmask needs to be set. Here the bitmask (1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!