are there any libraries for the USB AVRs?

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i recently bought a small kit containing the peripheral HW for a AT90USB162 and the chip itself.

but the manual speaks only of the chip programming through the USB via a software called Flip.

glancing the datasheet i found out that the chip can support both device and host USB modes. but i could not find any functions about these at the CV help/guide.

has any one of you guys done this before? i am aware that the USB protocole itself is a very complicated one and i will need prepared functions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've written a USB stack for them at www.fourwalledcubicle.com/LUFA.php .

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I've written a USB stack for them

Dean! Will LUFA compile under CodeVision?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh hell, didn't notice that. No, it's firmly planted in the GCC camp, and I've no idea what the differences are in Codevision that I would need to fix to get it to compile.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

none has done this on the CV yet? not even at the AVR freaks?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Codevision 3.04 has a few example projects for USB, a couple for Mega and a couple for Xmega. Are they of any help?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

mine is 2.05.3, i am going to look for the 3.04 and i will report back!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then you should still have the USB examples for AVR270 and AVR272 from CodeVisionAVR V2.04.5+

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i searched the help section for the phrase "USB" and it come with no examples.

yes i found those at the examples folder! lets check those out.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

these examples come with several assigned header file and are written for this HW:
http://www.atmel.com/tools/AT90U...
well i dont have that, mine is the AT90USB162 header board, but the example files are not voluminous, some basics of the USB protocle are needed then it seems that i may be able to set up some thing via studying the examples.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To be honest, if I were you, for this particular project I'd just install AS6 and then add the LUFA extension to it (see Extension Manager). No other programming environment for USB AVRs has such extensive support as provided by LUFA.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

idk man, i must study the LUFA and i have never tried the Atmel Studio.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

this webpage contains some glance over the USB protocle:

http://www.usbmadesimple.co.uk/u...

but does it contain the required knoweledge to understand the CV examples and respawning my own functions based on those?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To understand USB read the standards (on usb.org) and also books by Jan Axelson:

http://www.lvr.com/usb.htm

(start with "USB complete").

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok i tried an over view of the USB and i realized that its a way more complicated than what i thought! its full of so many control and data pockets and scheduling and other stuff. i remember that some one had told me that it takes about 1 year for some one to master this method!

also each one of those examples had about 10 .c and .h files. i am confused about the sorting up of those.

but there is a folder called "demo" at the AVR272 example and there is a main.c file at it which is like a key to understand the matter. do you think if i can modify this demo for my own use?

sorry to ask silly questions but in fact i want to focus my effort on a directed study so i would not have wasted my time swinging around the useless.

this main file contains this:
//! This embedded application source code illustrates how to implement a CDC application
//! with the AT90USBxxx controller.

i have a good feeling about this. whats CDC anyway?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hope that after studying this demo and also the AVRGCC document i found on their website (in order to utilize that LUFA) i can put my at90usb162 as a host for a mouse?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

whiteman7777 wrote:
whats CDC anyway?

CDC = Communications Device Class
which usually translates to a Virtual Serial Port.
This means Windows will see your device as a COMn port.

whiteman7777 wrote:
hope that after studying this demo and also the AVRGCC document i found on their website (in order to utilize that LUFA) i can put my at90usb162 as a host for a mouse?

I don't think the at90usb162 can serve as a USB Host.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

CDC = Communications Device Class

The subset of CDC that is used for virtual COM ports is actually CDC-ACM. ACM - Abstract Control Model.

Quote:

I don't think the at90usb162 can serve as a USB Host.

Indeed it cannot. There are only two models of AVR that could host a mouse and those are AT90USB64 and AT90USB1287. They have "On The Go" (OTG) which is a limited form of host mode and should be enough to host a mouse.

To be honest if you are looking to host USB devices and not simply implement devices yourself you may be looking at the wrong family of chips. Hosting is usually done with "bigger" chips - in fact the kind of chips that run Linux.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
There are only two models of AVR that could host a mouse and those are AT90USB64 and AT90USB1287.

Cliff slipped on the keyboard here. He meant to type "AT90USB647 and AT90USB1287".

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would probably have worked better if Cliff had actually HIT the keyboard :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

so it just does the same as the FT232? well i have done the communication between my PC and a meg64 through tat before and it was very easy. no need to put so much time on learning the USB workings then. but i will do the study i mentioned so i may learn some thing useful. it wont take much time.
still this chip's ability to be programed only through the USB connection to the PC is yet a good advantage. these days most of the PCs only have the USB ports and the programmer devices are expensive.
i checked the datasheet again and yes it does say that this chip is a device only not a host. i need to read more before openning my mouth!