View previous topic :: View next topic |
Author |
Message |
Petr_
Joined: 24 Mar 2010 Posts: 66
|
Posted: Sun Feb 19, 2012 3:54 pm Post subject: |
|
|
ollopa wrote: | I'm attaching version 1.06 of the library for now. | Normally works.
Submitted by 240000 packages and there is no error.
Thank you.
|
|
Back to top |
|
|
ollopa
Joined: 03 Sep 2007 Posts: 233 Location: California
|
Posted: Sun Feb 19, 2012 7:19 pm Post subject: |
|
|
Thanks for verifying I no longer see errors no matter how long I let it run. Here's one over 3,000,000 loops. |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5914 Location: Holland
|
Posted: Sun Feb 19, 2012 9:07 pm Post subject: |
|
|
well done, thanks for the updates! _________________ Mark |
|
Back to top |
|
|
Gerwin
Joined: 15 May 2007 Posts: 3
|
Posted: Wed Mar 07, 2012 4:19 pm Post subject: |
|
|
is it possible to send data to a hid keyboard beside the capslock and numlock etc?
Or do i have to write a driver then?
And do i have to use a own vendor and product id? even if it is a keyboard? _________________ This is a block of text that can be added to posts you make. There is a 255 character limit |
|
Back to top |
|
|
ollopa
Joined: 03 Sep 2007 Posts: 233 Location: California
|
Posted: Wed Mar 07, 2012 6:51 pm Post subject: |
|
|
You can implement vendor-defined control transfers and send arbitrary data to the keyboard. You won't have to write a driver but you may need to use a framework like libusb to initiate the transfer.
You could also use custom defined feature reports and the native Windows API to send them.
If you're working on your own personal project, you can make up a vendor id and product id, as long as they don't conflict with any other device you use. |
|
Back to top |
|
|
Gerwin
Joined: 15 May 2007 Posts: 3
|
Posted: Wed Mar 07, 2012 9:16 pm Post subject: |
|
|
Ah i going to try with the custom defined reports.
Thanx for the answer. _________________ This is a block of text that can be added to posts you make. There is a 255 character limit |
|
Back to top |
|
|
vanphu
Joined: 27 Jul 2009 Posts: 93
|
Posted: Sat Apr 07, 2012 8:53 am Post subject: |
|
|
Hi everybody!
I have a problem with project (AN #178)
I already have download lib "SWUSB.LBX"
but the code in AN#178 have error in line below
_usb_crc = Crc16uni(txstate(3) , Count , &HFFFF , &H8005 , 1 , 1)
can you help me?
thank you very much. _________________ Best Regards
Van Phu |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Mon May 28, 2012 12:02 am Post subject: |
|
|
Mr.Ollopa, how can I use two Interface Descriptor with whis library (if it possible)? I need to make HID-keyboard with some Multimedia keys. |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
|
Back to top |
|
|
ollopa
Joined: 03 Sep 2007 Posts: 233 Location: California
|
Posted: Thu Jun 14, 2012 5:17 pm Post subject: |
|
|
Sorry for the late reply. I'm glad to hear that it worked! I think you're the first to try it. If you're willing, please post the full example when you're done. I'm curious to see exactly what you've done |
|
Back to top |
|
|
ollopa
Joined: 03 Sep 2007 Posts: 233 Location: California
|
Posted: Thu Jun 14, 2012 5:22 pm Post subject: |
|
|
vanphu wrote: | Hi everybody!
I have a problem with project (AN #178)
I already have download lib "SWUSB.LBX"
but the code in AN#178 have error in line below
_usb_crc = Crc16uni(txstate(3) , Count , &HFFFF , &H8005 , 1 , 1)
can you help me?
thank you very much. |
I think it's time for the appnote to be updated. The included version of SWUSB.LBX is out of date -- the updated one now has its own crc routine that is slightly faster and smaller than using the generic Crc16uni.
Can you say what version of BASCOM and SWUSB.LXB you are using and also post the text of the error you are getting? |
|
Back to top |
|
|
vanphu
Joined: 27 Jul 2009 Posts: 93
|
Posted: Thu Jun 14, 2012 7:32 pm Post subject: |
|
|
Hi ollopa,
I was update the version of Bascom,
It ok and not have error.
Thank you very much, _________________ Best Regards
Van Phu |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Thu Jun 14, 2012 7:40 pm Post subject: |
|
|
ollopa wrote: | ...please post the full example when you're done... |
This is example of USB-HID-Multimedia keyboard. It is simple, but enough to understanding.
Changed lines marked with !!!, added lines - with ***.
(Option to store USB descriptors in EEPROM now not working, don't try it.) |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Jun 27, 2012 4:51 pm Post subject: |
|
|
Mr.Ollopa, I try to exchange with PC via Feature cannel, but has some strange results. I add Feature to second hid_report_descriptor:
Code: |
Data &H06 , &H00 , &HFF 'Usage_page(vendor Defined Page 1)
Data &H09 , &H01 'Usage(vendor Usage 1)
Data &HA1 , &H01 'Collection(application)
Data &H85 , &H03 ' Report ID (3)
Data &H09 , &H00 ' Usage(undefined)
Data &H15 , &H00 , ' Logical_minimum(0)
Data &H26 , &HFF , &H00 ' Logical_maximum(255)
Data &H75 , &H08 ' Report_size(
Data &H95 , &H08 ' Report_count(
Data &HB1 , &H02 ' Feature(data , Var , Abs)
Data &HC0 'End_collection
|
To input data I add to Sub Usb_processsetup:
Code: | Case &B00100001
Select Case _usb_rx_buffer(3)
Case _usb_req_set_idle
Idlemode = 1
Call Usb_send(txstate , 0)
Case _usb_req_set_report ' SET_REPORT Feature
If _usb_rx_buffer(5) = _usb_req_set_feature Then
Call Usb_send(_usb_tx_status , 0)
For K = 1 To 8
Writeeeprom _usb_rx_buffer(k + 13) , k 'save data
Next K
End Select
End If
End Selec |
I receive from PC only 7 bytes and it stored in _usb_rx_buffer(14)..._usb_rx_buffer(20).
To send data I add to Sub Usb_processsetup:
Code: | Case &B10100001
Select Case _usb_rx_buffer(3)
Case _usb_req_get_report ' GET_REPORT Feature
If _usb_rx_buffer(5) = _usb_req_set_feature Then
For K = 2 To 9
_usb_tx_buffer(k) = 1
Next K
Call Usb_send(_usb_tx_status , 8)
End If
End Select |
But nothing happens, no event, no data.
Can You help? |
|
Back to top |
|
|
tiket
Joined: 14 Apr 2005 Posts: 31
|
Posted: Thu Jun 28, 2012 2:07 pm Post subject: |
|
|
Hi, to all.
I compiled all samples in this thread for MEGA25161 but PC with Windows7 not find the device.
Last test was USB_HID_Keyboard.zip of mr. Hollopa but not work.
I'm powering micro with 5Vcc and have shifted level of D+ and D- with 3.6V zener diodes.
I have a doubt, the micro is working with 16MHz crystal is this clock supported? |
|
Back to top |
|
|
|