View previous topic :: View next topic |
Author |
Message |
Madf
Joined: 13 Nov 2011 Posts: 179 Location: Moscow
|
Posted: Thu Feb 28, 2013 2:46 pm Post subject: |
|
|
Откуда "256-bit PWM"? |
|
Back to top |
|
|
compurap
Joined: 23 Oct 2007 Posts: 43
|
Posted: Mon Sep 09, 2013 7:41 pm Post subject: |
|
|
any news for this: ?
"
Mr.Ollopa how can I add this strings to library?:
Code:
Period_number=8
COMPARE1A=Last_period
TIMER1=Shift_delay
Last_period & Shift_delay are constants.
It needs to synchronize with 8ms USB packets." |
|
Back to top |
|
|
Mrshilov
Joined: 24 Jan 2009 Posts: 314 Location: Russia
|
Posted: Wed Sep 11, 2013 12:50 am Post subject: |
|
|
I did it - see include, strings 340...350. |
|
Back to top |
|
|
Harty123
Joined: 01 Jan 2005 Posts: 4 Location: Germany,
|
Posted: Wed Apr 08, 2015 8:20 pm Post subject: |
|
|
Hi,
I'm doing some experiments with the USB HID examples in AN178. I've compiled the code of HID-Example_IO for the ATMEGA88 with Bascom 2.0.7.6.001. Unfortunately the compiled exe for the PC software is not part of the zip archive. So it's not possible for me to test my work. I've started a small project in Python with PyUSB to test my new HID device...
Code: |
# Communication with HID using pyUSB
# git clone https://github.com/walac/pyusb.git
# cd pyusb
# sudo python setup.py
# Windows needs libusb! (http://sourceforge.net/projects/libusb-win32)
Vendor_ID = 0xAAAA #(ATMEL)
Product_ID = 0xEF22 #usb_small_lib "hid")
import usb.core, time
interface = 0
dev = usb.core.find(idVendor = Vendor_ID,idProduct = Product_ID)
if dev is None:
print "device not found"
# only linux: uncomment if device not free (error resource busy)
"""if dev.is_kernel_driver_active(interface) is True:
dev.detach_kernel_driver(interface)
usb.util.claim_interface(dev, interface)
dev = usb.core.find(idVendor = Vendor_ID,idProduct = Product_ID)"""
dev.set_configuration()
# communication code
msg = [0x00] # endpoint2 (0x02) = 0x0F (switch 3 LEDs)
print "Number of Bytes written to the device: ",dev.write(0x02, msg)
res = dev.read(0x81, 1) # read 1 Byte from endpoint1 (0x81)
print "State is: ",(res.tolist()[0])
|
Writing to the device is not a problem. I can set and unset the LEDs without any problems. But I can't read data from the device. What is the endpoint for reading? It looks like the 0x81 is ok, but Python reports an timeout for reading...
Best Regards
Hartmut _________________ ---> X <---- Drive in a nail here for a new monitor
Last edited by Harty123 on Thu Apr 09, 2015 9:08 am; edited 1 time in total |
|
Back to top |
|
|
Harty123
Joined: 01 Jan 2005 Posts: 4 Location: Germany,
|
Posted: Thu Apr 09, 2015 9:05 am Post subject: |
|
|
small update:
I've solved the problem by myself The problem was not the Python code. I made some small error by porting the code from AN178 to the new BASCOM compiler version (regarding the remarks of Six1).
Now both works fine! See attachment.
@Mark: Perhaps you can add this code to the application note to prevent trouble for other users...
Best regards
Hartmut _________________ ---> X <---- Drive in a nail here for a new monitor |
|
Back to top |
|
|
Petr_
Joined: 24 Mar 2010 Posts: 66
|
Posted: Sun Apr 19, 2015 7:07 pm Post subject: |
|
|
Harty123 wrote: | Unfortunately the compiled exe for the PC software is not part of the zip archive. | Application HID_Example_IO from AN178 in attachment. |
|
Back to top |
|
|
alexbraga77
Joined: 17 Jan 2009 Posts: 2
|
Posted: Wed Feb 03, 2016 2:44 pm Post subject: error when copile |
|
|
hi guys! excuse my by the poor english, i got sucess when i write the .hex file off ollopas examples diret to a chip but when i compile the source and write this hex toa chip this not work, can this is a error on configs in bascom enviroment?? |
|
Back to top |
|
|
Petr_
Joined: 24 Mar 2010 Posts: 66
|
Posted: Wed Feb 03, 2016 6:36 pm Post subject: |
|
|
Which version of BASCOM?
In attachment, files for Bascom-AVR 2.0.7.7 or later.
For compiling, you must copy the file "swusb.LBX" in the folder "LIB", BASCOM. |
|
Back to top |
|
|
alexbraga77
Joined: 17 Jan 2009 Posts: 2
|
Posted: Tue Feb 09, 2016 5:18 pm Post subject: |
|
|
Petr_ wrote: | Which version of BASCOM?
In attachment, files for Bascom-AVR 2.0.7.7 or later.
For compiling, you must copy the file "swusb.LBX" in the folder "LIB", BASCOM. |
Hi Petr very thanks!! i think one of problems is the bascom version i am using 2.0.7.5 after update itīs start to work but i still have problems with other code, usb-joystick-m8-4ax-8btn-2.bas, this is another example of swusb, works great when i prog the hex but when i compile its dont work but know with this new version of bascom i am getting an syntax error i will try to find it in a code and reply here the results, again very thanks!!! |
|
Back to top |
|
|
|