PIC Vietnam

PIC Vietnam (http://www.picvietnam.com/forum/index.php)
-   dsPIC - Bộ điều khiển tín hiệu số 16-bit (http://www.picvietnam.com/forum/forumdisplay.php?f=29)
-   -   mplab c30 (http://www.picvietnam.com/forum/showthread.php?t=12997)

chairman_t 10-01-2012 06:20 PM

mplab c30
 
các bác xem giùm nó báo lỗi gì???

#include <p30F2020.h>

_FOSC(CSW_FSCM_OFF & FRC_PLL4);
_FWDT(WDT_OFF);
_FBORPOR(PBOR_OFF & MCLR_EN);
_FGS(CODE_PROT_OFF);

//------------------------------------------------------------------------------

#define Fcy 8000000 //Tan so thuc thi lenh
#define Fpwm 100000 //Tan so PWM = 100 kHz

//Chuong trinh con khoi tao module PWM
void Init_MCPWM(void)
{
PTPER = Fcy/Fpwm - 1; //Dat thanh ghi chu ky voi tan so PWM = 100 kHz
SEVTCMP = PTPER;
PWMCON1 = 0x0111; //Chi dung cac chan PxL, mot cach doc lap
DTCON = 0x0032;
OVDCON = 0xFF00; //Khong dung overdrive
PDC1 = 0x0064; //Khoi tao PWM1, 2 la 25%
PWMCON2 = 0x0F00; //Postscale = 1:16
PTCON = 0x8000; //Kich hoat module PWM
}

int main(void)
{
Init_MCPWM();
}

lỗi báo là:
Debug build of project `D:\ve mach\dspic\2020.mcp' started.
Language tool versions: pic30-as.exe v3.30, pic30-ld.exe v3.30, pic30-ld.exe v3.30, pic30-ar.exe v3.30
Preprocessor symbol `__DEBUG' is defined.
Tue Jan 10 17:11:13 2012
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-ld.exe" -mcpu=30F2020 -x c -c "dsp.c" -o"dsp.o" -D__DEBUG -g -Wall
C:\Program Files\Microchip\MPLAB C30\bin\bin/pic30-coff-ld.exe: unrecognised emulation mode: cpu=30F2020
Supported emulations: pic30_coff
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `D:\ve mach\dspic\2020.mcp' failed.
Language tool versions: pic30-as.exe v3.30, pic30-ld.exe v3.30, pic30-ld.exe v3.30, pic30-ar.exe v3.30
Preprocessor symbol `__DEBUG' is defined.
Tue Jan 10 17:11:19 2012
----------------------------------------------------------------------
BUILD FAILED

chairman_t 12-01-2012 11:49 AM

tôi đang dùng dspic30f2020 viết chương trình dùng clock nội thì nó chạy được còn dùng thạch anh không hiểu sao nó không hoạt động được?


Múi giờ GMT. Hiện tại là 01:11 AM.

Tên diễn đàn: vBulletin Version 3.8.11
Được sáng lập bởi Đoàn Hiệp.
Copyright © PIC Vietnam