Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Virtual USB-port for AVR
Goto page Previous  1, 2, 3 ... 20, 21, 22
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
Madf

Bascom Member



Joined: 13 Nov 2011
Posts: 179
Location: Moscow

russia.gif
PostPosted: Thu Feb 28, 2013 2:46 pm    Post subject: Reply with quote

Откуда "256-bit PWM"?
Back to top
View user's profile Visit poster's website
compurap

Bascom Member



Joined: 23 Oct 2007
Posts: 43

blank.gif
PostPosted: Mon Sep 09, 2013 7:41 pm    Post subject: Reply with quote

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
View user's profile
Mrshilov

Bascom LCD Guru



Joined: 24 Jan 2009
Posts: 314
Location: Russia

russia.gif
PostPosted: Wed Sep 11, 2013 12:50 am    Post subject: Reply with quote

I did it - see include, strings 340...350.
Back to top
View user's profile
Harty123

Bascom Member



Joined: 01 Jan 2005
Posts: 4
Location: Germany,

germany.gif
PostPosted: Wed Apr 08, 2015 8:20 pm    Post subject: Reply with quote

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
View user's profile Visit poster's website
Harty123

Bascom Member



Joined: 01 Jan 2005
Posts: 4
Location: Germany,

germany.gif
PostPosted: Thu Apr 09, 2015 9:05 am    Post subject: Reply with quote

small update:

I've solved the problem by myself Very Happy 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
View user's profile Visit poster's website
Petr_

Bascom Member



Joined: 24 Mar 2010
Posts: 66

blank.gif
PostPosted: Sun Apr 19, 2015 7:07 pm    Post subject: Reply with quote

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
View user's profile
alexbraga77

Bascom Member



Joined: 17 Jan 2009
Posts: 2

brazil.gif
PostPosted: Wed Feb 03, 2016 2:44 pm    Post subject: error when copile Reply with quote

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
View user's profile MSN Messenger
Petr_

Bascom Member



Joined: 24 Mar 2010
Posts: 66

blank.gif
PostPosted: Wed Feb 03, 2016 6:36 pm    Post subject: Reply with quote

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
View user's profile
alexbraga77

Bascom Member



Joined: 17 Jan 2009
Posts: 2

brazil.gif
PostPosted: Tue Feb 09, 2016 5:18 pm    Post subject: Reply with quote

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
View user's profile MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
Goto page Previous  1, 2, 3 ... 20, 21, 22
Page 22 of 22

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum