I am trying to implement the software emulation EEPROM as described in Microchip's App Note AN1095 http://www.microchip.com/stellent/idcpl ... e=en530593. This is what I am doing:
I downloaded the code and renamed the C, S and H files to DEE.c, DEE.s and DEE.h respectively. Then I added those to the Simulink model via Simulation -> Configuration Parameters -> Custom Code. I place the S and C files in Source Files and the H file in Header File. I am still not doing anything with the model except flashing an LED and trying to compile. When I compile I get this error:
Code: Select all
---------------------------------------------------
Embedded Coder for dsPIC V0.96b2(17-Mar-2008) for Matlab R2007a.
Licence Accorded to Mariano I. Lizarraga - University of California Santa Cruz
informations available at www.kerhuel.eu
.
### Processing Template Makefile: C:\Mariano\MATLAB\dsPICBlock\dspic\dspic_pic30_gcc.tmf
### Wrapping unrecognized make command (angle brackets added)
### <C:\PROGRA~1\MATLAB\R2007a\rtw\bin\win32\gmake>
### in default batch file
### SPIMasterTest.mk which is generated from C:\Mariano\MATLAB\dsPICBlock\dspic\dspic_pic30_gcc.tmf is up to date
### Building SPIMasterTest: .\SPIMasterTest.bat
C:\Mariano\AP\Simulink\SPIMasterTest_dspic\sources>set MATLAB=C:\Program Files\MATLAB\R2007a
C:\Mariano\AP\Simulink\SPIMasterTest_dspic\sources>C:\PROGRA~1\MATLAB\R2007a\rtw\bin\win32\gmake -f SPIMasterTest.mk GENERATE_REPORT=1 ADD_MDL_NAME_TO_GLOBALS=1 MULTI_INSTANCE_CODE=0 PORTABLE_WORDSIZES=0 GENERATE_ASAP2=0 TMW_EXTMODE_TESTING=0
pic30-gcc -c -mcpu=33FJ256MC710 -O3 -fschedule-insns -fschedule-insns2 -O -I. -I..\.. -IC:\PROGRA~1\MATLAB\R2007a/simulink/include -IC:\PROGRA~1\MATLAB\R2007a/extern/include -IC:\PROGRA~1\MATLAB\R2007a/rtw/c/src -IC:\PROGRA~1\MATLAB\R2007a/rtw/c/ert -IC:\PROGRA~1\MATLAB\R2007a/rtw/c/src/ext_mode/common -IC:\Mariano\AP\Simulink\SPIMasterTest_dspic\sources -IC:\Mariano\AP\Simulink -IC:\Mariano\AP\Simulink\C_Code -IC:\PROGRA~1\MATLAB\R2007a\rtw\c\libsrc -I C:\PROGRA~1\MICROC~1\MPLABC~1\include SPIMasterTest_main.c
Microchip MPLAB C30 License Manager Version v3_02 (Build Date Nov 9 2007).
Copyright (c) 2005 Microchip Technology Inc. All rights reserved.
The MPLAB C30 license has expired.
pic30-coff-cc1.exe: warning: Options have been disabled due to expired license
In file included from c:/program files/microchip/mplab c30/bin/../support/h/p33fxxxx.h:122,
from SPIMasterTest_private.h:32,
from SPIMasterTest_main.c:28:
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7618: error: syntax error before numeric constant
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7620: error: syntax error before ':' token
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7621: error: syntax error before ':' token
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7622: error: syntax error before ':' token
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7630: error: syntax error before '}' token
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7632: error: syntax error before 'NVMCONbits'
c:/program files/microchip/mplab c30/bin/../support/h/p33FJ256MC710.h:7632: error: sfr attribute requires extern storage class
gmake: *** [SPIMasterTest_main.o] Error 0xff
### Real-Time Workshop build procedure for model: 'SPIMasterTest' aborted due to an error.
I have attached the Mdl and the C, S and H files. Any help would be greatly appreciated.
Mariano