Page 1 of 1

V-USB newbie

Posted: Wed Nov 17, 2010 12:03 pm
by raubercata
Hello. I have some questions related to V-USB.
1. Does V-USB allowing "real time" communication of an uC with the computer via USB?
2.If so, what are the steps for a small application of this type? For example turning on and off a led, using Atmega8?
first..should i load the firmware on the uC..then write a code or something in a compiler? and which would that be? if you can explain it to me like for greenhorns.. :D thanks a lot guys .

Re: V-USB newbie

Posted: Wed Nov 17, 2010 10:40 pm
by maxi
Hi
raubercata wrote:1. Does V-USB allowing "real time" communication of an uC with the computer via USB?

That depends on what you mean by 'real time'. From a technical point of view the answer would be no, however from a user's perspective it could possibly be considered as such (think: keyboard/mouse). Read the spec for USB 1.1 for exact details.
raubercata wrote:2.If so, what are the steps for a small application of this type? For example turning on and off a led, using Atmega8?

If this is your very first MCU project then I suggest you begin with something much simpler, like flashing a LED (without USB). Once you are familiar with your chosen toolchain then try some of the provided examples that come with the driver (V-USB). One of them does exactly what you are asking for ;)

As for compiler, if you are using Windows then you might want to look at WinAVR. It's free and works well with the equally free AVR Studio IDE.

Good luck.

Re: V-USB newbie

Posted: Thu Nov 18, 2010 10:33 am
by raubercata
This is not my first MCU project. I know pretty much about LCD, different types of motor interfacing... interrupts, ADC etc.
I just wanna know for example if i write a command line in avrdude or something, the uC will execute it immediately. Or V-USB is just some kind of programmer like USBASP? Is it possible to turn on a LED just by writing a command line on the PC and then via USB this command reaches the uC and it's been executed?

Re: V-USB newbie

Posted: Thu Nov 18, 2010 4:16 pm
by raubercata
I wrote the hex file on the atmega8, and as from the description, i tried to type the command "make" in the directory commandline. it displays the following error:
gcc 'libusb-config --cflags' -O -Wall -I../common -c usb-led-fader.c
/bin/sh: libusb-config: command not found
/bin/sh: gcc: command not found
make: *** [usb-led-fader.o] error 127

i have though libusb installed...why this error?

Re: V-USB newbie

Posted: Mon Nov 22, 2010 4:12 pm
by raubercata
i managed to compile the makefile using mingw, and i got the usb-led-fader.exe. the problem now is that when i plug the device in the usb port, windows shows me a "usb device not recognised" message, and in commandline when i type usb-led-fader status i get this error: "could not find usb device "usb-led-fader" with vid=... pid=... ". any suggestion? it might be because i didnt set the fuse bits? i thought that is only for new uC, which had never been programmed.

Re: V-USB newbie

Posted: Wed Nov 24, 2010 1:52 am
by Delvier
Well I have exact the same problem :) with switching on one of those exampale ;0 The same info that windows don't recognise the device. We set the fusbit for 16MHz Oscillator and generally that's all :/ And of course change the Config.h cause of difrent bit of portD usage.
I'm not really familiar with uC :d but know some basic basics :)

Re: V-USB newbie

Posted: Wed Nov 24, 2010 9:49 am
by raubercata
Delvier wrote:Well I have exact the same problem :) with switching on one of those exampale ;0 The same info that windows don't recognise the device. We set the fusbit for 16MHz Oscillator and generally that's all :/ And of course change the Config.h cause of difrent bit of portD usage.
I'm not really familiar with uC :d but know some basic basics :)



And how did you set the fusebits? because i used extreme burner avr...set the fuse bits as its says in the pdf and i've ruined my uC :)

Re: V-USB newbie

Posted: Wed Nov 24, 2010 2:12 pm
by Delvier
The only thing what we have changed was the external oscillator and generally nothing more :). Now I'm trying to run the Hid-Mouse exampale. I use the super make file ;) to generate hex. And trying to load it into my cool Usb to I2C project. ;) We see how it works. I wonder if I change make file right ;)

Code: Select all

DEVICE  = atmega8
F_CPU   = 16000000   # in Hz
FUSE_L  = 0x9f # see below for fuse values for particular devices
FUSE_H  = 0xc9 #
AVRDUDE = avrdude -c usbasp -p $(DEVICE) # edit this line for your programmer

CFLAGS  = -Iusbdrv -I. -DDEBUG_LEVEL=0
OBJECTS = usbdrv/usbdrv.o usbdrv/usbdrvasm.o usbdrv/oddebug.o main.o

COMPILE = avr-gcc -Wall -Os -DF_CPU=$(F_CPU) $(CFLAGS) -mmcu=$(DEVICE)

Re: V-USB newbie

Posted: Wed Nov 24, 2010 2:57 pm
by Delvier
OK . I run the hid mouse ;) When i Checked by AvrOsp my fuse bit high and fuse bit low for external osci :) I found out that on make file I have a diffrent :D Copied from below exampale ;)

now i use ! :
High: 0xD9
Low : 0xFF

:D And it works ;) cool !

Re: V-USB newbie

Posted: Thu Nov 25, 2010 1:33 pm
by raubercata
Delvier wrote:OK . I run the hid mouse ;) When i Checked by AvrOsp my fuse bit high and fuse bit low for external osci :) I found out that on make file I have a diffrent :D Copied from below exampale ;)

now i use ! :
High: 0xD9
Low : 0xFF

:D And it works ;) cool !


well i dont quite understand. you set these fuse bits from above for a 16 mhz oscillator , thats right? well i need fuse bits for a 12 mhz oscillator. and if they are
High: 0xC9
Low: 0x9F
as the description of the project says ...then they're wrong, coz the uC is now locked.

Re: V-USB newbie

Posted: Mon Nov 29, 2010 11:13 am
by raubercata
well... i managed to 'unlock' the uC. i simply disconnected the ground from those two 22pF capacitors, and probably the XTAL1 took some kind of clock from the crystal , otherwise i cant explain it. then the question is remaining... why 0xC9 and 0x9F does not work for a 12Mhz crystal????

Re: V-USB newbie

Posted: Mon Nov 29, 2010 12:38 pm
by raubercata
Problem solved. With those two capacitors removed i flashed once again the uC and wrote the fuse bits and everything works fine. Project done!

Re: V-USB newbie

Posted: Wed Aug 03, 2016 5:27 pm
by kinjo
also having Driver Power State Failure

Re: V-USB newbie

Posted: Thu Aug 04, 2016 1:22 pm
by kinjo
Mail a friend send me when I got this issue again

Related to amd_sata.sys AHCI 1.2 Device Driver from Advanced Micro Devices.

I would run a system file check (just to verify the OS) and go to the computer mfr and see if there is a newer driver. I would also see if there is a newer BIOS

To run a system file check (SFC)
Go to start>type CMD>right click and run as administrator> Type SFC /scannow

let us know what it says at the end.
You may have to run this up to 3 times.

http://www.deskdecode.com/driver-power-state-failure/