Friday, November 29, 2013

Mplab X code download

Mplab X has 2 options to download your code.
The one which runs standalone, and the one that you debug.

Remember?


Seems to me idiotic, that you can't assign a build configuration to either one of them.
If you use the download button (labeled green), then you can't debug it. It just downloads it and zap, it runs as any microcontroller is supposed to be, that is, it runs autonomous, and forever.

Now this raises the question, why it doesn't come with a separate build configuration, where the GCC(xc16) compiler is set to optimization 3 or s.

  • 3 is used for speed optimization
  • s is used for size optimization

But neither less to say, both of them produce a faster running code.
You'll get

  • better interrupt responses
  • running an rtos or any decent task system: more time to deep sleep: less power consumption
  • more throughput when writing to an SD card
The list goes on and on...


So how should it be, you may ask?
Well, let's have a look at my environment used for Cortex M microcontrollers.

It is:
  • eclipse based
  • comes with a royalty free GCC compiler (the one in Mplab X costs up to 1000-1445 USD)
  • supports the debugger of your choice
So, what do we have?

You can set up different download schemes, for which you can each assign a make configuration.


So if you want to give the project to the hardware guys for a field test, or you want to leave it there running on your table for the night, you just push the one appropriate download button, and there you have it.

No comments:

Post a Comment