Teething problems - PIC32

Post Reply
gdiana
Posts: 4
Joined: Sat Jul 05, 2008 11:41 am

Teething problems - PIC32

Post by gdiana » Sat Jul 05, 2008 12:55 pm

I am trying to evaluate your "free" blockest using Matlab 2007b and am experiencing some teething problems. I am using the simple Servo_Sinus.mdl to find my feet and get started.

Problem - C32 Compiler: When I build I get the following;

Servo_Sinus_main.c:30: error: unknown value for configuration setting 'FPLLODIV': 'DIV_526' gmake: *** [Servo_Sinus_main.o] Error 1
### Real-Time Workshop build procedure for model: 'Servo_Sinus' aborted due to an error.


This is what appears in "Servo_Sinus_main.c"
#pragma config FPLLMUL = MUL_15, FPLLIDIV = DIV_1, FPLLODIV = DIV_526, FWDTEN = OFF
#pragma config POSCMOD = XT, FNOSC = PRIPLL, FPBDIV = DIV_1


This seems to be a simple typo problem and should read 'FPLLODIV': 'DIV_256'.

Am I able to fix this? When I made the correction myself (in Servo_Sinus_main.c) and run the Servo_Sinus.bat file all appears to work ok and without error. I get the Servo_Sinus.elf and Servo_Sinus.hex in the example directory after manually running the bat file.

Kind regards


Greg Diana

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Teething problems

Post by LubinKerhuel » Mon Jul 07, 2008 10:41 pm

Hello Greg,

I noticed that you also got a problem with the C30 installation. Did you solve the problem? Could you share the solution if there is some trick to apply while installing C30 ?
Feel free to register and to then edit the "installation page" of the website's wiki.

About the C32, there was a typo error in the software. I just solved it so the problem will be solved in the next blockset release (0.98e). I 'll try to update the website very shortly with this new release. (If you need it shortly, let me know).

Thanks for reporting that bug. (Activating PLL may resolve the bug on your the actual blockset version (0.98d))

Be aware of the fact that PIC32 are curently only experimental and few peripheral are supported right now. (I have a problem with the Output Compare Interrupt and the development process stopped there!)


Lubin

gdiana
Posts: 4
Joined: Sat Jul 05, 2008 11:41 am

Re: Teething problems

Post by gdiana » Tue Jul 08, 2008 9:18 pm

Hi Lubin,

