dsPIC Master error

Create new topics, add your comment, remark, bugs...
whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

dsPIC Master error

Postby whatthehack » Thu Sep 08, 2011 5:15 pm

Hi,

I'm using Matlab 2007b with Windows7 64. The Installation seemed to be ok. But when I want to choose the Master I always get the Matlab error message:

Error evaluating 'OpenFcn' callback of Master block (mask) 'Master'. Index exceeds matrix dimensions.

I would be glad if someone could tell me what's going wrong.

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

Re: dsPIC Master error

Postby LubinKerhuel » Fri Sep 09, 2011 8:11 am

Which blockset version are you working with ?
Can you compile the files in example directory ? (there is a m script to compile them all at once !)

Lubin

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Fri Sep 09, 2011 9:45 am

I installed it with: install_dsPIC_R2007b.

The example all result in the same error after some warnings. I post it for the first example at the end.

In the examples I can open the "Master Block" and change it. If I copy the "Master Block" into my model, it seems to work. But no compilation.

Peter

K>>
Warning: 'slprj' is a directory. Use rmdir to delete directories.
> In CompileAllModels at 4
Warning: File 'Data_Login_Matlab.hex' not found.
> In CompileAllModels at 27
***** Solver Mode change from Auto to SingleTasking (this mode allows single rate and multirate). See help to get the difference with the MultiTasking mode which is now supported by the blockset *****
Old gmake exist, but newly GMAKE set at : C:\PROGRA~2\MATLAB\R2007b\bin\win32\gmake
PNumber of I/O PINs used : 2
TModel configured...
sources files not found. MPLAB project file not created.
K>>

and the important error:

Error building Real-Time Workshop target for block diagram 'Data_Login_Matlab'. MATLAB error message:
Error using ==> make_rtw
Too many output arguments.

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Fri Sep 09, 2011 10:18 am

Additionally:

For all the dsPIC33 I tried, I get: No CAN peripheral on ...

For dsPIC30 it works.

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

Re: dsPIC Master error

Postby LubinKerhuel » Fri Sep 09, 2011 11:01 am

whatthehack wrote:In the examples I can open the "Master Block" and change it. If I copy the "Master Block" into my model, it seems to work. But no compilation.


You need to set the Code Generation target : simulink configuration, pannel Code Generation, set it to dsPIC or pic32...
a yellow block is capable of configuring the siumlink model automatically if you add it to your model.

Code: Select all

K>>
Warning: 'slprj' is a directory. Use rmdir to delete directories.
> In CompileAllModels at 4
Warning: File 'Data_Login_Matlab.hex' not found.
> In CompileAllModels at 27
***** Solver Mode change from Auto to SingleTasking (this mode allows single rate and multirate). See help to get the difference with the MultiTasking mode which is now supported by the blockset *****
Old gmake exist, but newly GMAKE set at : C:\PROGRA~2\MATLAB\R2007b\bin\win32\gmake
PNumber of I/O PINs used : 2
TModel configured...
sources files not found. MPLAB project file not created.
K>>

Could you compile without debug mode (K>> mean debug I guess ?) and print out the complete error message ?
It's difficult to make out what's happening there.

Lubin

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Fri Sep 09, 2011 4:30 pm

You need to set the Code Generation target : simulink configuration, pannel Code Generation, set it to dsPIC or pic32...
a yellow block is capable of configuring the siumlink model automatically if you add it to your model.


In all cases there was set dspic.tlc.

I tried the same with Matlab2007b(32bit) and Matlab2010b (64bit), both on windows7 (64bit). During opening of the model I get a lot of warnings, see:
dsPIC2007b.txt
(7.99 KiB) Downloaded 234 times
dsPIC2010b.txt
(7.14 KiB) Downloaded 181 times


In both cases during incremental build for the example Data_Login_Matlab a new info-window opens with an error message:

2007b:
Error building Real-Time Workshop target for block diagram 'Data_Login_Matlab'. MATLAB error message:
Error using ==> make_rtw
Too many output arguments.


2010b:
Real-Time Workshop Embedded Coder is not licensed or not installed. The current target is: C:\Program Files\MATLAB\toolbox\dspic\dspic\dspic.tlc

And in both cases for dspic33fj128gp802 (or other pic33) I get no CAN

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

Re: dsPIC Master error

Postby LubinKerhuel » Fri Sep 09, 2011 4:51 pm

don't pay attention to warning message at model opening.

I do not understand the message you obtain on matlab 2007b.

whatthehack wrote:Real-Time Workshop Embedded Coder is not licensed or not installed. The current target is: C:\Program Files\MATLAB\toolbox\dspic\dspic\dspic.tlc
You need to have Embedded Coder installed on matlab to have the dsPIC blockset work. dsPIC blockset works on top of RTW Embedded Coder.

Maybe, you do not have also Embedded Coder on matlab 2007b ?

Lubin

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Fri Sep 09, 2011 5:09 pm

Real-Time Workshop Embedded Coder is not licensed or not installed. The current target is: C:\Program Files\MATLAB\toolbox\dspic\dspic\dspic.tlc


is the error message with 2010b.

I have the RTW coder for both versions
Real-Time Workshop Version 7.0 (R2007b)

Real-Time Workshop Version 7.6 (R2010b)


My dSpace-System works fine with both versions

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

Re: dsPIC Master error

Postby LubinKerhuel » Fri Sep 09, 2011 5:13 pm

There is
Real Time Workshop and
Real Time Workshop Embedded Coder (renamed Embedded Coder on last matlab version)

RTW EC works on top of RTW. In other word, you need them both.
Do you have RTW Embedded Coder ?

Lubin

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Sat Sep 10, 2011 12:14 pm

Dear Lubin,

I have to apologize. I didn't check this :( . For what reason ever the embedded coder was not installed. Now it is!

Now principally everything works fine but in the examples Data_Login_Matlab, Servo_ADC, Servo_Sinus I get the following error:

Servo_ADC_main.c:34: error: syntax error before numeric constant
Servo_ADC_main.c: In function '_FICD':
Servo_ADC_main.c:36: error: syntax error before '{' token
gmake: *** [Servo_ADC_main.o] Error 255


And very important for me too: How do I get the CAN-Interface with an 33fj128gp802?

Thanks a lot
Peter

whatthehack
Posts: 7
Joined: Thu Sep 08, 2011 5:09 pm

Re: dsPIC Master error

Postby whatthehack » Sun Sep 11, 2011 10:44 am

Well, I think I found the reason for the compiler error. It seems that from mplabc30 v3.25 to v3.30 the name of FICD changed to ICD (but only for dsp30f3xxx up to 6xxx :?: ).

Remains 1 problem for me at the moment: no CAN for my dsp33.

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

Re: dsPIC Master error

Postby LubinKerhuel » Mon Dec 19, 2011 1:46 pm

This is correct.

ICD will turn back to FICD in next Microchip compiler (v3.31) comming soon.
Thus I do not correct this problem for now.

Lubin

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

Re: dsPIC Master error

Postby LubinKerhuel » Thu Jan 12, 2012 10:23 am

Compiler C30 v3.31 is released.
Blockset were updated accordingly. Download latest blockset version (3.7c) with the C30 compiler v3.31.

Everything should be Ok now.
Lubin


Return to “General Remark and Questions”

Who is online

Users browsing this forum: No registered users and 2 guests