• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::

論壇索引


Board index » All Posts (fjzslin)




Re: 求助,关于初始化总是复位的错误,附原程序,谢谢
#1
新會員
新會員


芯片是用dsPIC33FJ256GP710.

發表於: 2008/10/12 23:05
頂部


求助,关于初始化总是复位的错误,附原程序,谢谢
#2
新會員
新會員


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
頂部


Re: 请问,dspic33FJ128GP710能否四路PWM,同时输出?
#3
新會員
新會員


感谢,问题解决了,基于Timer2输出一组可变频的PWM,基于Timer3同时输出三路,频率不变的PWM。

發表於: 2008/10/6 19:49
頂部


请问,dspic33FJ128GP710能否四路PWM,同时输出?
#4
新會員
新會員


问题如上,谢谢,
四路PWM同时输出,对应的时基怎么选?感谢回答
看了,文档里:
Each output compare channel can use one of two selectable time bases. Refer to the device data sheet for the time bases associated with the module.
不知如何解!

發表於: 2008/10/6 8:44
頂部






:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------