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


Browsing this Thread:   1 Anonymous Users






Re: 關於16F15224 FLASH寫的問題
#7
初級會員
初級會員


查看用戶資訊
與Darren進行MAIL確認後

最新版本的DATASHEET已將舊版的
"The maximum Program Flash Memory address for the 0x3FFF family is 0x07FF."

已更新為
The maximum Program Flash Memory address for the PIC16F152 family is 0x3FFF.

那若是這樣的訊息就沒什麼問題了



抱歉~忘了第一時間檢查DATASHEET是否為最新版本

感謝大家幫忙,

結案~

發表於: 2023/3/8 8:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16F15224 FLASH寫的問題
#6
管理員
管理員


查看用戶資訊
sakanayy 您好

"The maximum Program Flash Memory address for the 0x3FFF family is 0x07FF."

方便提供這是在Datasheet 哪一頁看到的嗎?

或者可以發送mail:Darren.Chen@microchip.com

如果需要電話討論,可以撥打免費技術服務專線:0800-717718

謝謝

發表於: 2023/3/7 12:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16F15224 FLASH寫的問題
#5
初級會員
初級會員


查看用戶資訊
感謝biko的補充說明,對於我觀念的建立很有幫助

Program Memory Size (Words)區間~這我算是懂了


但.....

The maximum Program Flash Memory address for the 0x3FFF family is 0x07FF.

0x3FFF family? 如何判定是0x3FFF family? 或何謂0x3FFF family?

0x3FFF family is 0x07FF.? <== 如何看這東西,

為什麼0x3FFF family 就等於最大位址 0x07FF.?


抱歉~如果是我腦袋轉不過來請多包涵

發表於: 2023/3/6 16:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16F15224 FLASH寫的問題
#4
資深會員
資深會員


查看用戶資訊
所以~0X3FFF,0X07FF,0XFFF這3者是什麼關係?

要弄懂這個的話,您需要抓兩個datasheet,因為 PIC16F152 Family 的 Program Flash Memory 從 3.5k到28k都有,但是卻分成兩個datasheet,您可用下列兩組型號搜尋:
PIC16F15224(7k)、PIC16F15223(3.5K)
PIC16F15276(28k)
然後再對照 兩個 datasheet 的 9.1 Program Memory Organization

_______________Program Memory Size (Words)___Last Memory Address
-------------------------------------------------------------------------------------------------------------
PIC16F15244____4096_______________________0x0FFF
PIC16F15223____2048_______________________0x07FF
PIC16F15276____16384______________________0x3FFF

如果您選用的是 PIC16F15276,那麼定址就可以到 0x3FFF,因為定址超過 255 那當然就用uint16_t來存放囉,當然最多也只能到 0x3FFF。因為它的最大定址就是只到 0x3FFF

0x07FF指的是 PIC16F15223 這種Program Memory Size = 2048的MCU,而您用的是 PIC16F15224,它的 Program Memory Size = 4096(0x1000),
所以您針對 0x0E00位址寫入資料當然也是可行的,因為 0x0E00 本來就在 0x1000以內。

發表於: 2023/3/4 4:38
我相信解決問題的方法不只一種,所以我在回答同好的問題時或者提出與主題不同的方案,
請不要以此做為攻擊的目標,畢竟我也只是想和大家討論如何解決問題而已…
解決問題最重要,.....
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16F15224 FLASH寫的問題
#3
初級會員
初級會員


查看用戶資訊
感謝Darren的回覆

不過關於0X3FFF與0X7FF是什麼關係~我還是弄不清楚

DATASHEET說最大到0X7FF,但我明明針對0XE00位址進行寫入資料,功能也正常,

所以也不是DATASHEET說的最大到0X7FF,不然我應該無法針對位址0XE00進行寫入處理?


希望有不同見解的人解說一下

謝謝

發表於: 2023/3/3 9:10
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於16F15224 FLASH寫的問題
#2
管理員
管理員


查看用戶資訊
Hi sakanayy

void FLASH_WriteWord(uint16_t flashAddr, uint16_t *ramBuf, uint16_t word);

uint16_t flashAddr : The maximum Program Flash Memory address for the PIC16F152 family is 0x3FFF(參考Datasheet P.107)

uint16_t word > NVMDAT 暫存器,此暫存器只有14 Bits。 (詳細請參考Datasheet P.121)

關於PIC16F15224 Flash 用法,可參考Datasheet P.114 圖 15-4)

謝謝

發表於: 2023/3/2 10:29
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


關於16F15224 FLASH寫的問題
#1
初級會員
初級會員


查看用戶資訊
晶片:16F15224

The maximum Program Flash Memory address for the 0x3FFF family is 0x07FF

可是,我用PROGRAM MEMORY視窗觀看只到0XFFF

所以~0X3FFF,0X07FF,0XFFF這3者是什麼關係?

我用MCC產生的CODE,測試 FLASH_WriteWord 函數後,用PROGRAM MEMORY視窗觀看,我可以寫0XE00沒問題阿,那上面那段英文寫最大到0X7FF又是什麼意思?
https://www.microchip.com.tw_data_lib/ ... che/887_63ff25fb21478.jpg



另外,MCC產生的程式碼

uint16_t word <== 最大值應該到0X3FFF而以吧?而不是 uint16的0XFFFF ?

還是說不要大於0XFF,以0X3FFF而言,0X3F好像代表命令並非資料?

void FLASH_WriteWord(uint16_t flashAddr, uint16_t *ramBuf, uint16_t word)
{
uint16_t blockStartAddr = (uint16_t)(flashAddr & ((END_FLASH-1) ^ (ERASE_FLASH_BLOCKSIZE-1)));
uint8_t offset = (uint8_t)(flashAddr & (ERASE_FLASH_BLOCKSIZE-1));
uint8_t i;

// Entire row will be erased, read and save the existing data
for (i=0; i {
ramBuf[i] = FLASH_ReadWord((blockStartAddr+i));
}

// Write at offset
ramBuf[offset] = word;

// Writes ramBuf to current block
FLASH_WriteBlock(blockStartAddr, ramBuf);
}

抱歉~我想貼圖,但一直弄不好,我擔心可能沒圖

Attach file:



jpg  擷取3.JPG (104.58 KB)
887_63ff267f49a1c.jpg 1026X537 px

發表於: 2023/3/1 18:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

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

教育訓練中心

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