Thank you, much appreciated, there is no particular hurry, and I am sure you have a lot on your plate. I will play around with the dsPIC30 stuff first. Got Servo_Sinus to compile, download and run on the Microchip dsPICDEM 2 demonstration board running with a 40 pin DIL dsPIC30F4011 (http://www.microchip.com/stellent/idcpl ... PICDSCDemo).
I imported to MPLAB (ver 8.10 note ver 8.14 beta now available and works fine too!) downloaded and it ran as you said it would.

However I first had to change the NIPS as well as the Oscillator Mode (XT_PLL8) parameters in the dsPIC Master Block, Real Time - Quartz Tab to conform to the dsPICDEM 2 board setup configuration. Initially it would just not run, with your standard parameter set, until I fathomed out what the problem was. This might be useful to others!

As far as the C30 compiler problem I initially penned down and subsequently removed. This was simply due to a change in the way Microchip have now organised the PIC24 and dsPIC 16 bit C30 Compilers. Previously, I understand, there was only a single / combined C30 compiler for both. However MPLAB (8.10) only installs the C32 compiler. One has to download and install the C30 compilers from Microchip (student versions) but there are 3 versions namely;
1 One C30 for the PIC24 MCUs
2 One C30 for the dsPIC DSCs
3 A single upgrade for both 1 and 2.

I incorrectly installed the PIC24 C30 compiler (1) and tried to compile Sinus-Servo using a dsPIC device and MATLAB gave a licence error message as I was compiling the wrong device with the wrong compiler. I subsequently installed the dsPIC C30 compiler (2), along with the upgrade (3) and resolved the problem. One of those Read The Manual problems!

Also please note that the PIC24 (1) and dsPIC C30 (2) compilers appear to write to the same directories so that only one may be installed at a time! Weird but apparantly true. Within MPLAB 8.10 there is only a single Microchip C30 Toolsuite defined under the Set Language Locations in the Project Menu. This might create problems!

However I learned some maybe interesting things that others might want to take note of;

1 Installing MPLAB 8.10 does not provide the option to automatically modify the WINDOWS PATH. This has to be done manually. I found I could not just use START->RUN->CMD to open a DOS CMD Window and edit and change the path in the autoexec.bat file. When I did this, and ran it, it indeed showed, in the DOS CMD Window, that the DOS PATH had changed, but MATLAB did not pick it up via the WINDOWS PATH! (If I ran !PATH from the MATLAB command line it was unchanged and different from that in the DOS CMD Window). Even exiting and restarting MATLAB DID NOT solve the problem. Even rebooting did not work! It sounded similar to the problem that other forum member was experiencing!

2 When installing the dsPIC C30 (2) compiler and upgrade (3) it was noted that the WINDOWS PATH was changed, when selecting this install option, and that MATLAB picked this up immediately.

3 To solve the problem I right clicked on My Computer, clicked on Properties, clicked on the Advanced Tab and then opened the Environment Variables under Startup and Recovery.

Under Systems variables I moved the slider until the Path variable showed and simply double clicked on the Path Variable, allowing me to edit and change the WINDOWS PATH. This I did and simply added (C:\Program Files\Microchip\MPLAB C30\bin;C:\Program Files\Microchip\MPLAB C32\bin) to the path and exited. I rebooted to make sure and PRESTO it worked just fine. It appears modifying the path via My Computer is best.

I am sorry if I have been so long winded but I hope this might be of some help to others. I just noticed that you requested a reply on the "installation page". Please forgive but I will modify a little later when I am "fresh".

Kind regards


Greg Diana

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Teething problems

Post by LubinKerhuel » Tue Jul 08, 2008 10:27 pm

Hi Greg,

Thanks for all theses information. I noticed theses facts (C32 not added in the windows path when installing with MPLAB, but option is available if installing C32 with its standalone installer.
gdiana wrote: Also please note that the PIC24 (1) and dsPIC C30 (2) compilers appear to write to the same directories so that only one may be installed at a time! Weird but apparantly true. Within MPLAB 8.10 there is only a single Microchip C30 Toolsuite defined under the Set Language Locations in the Project Menu. This might create problems!
PIC24 and dsPIC C30 compiler install to the same directories. PIC24 and dsPIC C30 compiler are the same binary software. Libraries are different for the PIC24 and the C30 version. Installing both will add both libraries in different subdirectory thus making you able to compile for either dsPIC 30f or PIC24 chips.
gdiana wrote:you requested a reply on the "installation page"
Information is easier found on the wiki than on the forum. That may help many others. A Version Short and Simple to resume all theses information would be great on the wiki ;-)
If you are willing to add examples for the dsPICDEM2 on the wiki, it could be great. So feel free to ask. (Not sure that you can create new pages on the wiki...)

Regards
Lubin

rustw

Re: Teething problems

Post by rustw » Sun Aug 31, 2008 2:15 am

LubinKerhuel wrote:Hello Greg,

...

Be aware of the fact that PIC32 are curently only experimental and few peripheral are supported right now. (I have a problem with the Output Compare Interrupt and the development process stopped there!)


Lubin
Did you ever resolve the Output Compare Interupt problem? I am also having a similar problem in that the Output Compare Interrupt always happens at the beginning of the timer instead of the output Compare register offset.

LubinKerhuel
Site Admin - Expert
Posts: 616
Joined: Wed Mar 07, 2007 11:23 pm
Location: Bayonne- France
Contact:

Re: Teething problems

Post by LubinKerhuel » Sun Aug 31, 2008 1:15 pm

I did not get back yet on the interrupt problem I had.

so, still stuck. I still hope that someone could help.

Lubin

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 22 guests