Tuesday, November 19, 2013

The quirks of downloading code to dsPIC

I wanted to see how my compiled program runs on my dsPIC33FJ. Never did I imagine this was going to be so hard.

Usually you write your blinky code, you download it via your IDE to your uC, and then you lean back and watch the blinky code do its magic on the LED.

Turns out the dsPICs do not have a hardware to support direct debugging, therefore you can compile 2 different codes.

  • Debug code:
    • Debugable
    • Does not run standalone
  • Standalone code:
    • you download it, it runs, that's it

I've seen some architectures before, like AVR8, AVR32, MSP430, C2000, Cortex M3/M4, and every each and single time, if you downloaded your code no matter what compile options, if it did run while debugging, then it did run after disconnecting the debugger and doing a power reset.

Well, not with a dsPIC, that's for sure.


If you use MplabX, then take a look at the following picture:

Red: Debug
Green: Download

No comments:

Post a Comment