芯片用的是DsPIC33FJ128GP708。一段简单的代码,点亮LED。编程后LED没有点亮,但是切换到调试模式下就能点亮,看了端口的值也是正确的。这是怎么回事?
- _FBS(RBS_LARGE_BOOT_RAM & BSS_HIGH_LARGE_BOOT_CODE & BWRP_WRPROTECT_ON );
- _FSS(RSS_LARGE_RAM & SSS_HIGH_LARGE_SEC_CODE & SWRP_WRPROTECT_ON);
- _FGS( GSS_HIGH & GCP_ON & GWRP_OFF );
- _FOSCSEL(FNOSC_PRI & IESO_OFF);
- _FOSC(FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMD_HS );
- _FWDT(FWDTEN_OFF);
- _FPOR(FPWRT_PWR128);
- _FICD(0x21);
- void main()
- {
- TRISD = 0xFF00;
- _LATD3=1;
- _LATD0=1;
- _LATD1=1;
- _LATD2=1;
- while(1);
-
- }
复制代码
一周热门 更多>