• 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: pic18f2550 同時使用int0,int1,SPI介面的問題...
#6
新會員
新會員


查看用戶資訊
謝謝版大的意見 我timer是全部都使用了(0~3),目前使用int0是取電壓上升時觸發~~

我後來想想應該可以用 mickeys前輩的意見,判斷腳位前次與本次值的變化由0->1時設立flag,等進入中斷時,改判斷此flag在套用原邏輯即可

在這裡學到很多 很感謝各位前輩不吝花費時間回答問題 甘溫啊

發表於: 2005/3/12 8:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic18f2550 同時使用int0,int1,SPI介面的問題...
#5
版主
版主


查看用戶資訊
你有用Timer的中斷吧!
如果有的話,那隨變哪一隻腳都可當按鍵輸入,利用Timer的中斷時順便掃描一下按鍵而且還可以利用Timer來de-bounc呢!

Timer的中斷時間從1mS ~ 30mS 都可以,我不相信你的按鍵速度會比30mS還快。按鍵漏掉的情形程式寫的好是不會發生的,以中斷掃描按鍵 & debounce 是基本技巧也是最常用的方式。

你用INT按鍵直接進入中斷也是要處理彈跳的問題要不然你按一次按鍵 INT中斷會發生很多次你會很難判斷的,沒有用硬體的Timer處理,你會用何種方式處理呢? 不會是軟體的delay吧!

發表於: 2005/3/11 9:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic18f2550 同時使用int0,int1,SPI介面的問題...
#4
新會員
新會員


查看用戶資訊
因為是按鈕一下進入設定狀態 要等使用者再按一下才回復正常模式,其間有主動的訊號偵測跟更進一步的系統參數設定(按另一棵按鈕) 不用int0有可能會有誤判或是漏判的情形,所以才想問有無人會改腳位功能定義......

發表於: 2005/3/10 23:06
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic18f2550 同時使用int0,int1,SPI介面的問題...
#3
資深會員
資深會員


查看用戶資訊
RB4 ~ RB7 都有 PORTB Interrupt on change 的功能
進中斷後再判斷一下是哪隻腳就好啦

發表於: 2005/3/10 16:39
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic18f2550 同時使用int0,int1,SPI介面的問題...
#2
資深會員
資深會員


查看用戶資訊
其實我覺得只是一個按鍵的偵測,不需要使用到外部中斷,使用一般的I/O即可偵測.

發表於: 2005/3/10 14:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


pic18f2550 同時使用int0,int1,SPI介面的問題...
#1
新會員
新會員


查看用戶資訊
各位前輩大家好,小弟有問題想請教~~
原來的設計是使用pic18f2520使用USART與PC通訊,目前想要改使用pic18f2550使用usb與PC通訊,可是發現一個問題:

原本即有同時使用SPI介面、INT0與INT1,改成使用pic18f2550之後,SPI介面會用到跟INT0及INT1相同的腳位

我已經把原本INT1改到INT2去使用,可是INT0實在不知道要怎摸搬,我的INT0是用於按鈕手動重新設定系統參數用的(按一下進入處理,等使用者調整好,在按一次回復正常工作模式)

可否有何方法可以修改IC內定的功能腳位呢?(ex.把INT0由RB0 改到RB4)

發表於: 2005/3/10 14: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... ]

教育訓練中心

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