• slider image 442
  • slider image 477
  • slider image 479
  • slider image 480
  • slider image 481
  • slider image 482
:::


Browsing this Thread:   1 Anonymous Users






Re: MPLAB X IDE 使用MCC產出PIC18F45K22的bootload運用問題
#5
資深會員
資深會員


查看用戶資訊
以下連結是MCC - 8-bit Bootloader Generator User Guide, 您可以參考一下.

http://ww1.microchip.com/downloads/en/DeviceDoc/40001779B.pdf

發表於: 2020/6/3 15:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB X IDE 使用MCC產出PIC18F45K22的bootload運用問題
#4
資深會員
資深會員


查看用戶資訊
第一個問題:

因為PIC18F系列是使用Byte Address(PIC16F是Word Address), 所以當您在Unified Bootloader Host Application GUI上面的
1. Bootloader Offset欄位要填入0x500
2. Program Memory Size欄位要填入0x8000(PIC18F45K22 flash是32KB)


第二個問題:

要透過MCC Bootloader載入的Hex file, 只能有Application(主程式). 而且此Application需要在MPLAB X IDE裡面的Code Offset去做設定(0x500), 讓Application的起始位址位移到0x500. XC8 compiler編譯出來的hex起始位址才會從0x500開始.

Attach file:



jpg  (0.00 KB)


發表於: 2020/6/3 14:51
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB X IDE 使用MCC產出PIC18F45K22的bootload運用問題
#3
初級會員
初級會員


查看用戶資訊
再延續問一個問題,
如下圖在bootloadGenerator設定Reset Vector是0x500
我要導入的HXE原始碼主程式是不是要設定程式起始位址為0x500,
如果是,要怎麼設定?

再問一個問題,要導入的HEX經由bootload燒錄可以含有MCC產出的BootCode嗎?還是只能是單純的主程式?

Attach file:



jpg  (0.00 KB)


發表於: 2020/6/3 13:34
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB X IDE 使用MCC產出PIC18F45K22的bootload運用問題
#2
資深會員
資深會員


查看用戶資訊
MCC的Peripheral裡面有一個Memory的選項, 您只要在專案中加入此Memory周邊, 並按下Generate Code後就會產生對應到該MCU的Flash Erase/Write/Read routine.

您可以使用附圖的FLASH_EraseBlock()來將Reset Vector清為0xFF.

請參考一下我剛剛使用MCC所產生的Flash Routine.

Attach file:



jpg  (0.00 KB)


jpg  (0.00 KB)


jpg  (0.00 KB)


發表於: 2020/6/3 12:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


MPLAB X IDE 使用MCC產出PIC18F45K22的bootload運用問題
#1
初級會員
初級會員


查看用戶資訊
請教一下,
我使用MCC產出PIC18F45K22的bootload Code
搭配UnifiedHost-1.16.1電腦工具來使用,
其中會檢查TBLPTR = NEW_RESET_VECTOR;是否為0xFF,
我使用Debug Mode進去看,
此位址的數值為0x00,
導致無法進入Run_Bootloader ();
請問這位只要如何清為0xFF?

我可以找到的都是舊版的bootload程序介紹,
有沒有可以提供新的bootload程序資料可以看!
謝謝~!


// *****************************************************************************
void BOOTLOADER_Initialize ()
{
if (Bootload_Required () == true)
{
Run_Bootloader (); // generic comms layer
}
STKPTR = 0x00;
asm ("goto " str(NEW_RESET_VECTOR));
}

// *****************************************************************************
bool Bootload_Required ()
{

// ******************************************************************
// Check the reset vector for code to initiate bootloader
// ******************************************************************
// This section reads the application start
// vector to see if the location is blank
TBLPTR = NEW_RESET_VECTOR; // (0xFF) or not. If blank, it runs the
// bootloader. Otherwise, it assumes the
// application is loaded and instead runs the
// application.
EECON1 = 0x80;
asm("TBLRD *+");
if (TABLAT == 0xFF)
{
return (true);
}
return (false);
}

發表於: 2020/6/2 17:41
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... ]

教育訓練中心

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