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


Browsing this Thread:   1 Anonymous Users






Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#10
中級會員
中級會員


查看用戶資訊
真的沒有PIC16使用HI_TECH C的高手知道嗎?

發表於: 2010/2/9 12:48
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#9
中級會員
中級會員


查看用戶資訊
我放進MPLAB的Custon Build內
picc -16f877 bootldr.c -oD:\PIC\Hi_Tech_BL -zg -DVERBOSE=2 -A1ED0h

我看了nanual.pdf檔大概知道-O後面是輸出在哪個目錄
但後面的就不太清楚了
編譯後出現
(168) unknown option "-zg"
(168) unknown option "-A1ED0h"
some of the command line options you are using are now obsolete
use --help option or refer to the user manual for option details


有高手知道這部分要如何處理嗎?

發表於: 2010/2/5 17:47
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#8
中級會員
中級會員


查看用戶資訊
picc -16f877 bootldr.c -o -zg -DVERBOSE=2 -A1ED0h

這句我要在MPLAB的哪邊設定呢?

發表於: 2010/2/5 8:16
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#7
版主
版主


查看用戶資訊
看一下 Hi-Tech PICC PIC16F877A bootloader 裡的 Bootldr.txt 裡面的說明。
Microchip PIC16F87x(Amemory map with the bootloader installed

     Address
        0       
|--------------------------|
                   | 
Reset jumps to bootloader|    
        
0004    |--------------------------| 
                   |                          |
                   |                          |
        
00FF    |                          |
                   |                          |
                   |                          |
                   |                          |
                   |                          |
                   |      
Program space       |
                   |      
available for       |    <--- Available space for user programs
                   
|   downloaded programs    |
                   |                          |
                   |                          |
                   |                          |
                   |                          |
                   |--------------------------|
                   |       
Bootloader         |
        
Flash   |                          |
        
TOP     |--------------------------|    <--- Top of flash memory is device specific


        0       
|--------------------------|
                   |                          |    
                   |       
Data EEPROM        |    <--- Data EEPROM size is device specific
        EEPROM  
|                          |
        
TOP     |--------------------------|



Any program locatations of the downloaded program that would overwrite the
bootloader will be ignored
This is to ensure the integrity of the
bootloader during its execution
.

Compiling the Bootloader
#######################

The source code for the bootloader must be compiled prior to download into the
target device
The command lines used to compile the bootloader are:

picc -16f877a bootldr.--zg -A1F00h
or
picc -16f877 bootldr.--zg -DVERBOSE -A1ED0h
to put the bootloader in verbose mode 
prints a dot for each hex record read.
or
picc -16f877 bootldr.--zg -DVERBOSE=-A1ED0h
to put the bootloader in a debug mode 
all data is echoed back to the terminal

Attach file:


Link only for registered users

發表於: 2010/2/4 15:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#6
中級會員
中級會員


查看用戶資訊
剛剛試了一下,也不對

PCL equ 02h
PCLATH equ 0Ah
只是要定義這個特殊功能暫存器名稱在哪個位址上

而下面那幾行只差在ORG 00H~03H的程是跟之前的不太一樣而已

發表於: 2010/2/4 11:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#5
中級會員
中級會員


查看用戶資訊
好像不行,這寫法好像是PIC C18的寫法

我有下載HITECH C Bootloader的資料,裡面有寫到

#asm

; Reset vector redirection

; some equates for accessing the program counter
PCL equ 02h
PCLATH equ 0Ah

psect redirect,abs,class=CODE,delta=2 ;absolute psect so it goes
;to address zero


;The boot loader code has been written so that it doesn't need any
;variable initialization runtime startup code.
;Because of this, we can jump directly into the main() function.
global _main
movlw _main >> 8 ;A "long" jump to main - this will cope with
movwf PCLATH ;main being positioned anywhere
movlw _main & 0xFF
movwf PCL
#endasm

不知道這是否是將主程式main定義在0xa02這個位址開始編輯的意思

發表於: 2010/2/4 10:57
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: HITECH C如何將某副程式固定在0x1e00的位址開始編輯
#4
資深會員
資深會員


查看用戶資訊
參照:

2bod 寫道:
以前在寫51及義隆組的合語言的時候只要設定ORG 1E00H即可

現在我的程式已經全部OK了,準備要開始寫Bootloader的功能,所以想要把該副程式設定在0x1e00以後,但我試了很多方式還是無法改變副程式的位址?不知道是否要使用特殊的方式才能達到這個功能


#pragma code "subrutine" = addr

void subrutine(void)
{}

試試看

發表於: 2010/2/4 10:39
My name is jan,Jan是棒的
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


HITECH C如何將某副程式固定在0x1e00的位址開始編輯(設定程式的起始執行位址)
#3
中級會員
中級會員


查看用戶資訊
以前在寫51及義隆組的合語言的時候只要設定ORG 1E00H即可

現在我的程式已經全部OK了,準備要開始寫Bootloader的功能,所以想要把該副程式設定在0x1e00以後,但我試了很多方式還是無法改變副程式的位址?不知道是否要使用特殊的方式才能達到這個功能

發表於: 2010/2/4 10:19

Edited by Ryang on 2010年03月25日 10:16:55
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... ]

教育訓練中心

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