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

論壇索引


Board index » All Posts (jackielee)




請問AN851 bootloader for 18F4520
#21
初級會員
初級會員


Hi 版主
小弟依循AN851文件做bootloader的練習(用實驗版App001)
其中
使用MPASMWIN5.11 compile asm file
過程中 發生一些 compile error 修正如下
========================
; Setup the appropriate registers.
Setup clrf EECON1
setf EEADR ; Point to last location
;setf EEADRH <<===修改
bsf EECON1, RD; Read the control code
incfsz EEDATA, W
bra RVReset ; If not 0xFF normal reset

bcf TRISC, 6 ; Setup tx pin
; bsf TRISC, 7 ; Setup rx pin

movlw b'10010000' ; Setup rx and tx
;movwf RCSTA1<<===修改
movwf RCSTA
movlw b'00100110'
;movwf TXSTA1<<===修改
movwf TXSTA
略(修改處太多, 不過大多是register define 不同between4520 and 8720)
========================
Compile 後的Hex file
由ICD2 download到18F4520後App01上的黃燈 卻不會熄滅(維持在ICD2連線模式 - 已移除ICD2 connection)
謝謝版主(能有比較基本的sample嗎, 因為單靠AN851我好像陷住了)
PS.
a.觀察AN851似乎沒做config bit 設定
我做了實驗 加在asm code 不過狀況一樣
b.同時flash後, 再flash其他code也會失敗(出現黃燈-ICD2 disconnected狀態) - 但是再flash其他code 前先用icd2 erase part 再行flash "APP001_4520_Test" 成功(disconnect icd2)不出現黃燈, 但是實驗版上的MAXIM232突然變的很燙.

發表於: 2008/3/30 12:08
頂部


Re: 請問 PIC Tiny Bootloader for 18F4520
#22
初級會員
初級會員


Hi Ryang:
好的
有進一步問題
再請教您
Thanks

發表於: 2008/3/24 16:57
頂部


Re: 請問 PIC Tiny Bootloader for 18F4520
#23
初級會員
初級會員


Dear Ryang:
以下是我update 的流程
1. use icd2 update bootloader + User main code
2. use Tiny Bootloader AP flash vis RS-232(只有 download user main code - 這樣才不會over write boot code)
錯誤訊息如下
==================================
Connected to \\.\COM2 at 9600
HEX: 1 hours old, INHX32,18Fcode+eeprom , total=9839 bytes.
Searching for PIC ...
Found:18F 252o/452o
WARNING: GOTO not found in first 4 words
Addr:000h -> 00h
Could not write
ERROR!
==================================
其中 "GOTO not found in first 4 words" 我在asm code 中已經指定跳到main code
=============
;0000000000000000000000000 RESET 00000000000000000000000000

ORG 0x0000
GOTO IntrareBootloader

;view with TabSize=4
;&&&&&&&&&&&&&&&&&&&&&&& START &&&&&&&&&&&&&&&&&&&&&&
;---------------------- Bootloader ----------------------
;PC_flash: C1h U H L x ... <64 bytes> ... crc
;PC_eeprom: C1h 40h EEADR EEDATA 0 crc
;PC_cfg C1h U OR 80h H L 1 byte crc
;PIC_response: type `K`

ORG first_address ;space to deposit first 4 instr. of user prog.
GOTO main_address
nop
nop
ORG first_address+8


=============
請問對這問題有何看法
還有 光碟片上 有看到 HI-TECH的Boot loader (C code,APP001 tool disc),我們可以使用嗎?
另外 MCC18與HI-TECH有何不同?
依您所見 哪一種方式 適合我開發bootloader in APP001 實驗版 (tiny bootloader or Hi-Tech C boot loader?)
麻煩您了!!

發表於: 2008/3/22 17:09
頂部


Re: 請問 PIC Tiny Bootloader for 18F4520
#24
初級會員
初級會員


版主你好
這一點我在code中也做了一些設定(Config bit)
應該是compile 版本不同 所以 寫法有些差距(還是我根本寫錯了??)
以下是我code中的設定
ASM Code
----------------------------------------------------

;Setup CONFIG5L
CONFIG CP0 = OFF, CP1 = OFF, CP2 = OFF, CP3 = OFF
;Setup CONFIG5H
CONFIG CPB = OFF, CPD = OFF
;Setup CONFIG6L
CONFIG WRT0 = OFF, WRT1 = OFF, WRT2 = OFF, WRT3 = OFF
;Setup CONFIG6H
CONFIG WRTB = OFF, WRTC = OFF, WRTD = OFF
;Setup CONFIG7L
CONFIG EBTR0 = OFF, EBTR1 = OFF, EBTR2 = OFF, EBTR3 = OFF
;Setup CONFIG7H
CONFIG EBTRB = OFF
以上這些設定
還是無法 完成 , 是我哪邊還有設定錯誤嗎??
PS. 我使用MPASM 5.15版

發表於: 2008/3/20 20:16
頂部


請問 PIC Tiny Bootloader for 18F4520
#25
初級會員
初級會員


板大及各位先進好
目前 敝人想在自己使用的PIC 18F4520加入BootLoader的功能
看來看去 就選定了使用Tiny bootloader練習
以下是我使用過程中 遇到的問題及解決方式
1. ASM 部分
Line2 LIST P=18F252==>>LIST P=18F4520 改成使用PIC
Line 19~28
__CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
改成 CONFIG IESO=OFF, OSC=HS 因為compiler版本不同
Line 94
nop ===>>GOTO main_address 其中 main address 就是主程式 C語言的起點(我用0x200)
2. C的部份
因為要變更 C的主程式放置位置為0x200
a. 將C:\MCC18\src\traditional\startup 中的 c018i.c 加到 你的mplab 專案
變更之中的==>>#pragma code _entry_scn=0x000000
成==>>#pragma code _entry_scn=0x000200
b. 將18F4520.lkr 中的(C:\MCC18\lkr) line 7 ==>>FILES c018i.o mark成 //FILES c018i.o
經過以上步驟
Compile 成功\r
問題如下
PC可以連到PIC 18F4520但是在update 程式(透過RS-232)發生 "OVER write boot area denied" 意思是說不可複寫開機區 完整英文忘了
請問版主與先進 我還需要處裡哪邊呢????
PS 已經config bit 將防寫機制 全部取消了
Thanks 版主與先進們的意見

發表於: 2008/3/20 1:54
頂部


Re: 請問版大,關於C語言的Bootloader
#26
初級會員
初級會員


請問bootloader with 18F4520 有相關參考文件 或書籍嗎??
麻煩請給我ㄧ些建議!!
因為 如果 都需要用ICD2 update 看起來不是很方便
謝謝版大
jackieli.tw@yahoo.com
2008/03/14
版大 可以將C的Bootloader寄一份給我嗎
我很需要這個功能, 謝謝您的幫忙.

發表於: 2008/2/13 23:56
頂部



« 1 2 (3)



:::

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

教育訓練中心

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