新聞中心

EEPW首頁(yè) > 模擬技術(shù) > 設(shè)計(jì)應(yīng)用 > 在應(yīng)用編程MAXQ微控制器中可分區(qū)擦除的程序和數(shù)

在應(yīng)用編程MAXQ微控制器中可分區(qū)擦除的程序和數(shù)

作者: 時(shí)間:2012-03-19 來(lái)源:網(wǎng)絡(luò) 收藏
程來(lái)刷新MAXQ。該方法要求主程序拷貝一個(gè)小的、可再定位的閃存編程例程到RAM中,然后再跳轉(zhuǎn)到該例程。表7列出了從RAM中執(zhí)行代碼需要注意的幾個(gè)限制。

表7. 從RAM中執(zhí)行代碼的限制

SC.UPA must be set to 0 before executing a RAM-based routine. This means that the application must jump to the RAM routine from the code segments P0 P1.
RAM cannot be accessed as data and program at the same time. This means that only the registers and hardware stack are available for data storage.
The Interrupt Vector must point to a RAM routine if interrupts are enabled. Typically interrupts are turned off and polling is used due to the simplicity of the RAM reflash routine.

閃存例程一般通過(guò)UART或者CAN接口來(lái)進(jìn)行通信。為實(shí)現(xiàn)更可靠的錯(cuò)誤恢復(fù)機(jī)制,最好是接收小的數(shù)據(jù)包,并發(fā)送某種類(lèi)型的確認(rèn)信息。圖6給出了一個(gè)更新例程。記住,在掉電之前,如果沒(méi)有成功完成重新編程,需要通過(guò)JTAG端口對(duì)重新編程。

在應(yīng)用編程MAXQ微控制器中可分區(qū)擦除的程序和數(shù)
圖6. 簡(jiǎn)化的RAM更新例程流程圖


上一頁(yè) 1 2 3 下一頁(yè)

評(píng)論


相關(guān)推薦

技術(shù)專(zhuān)區(qū)

關(guān)閉