Re: 求助,关于初始化总是复位的错误,附原程序,谢谢
|
||||
---|---|---|---|---|
版主
|
看起來像是發生了 Address Error 產生了 Error Trap。最簡單的除錯方式可以用 MPLAB SIM (軟件仿真)找一下錯誤的程式在哪裡。
發表於: 2008/10/13 9:31
|
|||
|
Re: 求助,关于初始化总是复位的错误,附原程序,谢谢
|
||||
---|---|---|---|---|
新會員
|
芯片是用dsPIC33FJ256GP710.
發表於: 2008/10/12 23:05
|
|||
|
求助,关于初始化总是复位的错误,附原程序,谢谢
|
||||
---|---|---|---|---|
新會員
|
CORE-E0004: Trap due to unimplemented FLASH memory access, occurred from instruction at 0x0004b2
这类是什么错误,要怎么样能消除? 附程序: int main(void) { // Configure Oscillator to operate the device at 40Mhz // Fosc= Fin*M/(N1*N2), Fcy=Fosc/2 // Fosc= 8M*40(2*2)=80Mhz for 8M input clock PLLFBD=38; // M=40 CLKDIVbits.PLLPOST=0; // N1=2 CLKDIVbits.PLLPRE=0; // N2=2 OSCTUN=0; // Tune FRC oscillator, if FRC is used RCONbits.SWDTEN=0; /* Disable Watch Dog Timer*/ while(OSCCONbits.LOCK!=1) {}; /* Wait for PLL to lock*/ IO_init(); UART2_init(); //////////////注释掉这条语句,程序就正常走,加了这个,就出问题,总在这儿发生一个,上面所示的错误 LCD_init(); line0_puts(mytext); line1_puts("DEMO"); ADC_init(); PWM_init(); while(1) { if(_RE0 == 0) { DELAYMS(10); if(_RE0 == 0){ line1_puts("SEND 'H'.."); } } } } /******************************************************************************/ void IO_init() { AD1PCFGL = 0xFFFF; AD1PCFGH = 0xFFFF; AD2PCFGL = 0xFFFF; PORTE = 0x0000; TRISE = 0xFF0F; } void UART2_init() { // configure U2MODE U2MODE = 0; U2BRG = 240; // 40Mhz osc, 9600 Baud U2STA = 0; IPC7 = 0x7700; // Mid Range Interrupt Priority level, no urgent reason IFS1bits.U2TXIF = 0; // Clear the Transmit Interrupt Flag IEC1bits.U2TXIE = 1; // Enable Transmit Interrupts IFS1bits.U2RXIF = 0; // Clear the Recieve Interrupt Flag IEC1bits.U2RXIE = 1; // Enable Recieve Interrupts U2MODEbits.UARTEN = 1; // And turn the peripheral on U2STAbits.UTXEN = 1; // I think I have the thing working now. } 请DX帮忙看看!谢谢
發表於: 2008/10/12 23:03
|
|||
|