請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
初級會員
|
請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
發表於: 2020/6/3 8:54
|
|||
|
Re: 請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
版主
|
抱歉,我不懂你的意思,能否再描述清楚一點。
發表於: 2020/6/3 11:26
|
|||
|
Re: 請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
初級會員
|
我用的是PIC16F18345.
用MCC 的bootloader... 其中有看到 Write_Config () function. 我用我自己寫的UBHA (Unified Bootloader Host Application) GUI 發出 WRITE_CONFIG 命令 給PIC16F18345, 在debug 的模式下, 可以看到MCU 程式有正確跑完Write_Config () for (uint8_t i = 0; i < frame.data_length; i += 2) { NVMDATL = frame.data[i]; NVMDATH = frame.data[i+1]; StartWrite(); if ((++ NVMADRL) == 0x00) { ++ NVMADRH; } } frame.data[0] = COMMAND_SUCCESS; 並回覆 COMMAND_SUCCESS.. 但讀回 CONFIG WORD... 並無改變.. 想請問 CONFIG WORD 是可被Write 嗎?? 還是 READ ONLY??
發表於: 2020/6/3 14:57
|
|||
|
Re: 請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
資深會員
|
我剛剛有使用PIC16F18446 Curiosity Nano來做測試, 我將Application FW的Configuration Word中的FCMEN改成ON來做燒錄測試(Bootloader的FCMEN=OFF).
我是透過Command Line mode去開啟UBHA的Logger功能來觀察UBHA送給MCU的封包, 雖然UBHA GUI有將Hex file中Configuration Word的起始位址0x8007的資料0x3FDC(FCMEN=ON)丟給MCU, 但是MCU並沒有去燒錄(還是原本的值0x1FDC). 測試完後, 我透過MPLAB X IDE讀回flash的資料並存成Hex file來看FCMEN bit, Configuration Word並沒有被燒錄. 請參考我的附圖. p.s.: 不建議燒錄Hex時去燒錄Configuration Word. Attach file: (0.00 KB) (0.00 KB)
發表於: 2020/6/3 16:56
Edited by GodBlessU on 2020年06月03日 17:19:05
|
|||
|
Re: 請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
資深會員
|
您可以參考一下下面Microchip 8-bit Bootloader Generator User Guide.
http://ww1.microchip.com/downloads/en/DeviceDoc/40001779B.pdf 裡面有提到絕大部分PIC16系列的Configuration Words只能透過外部的燒錄器來做改變, 無法透過Bootloader的方式來做更改. 請參考下面的截圖. Attach file: (0.00 KB)
發表於: 2020/6/4 9:17
|
|||
|
Re: 請問用MCC 產生的 Write_Config() 可Write Config word 嗎????
|
||||
---|---|---|---|---|
初級會員
|
OK.. 謝謝您的說明
發表於: 2020/6/4 9:56
|
|||
|