Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ganzziani
PostPosted: Sep 19, 2011 - 02:31 AM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

I have my first Xprotolab prototype using the XMEGA with USB microcontroller (you can take a look at the schematic here). The Xprotolab is working, although no USB yet.

I have downloaded AVR Studio 5 and all recent updates, including the XMEGA update.

I can't seem to find any XMEGA USB examples. And when I create a new project, I tried adding drivers from the ASF, it says I have no defined board, and that I should select a board from the example projects, but I don't want to use any of those evaluation boards.

I am new to AS5. I am new to USB.
Has anyone started using the XMEGA w/ USB?
Any advice?

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
ganzziani
PostPosted: Sep 19, 2011 - 05:11 AM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

I imported my AS4 project into AS5, I get this error:
"Error 3 MCU 'atxmega32a4u' supported for assembler only S:\Projects\AVR\xprotolab\source-for-hardware-1.7\awg.c 1 1 Xprotolab"

If I select atxmega32a4, it does work.

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
abcminiuser
PostPosted: Sep 19, 2011 - 07:05 AM
Moderator


Joined: Jan 23, 2004
Posts: 9831
Location: Trondheim, Norway

Did you install the AS5 update to give you support for the new USB XMEGAs? The release of AS5 out at the moment doesn't include it natively, so you need to install the additional patches:

XMEGA USB Update: http://www.atmel.com/dyn/resources/prod ... .0.240.exe

ASF Update: http://www.atmel.com/forms/software_dow ... 6.1.27.exe

- Dean Twisted Evil

_________________
Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ganzziani
PostPosted: Sep 19, 2011 - 03:10 PM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

Hi Dean, thanks.
Yes, I have those patches installed.
I created a new project instead and added the source files. Now I get these messages:

#warning "F_CPU not defined for <util/delay.h>"
#error "No SLEEP mode defined for this device."

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
ganzziani
PostPosted: Sep 19, 2011 - 07:32 PM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

I fixed the F_CPU define.
I opened a new thread about the sleep.h in the AS5 forum to get more exposure there.

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
alohre
PostPosted: Sep 19, 2011 - 08:48 PM
Rookie


Joined: Feb 03, 2006
Posts: 38
Location: Trondheim, Norway

There are USB examples for the ATxmega32A4U on the STK600 in the ASF example projects provided with AVR Studio 5. (File -> new -> example projects); these demonstrates how to get started with the USB stack and the available USB classes.

the STK600 projects will give you board and init code that you can modify to suit your own hardware.
 
 View user's profile Send private message  
Reply with quote Back to top
alohre
PostPosted: Sep 20, 2011 - 09:13 AM
Rookie


Joined: Feb 03, 2006
Posts: 38
Location: Trondheim, Norway

One example for the ATxmega32A4U is the "USB Device CDC Example - STK600"; you can see the device at the end of the description to the right. (there are two of that example; one for the A3BU and one for the 32A4U).
 
 View user's profile Send private message  
Reply with quote Back to top
ganzziani
PostPosted: Sep 27, 2011 - 04:35 PM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

Thanks alohre.
The example references application note AVR4907, when will this be available?
Also, why is the example so heavy (9968 bytes)? I was expecting something less than 1k. (The V-USB software implementation on an AVR is under 1400 bytes).

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
clawson
PostPosted: Sep 27, 2011 - 04:55 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62354
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Also, why is the example so heavy (9968 bytes)?

When I've "played" with both LUFA (and the PIC equivalent USB libs) I've typically found that there's always a 4K..8K overhead to pay before you actually get to do much sensible. As the whole points of these libs is to hide the implementation I've never bothered to look in much detail as to what the over-head actually is but it has often made me wonder what point there is in 8K USB chips when you may use almost all of it before you get started.

Another indication is that USB bootloaders (which are presumably "USB stripped to the bone"?) are typically around the 4KB mark.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
kevinmehall
PostPosted: Sep 28, 2011 - 07:09 PM
Newbie


Joined: Sep 28, 2011
Posts: 2


I've been writing a USB stack for the XMEGA32a4u: https://github.com/nonolith/USB-XMEGA

Not quite complete yet, but it weighs in at 1.7k with control and bulk endpoints enabled.
 
 View user's profile Send private message  
Reply with quote Back to top
westco
PostPosted: Sep 28, 2011 - 08:55 PM
Hangaround


Joined: May 09, 2009
Posts: 113


Do the new XMEGA USB chips have host USB functionality ?
 
 View user's profile Send private message  
Reply with quote Back to top
ganzziani
PostPosted: Sep 28, 2011 - 09:03 PM
Resident


Joined: Jun 16, 2006
Posts: 616
Location: Sarasota, FL

Thanks Kevin, I'll check it out. What do would you say it is missing to be complete?
@westco: no, they do not have host functionality

_________________
www.gabotronics.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
abcminiuser
PostPosted: Sep 28, 2011 - 11:50 PM
Moderator


Joined: Jan 23, 2004
Posts: 9831
Location: Trondheim, Norway

Quote:

Do the new XMEGA USB chips have host USB functionality ?


No.

- Dean Twisted Evil

_________________
Atmel Studio 6.1 is now released, grab it here.
Report AS6/ASF bugs here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
tinkerer
PostPosted: Sep 29, 2011 - 05:27 AM
Rookie


Joined: Apr 19, 2011
Posts: 47
Location: Vancouver, CA

ganzziani wrote:

And when I create a new project, I tried adding drivers from the ASF, it says I have no defined board, and that I should select a board from the example projects, but I don't want to use any of those evaluation boards.

I've only played with ASF as a standalone toolkit so I can't be too specific on the UI, but I expect there is a drop down menu somewhere in AS 5 that selects the board type to use for your project. If you select XMEGA A1 XPLAINED, for instance, it will translate to the equivalent of a "#define BOARD XMEGA_A1_XPLAINED" value passed to the build system, and that will be used in common/boards/board.h to include a board-specific #include file.

You should have the option of choosing a user-defined board in that menu, which will cause board.h to try to include "user_board.h". Your job is then to create that file and populate it with whatever I/O definitions you want to use for your own board. Look at any of the existing board files and you'll see what kind of things you may want to put there.
 
 View user's profile Send private message  
Reply with quote Back to top
DieCore
PostPosted: Sep 29, 2011 - 09:43 PM
Hangaround


Joined: Mar 27, 2009
Posts: 125
Location: Hellas

Atmel released officialy the 2.7 ASF library.
I think it has new example projects and generally is the latest update

http://www.atmel.com/dyn/products/tools_card.asp?tool_id=17212&source=avr_5_studio_overview
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits