Hola.
Soy nuevo en este tema del dsPic y del compilador C30 y tengo una serie de dudas, ya que no consigo utilizar las librerias que vienen con el C30.
En principio sigo los pasos correctamente:
Nuevo proyecto, selecciono el dspic, selecciono el toolsuite C30 y añado mis archivos.
Ademas, en build options->project, pestaña Directories, agrego el directorio:
C:\Program Files (x86)\Microchip\MPLAB C30\lib - en Library search path
C:\Program Files (x86)\Microchip\MPLAB C30\support\peripheral_30F_24H_33F - Include search path
Cuando quiero llamar a una funcion, por ejemplo de pwm:
void Init_PWM2(void)
{
unsigned int config, config1, config2, config3;
config = (PWM_INT_DIS & PWM_FLTA_DIS_INT & PWM_FLTA_INT_PR0 & PWM_FLTB_DIS_INT);
ConfigIntMCPWM( config );
unsigned int dutycyclereg = 1;
unsigned int dutycycle = 0x3FFF;
unsigned int updatedisable = 0;
SetDCMCPWM(dutycyclereg,dutycycle,updatedisable);
unsigned int period = 0x7fff;
unsigned int sptime = 0x0;
config1 = (PWM_EN & PWM_PTSIDL_DIS & PWM_OP_SCALE16
& PWM_IPCLK_SCALE16 & PWM_MOD_UPDN);
config2 = (PWM_MOD1_COMP & PWM_PDIS4H & PWM_PDIS3H &
PWM_PDIS2H & PWM_PEN1H & PWM_PDIS4L &
PWM_PDIS3L & PWM_PDIS2L & PWM_PEN1L);
config3 = (PWM_SEVOPS1 & PWM_OSYNC_PWM & PWM_UEN);
OpenMCPWM(period,sptime,config1,config2,config3);
}
al compilar me devuelve errores
main.c: In function 'Init_PWM2':
main.c:303: error: 'PWM_INT_DIS' undeclared (first use in this function)
main.c:303: error: (Each undeclared identifier is reported only once
main.c:303: error: for each function it appears in.)
main.c:303: error: 'PWM_FLTA_DIS_INT' undeclared (first use in this function)
main.c:303: error: 'PWM_FLTA_INT_PR0' undeclared (first use in this function)
main.c:303: error: 'PWM_FLTB_DIS_INT' undeclared (first use in this function)
main.c:304: warning: implicit declaration of function 'ConfigIntMCPWM'
main.c:310: warning: implicit declaration of function 'SetDCMCPWM'
main.c:314: error: 'PWM_EN' undeclared (first use in this function)
main.c:314: error: 'PWM_PTSIDL_DIS' undeclared (first use in this function)
main.c:315: error: 'PWM_OP_SCALE16' undeclared (first use in this function)
main.c:315: error: 'PWM_IPCLK_SCALE16' undeclared (first use in this function)
main.c:315: error: 'PWM_MOD_UPDN' undeclared (first use in this function)
main.c:317: error: 'PWM_MOD1_COMP' undeclared (first use in this function)
main.c:317: error: 'PWM_PDIS4H' undeclared (first use in this function)
main.c:317: error: 'PWM_PDIS3H' undeclared (first use in this function)
main.c:318: error: 'PWM_PDIS2H' undeclared (first use in this function)
main.c:318: error: 'PWM_PEN1H' undeclared (first use in this function)
main.c:318: error: 'PWM_PDIS4L' undeclared (first use in this function)
main.c:319: error: 'PWM_PDIS3L' undeclared (first use in this function)
main.c:319: error: 'PWM_PDIS2L' undeclared (first use in this function)
main.c:319: error: 'PWM_PEN1L' undeclared (first use in this function)
main.c:321: error: 'PWM_SEVOPS1' undeclared (first use in this function)
main.c:321: error: 'PWM_OSYNC_PWM' undeclared (first use in this function)
main.c:321: error: 'PWM_UEN' undeclared (first use in this function)
main.c:323: warning: implicit declaration of function 'OpenMCPWM'
Halting build on first failure as requested.
Alguien sabe a que es debido?
muchas gracias