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


Browsing this Thread:   1 Anonymous Users




« 1 (2)


Re: pic16F685的問題
#3
版主
版主


查看用戶資訊
org 0x00
goto start
org 0x04
goto timer_isr
start
:
.
.
.
main:
movfw count_tb
call LDTAB
movwf PORTC
goto main
timer_isr
:
.
.
.
retfie

LDTAB movwf PC
org 0x0050
retlw 0xa0 
;0
retlw 0xbb 
;1
retlw 0x62 
;2
retlw 0x2a 
;3
retlw 0x39 
;4
retlw 0x2c 
;5
retlw 0x24 
;6
retlw 0xb8 
;7
retlw 0x20 
;8
retlw 0x28 
;9
END


1. org 的語法請儘量改用 code 的定址方式
2. 建議將表格放在 0xnn00 的起始位址。
改寫你的程式如下:
[color=ff0000]

RESET_VECTOR    CODE    0x0000    processor reset vector
        
goto    start             go to beginning of program


INT_VECTOR      CODE    0x0004    
interrupt vector location    code     0x00

    
goto     timer_isr

 
Main_Prog    code    0x0100
LDTAB
     addwf     PCL
,F
    retlw     0xa0 
;0
    retlw     0xbb 
;1
    retlw     0x62 
;2
    retlw     0x2a 
;3
    retlw     0x39 
;4
    retlw     0x2c 
;5
    retlw     0x24 
;6
    retlw     0xb8 
;7
    retlw     0x20 
;8
    retlw     0x28 
;9
;
start:
    
movfw     count_tb ; ???
    
movlw    0x00
    call     LDTAB
    movwf     PORTC
    
goto     main
;
timer_isr:
.
.
.
    
retfie[/color]

發表於: 2008/10/30 11:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic16F685的問題
#2
高級會員
高級會員


查看用戶資訊
LDTAB movwf PC
; org 0x0050 <---------------此行是多餘的 , 不然就將查表放到 goto timer_isr 後
retlw 0xa0 ;0
retlw 0xbb ;1
retlw 0x62 ;2
retlw 0x2a ;3
retlw 0x39 ;4
retlw 0x2c ;5
retlw 0x24 ;6
retlw 0xb8 ;7
retlw 0x20 ;8
retlw 0x28 ;9
END

發表於: 2008/10/30 10:31
學問就是要多學多問
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


pic16F685的問題
#1
初級會員
初級會員


查看用戶資訊
我的問題
MPLINK 4.21, Linker
Copyright (c) 2008 Microchip Technology Inc.
Error - section '.org_2' can not fit the absolute section. Section '.org_2' start=0x00000050, length=0x00000014
Errors : 1

用的是PIC16F685
看過之前的文章,修改LKR文件可以,可是不知道怎麼改

有試著把page0和page1的START和END做變動,但是還是會得到上面的問題,麻煩大大們指導一下,感謝!

LKR文件(16F685.lkr)

LIBPATH .
CODEPAGE NAME=page0 START=0x0 END=0x7FF
CODEPAGE NAME=page1 START=0x800 END=0xFFF
CODEPAGE NAME=.idlocs START=0x2000 END=0x2003 PROTECTED
CODEPAGE NAME=.config START=0x2007 END=0x2007 PROTECTED
CODEPAGE NAME=.calib START=0x2008 END=0x2008 PROTECTED
CODEPAGE NAME=eedata START=0x2100 END=0x21FF PROTECTED

我的程式
org 0x00
goto start
org 0x04
goto timer_isr
start:
.
.
.
main:
movfw count_tb
call LDTAB
movwf PORTC
goto main
timer_isr:
.
.
.
retfie

LDTAB movwf PC
org 0x0050
retlw 0xa0 ;0
retlw 0xbb ;1
retlw 0x62 ;2
retlw 0x2a ;3
retlw 0x39 ;4
retlw 0x2c ;5
retlw 0x24 ;6
retlw 0xb8 ;7
retlw 0x20 ;8
retlw 0x28 ;9
END

最後是查表的東西

發表於: 2008/10/29 23:01
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... ]

教育訓練中心

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