03.11.2014 Views

QDK-nano PIC24/dsPIC-C30 - Quantum Leaps

QDK-nano PIC24/dsPIC-C30 - Quantum Leaps

QDK-nano PIC24/dsPIC-C30 - Quantum Leaps

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table of Contents<br />

1 Introduction ..................................................................................................................................................... 1<br />

1.1 About QP-<strong>nano</strong> ........................................................................................................................................... 2<br />

1.2 About the QP-<strong>nano</strong> Port to <strong>PIC24</strong>/<strong>dsPIC</strong> .................................................................................................... 3<br />

1.3 What’s Included in the <strong>QDK</strong>-<strong>nano</strong>-<strong>PIC24</strong>-<strong>dsPIC</strong>? .......................................................................................... 4<br />

1.4 Licensing QP-<strong>nano</strong> ..................................................................................................................................... 5<br />

2 Getting Started ................................................................................................................................................ 6<br />

2.1 Software Installation ....................................................................................................................................... 6<br />

2.2 Building and Running the Examples .............................................................................................................. 8<br />

3 Non-Preemptive “Vanilla” Port ...................................................................................................................... 10<br />

3.1 The qpn_port.h Header File ........................................................................................................................... 10<br />

3.2 ISRs in the Non-Preemptive “Vanilla” Configuration ...................................................................................... 11<br />

3.3 QP Idle Loop Customization in QF_onIdle() ................................................................................................... 13<br />

4 Preemptive Configuration with QK-<strong>nano</strong> ................................................................................................... 15<br />

4.1 QK-<strong>nano</strong>-specific ISR Entry and Exit Macros (file qpn_port.h) ....................................................................... 15<br />

4.2 ISRs with the Preemptive QK-<strong>nano</strong> Kernel .................................................................................................... 17<br />

4.3 Idle Loop Customization in the QK-<strong>nano</strong> Port ................................................................................................ 20<br />

4.4 Testing QK Preemption Scenarios ................................................................................................................. 21<br />

5 Implementing “Zero Interrupt Latency” with the NMI .................................................................................. 24<br />

5.1 Communication between NMIs and QP-<strong>nano</strong> ................................................................................................ 24<br />

5.2 Implementation Considerations for the NMIs ................................................................................................. 24<br />

6 BSP for the Explorer 16 Board ....................................................................................................................... 25<br />

6.1 Setting the Sizes of Stack and Heap .............................................................................................................. 25<br />

6.2 The BSP header file bsp.h ............................................................................................................................. 26<br />

6.3 BSP initialization ............................................................................................................................................ 26<br />

6.4 Starting Interrupts in QF_onStartup() ............................................................................................................. 26<br />

6.5 Assertion Handling Policy in Q_onAssert() .................................................................................................... 27<br />

7 Related Documents and References ............................................................................................................. 28<br />

8 Contact Information ........................................................................................................................................ 29<br />

Copyright © <strong>Quantum</strong> <strong>Leaps</strong>, LLC. All Rights Reserved.<br />

i

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

Saved successfully!

Ooh no, something went wrong!