Skip to main content
Topic: Projects not working when flashed with a PIC programmer (Read 1905 times) previous topic - next topic

Projects not working when flashed with a PIC programmer

Hi,

I posted a comment at the "introduction-to-dspic33-programming" page [1] but am reposting it here in the forum so that it does not get overlooked:

I think using 0b11 in the line
    _FICD(JTAGEN_OFF & 0b11);
is not correct. 0b11 is expanded to the 16 bit value 0b0000000000000011 which sets all other bits in FICD to zero. Better use ICS_PGD1 which is defined as 0xFFFF:
    _FICD(JTAGEN_OFF & ICS_PGD1)

This is *really an issue* when using a PIC programmer to program the firmware. It took me quite some time to figure out, why most of the examples do not work on the Web Platform when programmed with a programmer, but work fine when transferred using the bootloader. The bootloader seems to not program the config bits, at least not the bits in FICD, which hides the bug introduced when using & 0b11.

MCstackDemo MCstack-SDcard-server, and ds33Intro all contain this bug in either HardwareProfile.h or main.c. It should really be corrected in the SVN (and ideally also in the provides .zip files in the download section) to prevent others from stumbling over this issue.

I could do the work if I get SVN commit permissions assigned.

[1] http://dangerousprototypes.com/2010/02/ ... mment-2204

Re: Projects not working when flashed with a PIC programmer

Reply #1
I added your gmail address. You'll need to look at your google code profile to get your google code password. Let me know if you need any other help with SVN.
Got a question? Please ask in the forum for the fastest answers.

Re: Projects not working when flashed with a PIC programmer

Reply #2
Fixed in SVN.

Re: Projects not working when flashed with a PIC programmer

Reply #3
Thanks Markus, I'll prepare a new release package and do a post about it.
Got a question? Please ask in the forum for the fastest answers.

Re: Projects not working when flashed with a PIC programmer

Reply #4
I checked in the .hex file of the ds33Intro project, but did not commit new versions of the .hex files for the MCstackDemo, MCstack-SDcard-server, and tweet_tree projects.