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

論壇索引


Board index » All Posts (yiming)




Re: 接收LIN同步信號問題?
#31
資深會員
資深會員


印象中UART遇到ERROR要CREN關閉再開,但這顆MCU沒有CREN有類似的機制嗎?

發表於: 2021/12/15 17:53
頂部


Re: 專案失聯?
#32
資深會員
資深會員


謝謝

發表於: 2021/12/15 17:51
頂部


接收LIN同步信號問題?
#33
資深會員
資深會員


MCU:dsPIC33EV64GM104
開發板:DM330018_Starter_Kit_Demo
我自己發送LIN的同步信號出去再送8個BYTE資料和checksum(每200ms送一次資料)
因為MCP2021A送出的資料自己也會收到,我試著用範例程式的做法等收到同步信號也就是產生FERR訊框錯錯時設定LIN_START=1準備開始收資料,但我卻發現_U1ErrInterrupt
一直被觸發但不是OERR,FERR,PERR 我用LED做測試,LED2會一直閃爍表示一直在中斷
但LED3卻沒亮...

到底是為什麼_U1ErrInterrupt一直被中斷 量了一下也是200ms被中斷一次,也就是說是收到同步信號才產生的中斷,我試著將同步信號取消(11BIT LO)_U1ErrInterrupt就不會被中斷了





void __attribute__((interrupt, no_auto_psv)) _U1ErrInterrupt(void)
{
if (U1STAbits.OERR == 1)
{
U1STAbits.OERR = 0;
LED3_SetHigh();
}

if (U1STAbits.PERR == 1)
{
U1STAbits.PERR = 0;
LED3_SetHigh();
}

if (U1STAbits.FERR == 1)
{
lin_start = 1; // first message detection phase
// U1STAbits.OERR = 0;
LED3_SetHigh();
}
LED2_Toggle();
IFS4bits.U1EIF = 0;
}

void LIN_Transmit(void)
{
// send break followed by 0x55 'autobaud' byte
while (U1STAbits.TRMT == 0); // wait for transmitter empty
while (U1STAbits.UTXBRK == 1); // wait for HW to clear the previous BREAK
U1STAbits.UTXEN = 1; // Enable UART TX
U1STAbits.UTXBRK = 1; // set the BREAK bit
U1TXREG = 0; // dummy write to trigger UART transmit
Nop(); // must wait 1 instruction cycle
U1TXREG = 0x55; // AUTO-BAUD sync character per J2602 spec

// send the LIN_MESSAGE_ID byte, is arbitrary but must be in the range 0x00 to 0x3B
// there are also 2 parity bits sent
LIN_ID = 0x23;
p0 = (LIN_ID & 0x01) ^ ((LIN_ID & 0x02) >> 1) ^ ((LIN_ID & 0x04) >> 2) ^ ((LIN_ID & 0x10) >> 4);
p0 = p0 & 0x01; // get bit value
p1 = ~(((LIN_ID & 0x02) >> 1) ^ ((LIN_ID & 0x08) >> 3) ^ ((LIN_ID & 0x10) >> 4) ^ ((LIN_ID & 0x20) >> 5));
p1 = p1 & 0x01; // get the bit value
id_byte = (p1 << 7) | (p0 << 6) | LIN_ID; // stuff parity bits into proper places

// form protected ID byte and transmit it
// the bit stuffing is optional, used here to test LIN receiver hardware
checksum = id_byte; // initial checksum value (limited to a byte value)
while (U1STAbits.TRMT == 0); // wait for transmitter empty
Nop();
U1TXREG = id_byte; // transmit the protected ID byte

//等SLAVE回資料

}

發表於: 2021/12/15 16:48
頂部


專案失聯?
#34
資深會員
資深會員


模擬板:DM330018_Starter_Kit_Demo
模擬時當機 強制關MPLAB X IDE 或關機...
就會出現附件中的狀況,請問該如何復原??
有時開啟別的專案就會自動復原

Attach file:



jpg  圖片 037.jpg (39.61 KB)
546_61b6e6f8edb08.jpg 592X408 px

發表於: 2021/12/13 14:23
頂部


Re: 請問用實板 板上的燒錄/模擬電路需要注意什麼??
#35
資深會員
資深會員


弄好了 原來是我把板子上的JP1移除了 MCU沒有電源,把JP1接回去就可以了

發表於: 2021/12/13 11:22
頂部


Re: 是否有自動加入標頭檔的功能???
#36
資深會員
資深會員


原來是這樣用 謝謝!

發表於: 2021/12/13 11:14
頂部


請問用實板 板上的燒錄/模擬電路需要注意什麼??
#37
資深會員
資深會員


實驗板:DM330018_Starter_Kit_Demo
有指定振盪方式和燒錄腳位嗎?
我是採用板上的USB做燒錄和模擬

錯誤訊息如下:
Programming/Verify complete
The target device is not ready for debugging. Please check your configuration bit settings and program the device before proceeding. The most common causes for this failure are oscillator and/or PGC/PGD settings.

發表於: 2021/12/13 11:10
頂部


是否有自動加入標頭檔的功能???
#38
資深會員
資深會員


是否有自動加入標頭檔的功能???
是否有快捷鍵? 或如何設定??

發表於: 2021/12/8 22:54
頂部


Re: 開啟專案 編譯錯誤
#39
資深會員
資深會員


找到問題了
在專案名稱點右鍵rename ,連帶更改專案資料夾名稱也打勾 就可以了.

原來是我複製專案時 "手動" 更改資料名稱所造成的。

發表於: 2021/12/1 11:30
頂部


Re: 開啟專案 編譯錯誤
#40
資深會員
資深會員


發現一行錯誤訊息:

The program file could not be loaded: Project is missing critical information

發表於: 2021/12/1 10:54
頂部



« 1 2 3 (4) 5 6 7 ... 95 »



:::

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... ]

教育訓練中心

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