• 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: USB joystick 範例
#6
管理員
管理員


查看用戶資訊
您好 :

Mouse 轉換成 Joystick 的最主要的修改就是 Report Descriptor. 以下是 Report Descriptor 的範例 .

當然 , 因為長度與原先 Mouse 的 Report Descriptor 的長度不同 , 所以在標頭檔 usbcfg.h 裡面要做適當的調整 :

____________________________________________

#define HID_INTF_ID 0x00
#define HID_UEP UEP1
#define HID_BD_OUT ep1Bo
#define HID_INT_OUT_EP_SIZE 8 // 這裡要改
#define HID_BD_IN ep1Bi
#define HID_INT_IN_EP_SIZE 8 // 這裡要改
#define HID_NUM_OF_DSC 1
#define HID_RPT01_SIZE 36 // 這裏要改

Best Regards,

發表於: 2005/12/26 17:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB joystick 範例
#5
資深會員
資深會員


查看用戶資訊
你好,我按照你所寫修改Product ID及report descriptor,還有修改Configuration 1 Descriptor裡的protocol code為HID_PROTOCOL_NONE,build all之後出現
C:\MCHPFSUSB\fw\Hid\Mouse\autofiles\usbdsc.c:286:Error [1218] extraneous initializer values
請問是哪裡有問題了,請賜教,謝謝

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


Re: USB joystick 範例
#4
資深會員
資深會員


查看用戶資訊
請問一下,詳細的descriptor說明要去什麼地方找,意思是descriptor裡的INPUT、OUTPUT、USAGE、USAGE PAGE等代表什麼意思

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


Re: USB joystick 範例
#3
初級會員
初級會員


查看用戶資訊
Joystick 的程式可以改寫MCHPUSB的滑鼠範例程式,記得要更改Product ID,以免辨識錯誤。最複雜的descriptor可於usbdsc.c中修改如下所示。
rom struct{byte report[HID_RPT01_SIZE];}hid_rpt01={
0x05, 0x01,
0x15, 0x00,
0x09, 0x04,
0xA1, 0x01,
0x05, 0x02,
0x09, 0xBB,
0x15, 0x81,
0x25, 0x7F,
0x75, 0x08,
0x95, 0x01,
0x81, 0x02,
0x05, 0x01,
0x09, 0x01,
0xA1, 0x00,
0x09, 0x30,
0x09, 0x31,
0x95, 0x02,
0x81, 0x02,
0xC0,
0x09, 0x39,
0x15, 0x00,
0x25, 0x03,
0x35, 0x8,
0x46, 0x0E, 0x01,
0x65, 0x14,
0x75, 0x04,
0x95, 0x01,
0x81, 0x02,
0x05, 0x09,
0x19, 0x01,
0x29, 0x04,
0x15, 0x00,
0x25, 0x01,
0x75, 0x01,
0x95, 0x04,
0x55, 0x00,
0x65, 0x00,
0x81, 0x02,
0xC0};
這個定義可以使用3個旋轉,一組hat switch以及幾個按鍵。當然還需要去修改其他相關檔案以確保記憶體與變數的大小。這些修改都可以參閱相關資料或picdemusb手冊的說明。

加油。


發表於: 2005/12/5 17:04
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: USB joystick 範例
#2
管理員
管理員


查看用戶資訊
Hi,

有一位北科大的曾老師已經有用 PIC18F4550 完成 joystick 的範例 . 他也非常熱心的要提供出來 . 我們會在收到後貼至檔案下載區 .

謝謝啦 !


發表於: 2005/12/5 14:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


USB joystick 範例
#1
資深會員
資深會員


查看用戶資訊
請問誰有USB的joystick的範例程式,使用PIC18F4550

發表於: 2005/11/29 16:58
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... ]

教育訓練中心

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