I'm working on a project to support a File IO to a thumb drive (for the PIC32MX795F512L) with the help of the dsPIC Blockset.
Therefore I implemented some C code and call this one with the "C Function Call" Block.
This C code uses the USB stack of the Microchips libraries. The generated code from MATLAB isn't working correctly.
I used the generated MPLAB project file to adjust the project.
To get it working, I have to set the heap size in the MPLAB project. I think, this can be done in MATLAB by adding
--defsym=_min_heap_size=8192 to the LDFLAGS in the DsPIC options. So this is just a problem with a linker option and should not be the problem.
But, I have to edit the code of the generated file "*_main.c" and have to add some other processor specific configuration settings.
MATLAB is generating the follwing settings:
#pragma config FPLLMUL = MUL_15, FPLLIDIV = DIV_1, FPLLODIV = DIV_256, FWDTEN = OFF
#pragma config POSCMOD = XT, FNOSC = PRIPLL, FPBDIV = DIV_1
If I replace these settings by:
#pragma config UPLLEN = ON, FPLLMUL = MUL_20, UPLLIDIV = DIV_2, FPLLIDIV = DIV_2, FPLLODIV = DIV_1
#pragma config FPBDIV = DIV_1, FWDTEN = OFF, WDTPS = PS1, FCKSM = CSDCMD, OSCIOFNC = OFF, POSCMOD = HS
#pragma config IESO = OFF, FSOSCEN = OFF, FNOSC = PRIPLL, CP = OFF, BWP = OFF, PWP = OFF
#pragma config ICESEL = ICS_PGx2, DEBUG = OFF
So, my question is: Is there a way to manipulate this processor specific configuration settings in MATLAB?
Hopefully you are able to help me.
Create new topics, add your comment, remark, bugs...
1 post • Page 1 of 1
Users browsing this forum: No registered users and 4 guests