• 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: 腳位定義問題
#4
版主
版主


查看用戶資訊
利用查表法就好了。

用 DATA 虛指令定義 7-Segment 所要顯示的 Table Data,
再用 Table Read 的指令將欲顯示的資料讀出即可。

不懂的話,可以看看 w400 workshop 的教材,如何使用Table Read 的章節

發表於: 2004/10/24 11:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 腳位定義問題
#3
資深會員
資深會員


查看用戶資訊
可是這樣的話我還是必須要在副程式裡各別控制啊 QQ"
每一個都bsf bcf 要放七個指令才能輸出一個完整的數字
我是想用一個暫存器存放編碼資料
這樣只要用movwf一行就可以一次控制七個輸出了
有辦法把一個暫存器的8個位元宣告為不同的接腳嗎?

發表於: 2004/10/23 8:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 腳位定義問題
#2
版主
版主


查看用戶資訊
改一下就好了

#DEFINE SEG_A LATA,0 ;a
#DEFINE SEG_B LATA,1 ;b
#DEFINE SEG_C LATA,2 ;c
#DEFINE SEG_D LATA,3 ;d
#DEFINE SEG_E LATA,5 ;e
#DEFINE SEG_F LATE,0 ;f
#DEFINE SEG_G LATE,1 ;g

定義後的名稱不要重複就好了


發表於: 2004/10/22 18:03
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


腳位定義問題
#1
資深會員
資深會員


查看用戶資訊
18f4320

我想用來控制七段顯示器
七段編碼放在LED0這個暫存器裡
程式開頭定義如下

#DEFINE LED0,0 LATA,0 ;a
#DEFINE LED0,1 LATA,1 ;b
#DEFINE LED0,2 LATA,2 ;c
#DEFINE LED0,3 LATA,3 ;d
#DEFINE LED0,4 LATA,5 ;e
#DEFINE LED0,5 LATE,0 ;f
#DEFINE LED0,6 LATE,1 ;g

可是編譯時MPLAB說我語法錯誤
不能用LED0,0這種方式來定義

#DEFINE LED0a LATA,0 ;a
#DEFINE LED0a LED0,0 ;

這種方式又說LED0a不能重複定義
請問有沒有什麼好的解決方法?
還是說必須靠副程式來各別控制?

發表於: 2004/10/22 10:41
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... ]

教育訓練中心

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