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


Browsing this Thread:   1 Anonymous Users






Re: PCL跟PCLATH的問題
#7
資深會員
資深會員


查看用戶資訊
參照:

starchern 寫道:
PCL+W超過的部份
不會跑到PCLAH嗎??
無法從程式裡去考慮嗎??
所以如果有要用到查表的
開始位置要自己定比較保險喔


在PIC裏,PCH和PCLATH是不一樣的!

發表於: 2008/9/10 15:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PCL跟PCLATH的問題
#6
高級會員
高級會員


查看用戶資訊
沒看到你的LAB...
更正..
table
MOVLW #H'01' ;LOOK LIST
MOVWF PCLATH
addwf PCL,f

發表於: 2008/9/10 15:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PCL跟PCLATH的問題
#5
高級會員
高級會員


查看用戶資訊
如果超過0FFH的話!
可以查看*.LST檔!!
超過0FFH就設PCLATH為1
超過1FFH就設PCLATH為2
以此類推!!!
MOVLW #H'01' ;LOOK LIST
MOVWF PCLATH
table addwf PCL,f
retlw '0'
retlw '1'
retlw '2'
retlw '3'
retlw '4'
retlw '5'
retlw '6'
retlw '7'
retlw '8'
retlw '9'
return

發表於: 2008/9/10 15:12
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PCL跟PCLATH的問題
#4
版主
版主


查看用戶資訊
所以說這是陷阱,查表最好從 0xnn00 的位址開始。

addwf PCL,F 後的進位是沒用的,PCL 只有 8-bit 所以沒辦法。

發表於: 2008/9/10 14:48
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PCL跟PCLATH的問題
#3
新會員
新會員


查看用戶資訊
PCL+W超過的部份
不會跑到PCLAH嗎??
無法從程式裡去考慮嗎??
所以如果有要用到查表的
開始位置要自己定比較保險喔

發表於: 2008/9/10 13:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PCL跟PCLATH的問題
#2
版主
版主


查看用戶資訊
movlw .3
pagesel table ;加入 page 的設定
call table
:
:
org 0xnn00 ; 最好是從0xnn00 的位址開始,因為 PCL + W 後的值超過 0xFF 後因為進位不見了所以位址會錯。
table addwf PCL,f
retlw '0'
retlw '1'
retlw '2'
retlw '3'
retlw '4'
retlw '5'
retlw '6'
retlw '7'
retlw '8'
retlw '9'
return

發表於: 2008/9/10 13:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PCL跟PCLATH的問題
#1
新會員
新會員


查看用戶資訊
我有一段查表法的程式
是要傳回ASCII code

movlw .3
call table

table addwf PCL,f
retlw '0'
retlw '1'
retlw '2'
retlw '3'
retlw '4'
retlw '5'
retlw '6'
retlw '7'
retlw '8'
retlw '9'
return

如果這段程式在00-FF行用的話就沒問題
但是要是超過FF的話, 因為沒有考慮PCLATH的問題
程式會亂跑.........
有更合適的寫法嗎??
還有我在DEBUG時候, PCLATH不管如何都是0.....
程式超過FF後...PCL都從00開始了PCLATH都還是0阿
這是為什麼...在DEBUG看不到嗎??

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

教育訓練中心

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