Page 1 of 1

Configuration Option Missing in Master Block

Posted: Mon May 12, 2008 9:38 pm
by malife
Hello Lubin,
I have the following request: Many of the high-end dsPics have more than one PGC/PGD ports and these are used to program and debug. The selection of which to use is set using configuration register FICD (like crystal, PBOR, etc...) but your Master block does not have that option. I would like to request that you add that capability because I just sent to manufacture a board that uses PGC2/PGD2 but I have no way of changing PGC/PGD unless I go into the code :-). I understand that programming will work (most likely) but debugging won't.

Thanks!

Re: Configuration Option Missing in Master Block

Posted: Mon May 12, 2008 10:05 pm
by LubinKerhuel
Hi Mariano,

I understand that you are going to use MPLAB (i.e. no bootloader) to program and debug your microcontroller chip.
You will set-up a project, import c and library files (.a) generated by Matlab/Simulink and the blockset for dsPIC, and compile the whole project using MPLAB. (This will enable advanced debug option of MPLAB). The other solution is to import directly the .hex file generated by Matlab, but debugging will be difficult!

The fastest way to set the PGC/PGD parameter, which is not supported yet by the blockset, is to set up that option using directly the MPLAB menu:
Configure ==> Configuration Bits ; uncheck "Configuration Bits set in code" and set your own options for PGC/PGD.

Let me know if it solves the problem.
Adding the PGC/PGD choice to the blockset is still a piece of work (need to analyze the syntax for all microchip microcontroller, and many times, there is tiny changes that makes it quite annoying)
Lubin

Re: Configuration Option Missing in Master Block

Posted: Tue May 13, 2008 12:56 am
by malife
Ok Lubin,
I will do that. One question... do you know if it will program regardless of which PGC/PGD I connect to?

Thanks for the response :-)

Re: Configuration Option Missing in Master Block

Posted: Wed May 14, 2008 10:36 am
by LubinKerhuel
Hi Mariano,

I have no idea if the chip can be programmed using any PGC/PGD pin.
It may be only for debugging ? If anyone else tried...

I mostly use the very usefull "tinybld" bootloader working with UART1 or 2.
(I add a "reset" mechanism in my simulink model that reset automatically the dsPIC when it receive few instruction from the tinybld PC interface)

Re: Configuration Option Missing in Master Block

Posted: Wed May 14, 2008 7:55 pm
by malife
Hey Lubin,
You had me worried for a while, 'cause my board had already been sent to manufacture and I had only PGC2/PGD2 wired :shock: . Anyways, I found in the dsPIC33F family reference manual Section 24.2.1 that you can use any pin pair to program the device (you can not mix and match i.e. PGC1/PGD2). But I think that dsPIC30s only can be programmed in PGC/PGD and debugged on the others, but I am not sure. I would love to use tinybld but according to its website it is not compatible with the dsPIC33FJ256MC710, if you have any other info regarding this I would love to give it a try :-).

Thanks!

Re: Configuration Option Missing in Master Block

Posted: Wed May 14, 2008 8:32 pm
by LubinKerhuel
Hi Mariano,

You could try sending a mail to Claudiu (mail at the bottom of his webpage : http://www.etc.ugal.ro/cchiculita/softw ... loader.htm)
It works once for me :)

Thanks for sharing that information about PGC/PGD...