Arduino Forum

Forum 2005-2010 (read only) => Hardware => Development => Topic started by: clayga on Dec 05, 2008, 05:58 pm

Title: AVR with embedded USB?
Post by: clayga on Dec 05, 2008, 05:58 pm
Hi, all,

Just wondered why the Arduino boards are all still using the (external) FT232 chip when Atmel do parts with embedded USB transcievers (e.g. AT90USB1287)?  

Are there any plans to migrate to or make an AT90 variant of the Arduino?

Cheers,

Graham.
Title: Re: AVR with embedded USB?
Post by: clayga on Dec 05, 2008, 06:00 pm
Hi, all,

You can even get demo boards with the USB parts in, like here:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3879  ;)

Cheers,

Graham.
Title: Re: AVR with embedded USB?
Post by: westfw on Dec 06, 2008, 09:49 am
1) None of the AVRUSB chips is particularly backward compatible with the CPUs currently in use.
2) Cost of ATmega168 + FTDI chip is less than any of the USB chips with equal RAM (1K or more.)
3) The FTDI chip comes with well-tested drivers emulating a serial port on all three popular desktop operating systems, making it easy for random applications to communicate with.  Getting to that point with an native-USB AVR would be a lot of work (and/or expense) for someone.
Title: Re: AVR with embedded USB?
Post by: pjrc on Dec 06, 2008, 10:48 pm
There are a few of us working on this.  The project is in its infancy right now.  Currently, there is code to allow sketches to run on the AT90USB162, but without any support for using the USB (yet).  If you're alpha/beta testing or getting involved, please contact me.

It is absolutely true that the USB portion is very different from using a UART and supporting it well will be a LOT of work.  I could go on about the details, but honestly at this early stage everything is still in flux.    But if you're interested in getting involved, we could certainly use help.  The rough plan is to add an "easy" API on top of Dean Camera's LUFA (MyUSB) library.  It's not clear yet how the host side and IDE will work and several different ideas are on the table.

Help is of course very welcome.  I would particularly like to hear from you if you're able to do Alpha (not even "alpha", pre-alpha, whatever) testing with good, reproducible bug reports.  That will be very helpful as the USB support is added.  Unlike the FTDI chip, there are a lot of ways the USB can work with and much testing will be needed.

Regarding the hardware cost, while the bigger chips are pretty spendy, the little chips that have admittedly only 1/2 the RAM of an Arduino are very affordable.
Title: Re: AVR with embedded USB?
Post by: mellis on Dec 07, 2008, 10:38 pm
Sounds very cool.  You should post about your progress and consider writing to the developers mailing list (http://mail.arduino.cc/mailman/listinfo/developers_arduino.cc)if you've got something that you think would make sense to incorporate into the standard Arduino boards.
Title: Re: AVR with embedded USB?
Post by: westfw on Dec 08, 2008, 12:50 am
Do the smaller AVUSB devices have separate ram for USB buffers, or are you talking about half the ram of a mega8 MINUS the usually-substantial memory used by USB ?
Title: Re: AVR with embedded USB?
Post by: pjrc on Dec 08, 2008, 01:15 pm
All the USB chips have separate memory to buffer sending and receiving data on the various endpoints.  The AT90USB162 chip has 176 bytes of this memory, which Atmel calls "DPRAM" (DP = dual port, because it can be accessed by both the processor and USB hardware), and it also has 512 bytes of regular RAM.

USB also includes flow control implemented at the hardware level (in all the Atmel USB chips), so it is not necessary (if done properly) to buffer incoming data in regular RAM.  For example, the regular serial port via FTDI has no flow control (CTS/RTS is not used), so a 128 byte receive buffer is allocated in memory to hold characters your PC might send before your sketch has a chance to read them, like if it's sitting inside a delay() for quite some time.  With USB, the data will be buffered inside the dedicated DPRAM and when that buffer is full, the USB hardware will automatically prevent your PC from transmitting more until your sketch finishes that long delay() and reads the data from the buffer.  (actually, in reality the hardware sends "nak" packets that make your PC retransmit the data, but the point is it's all done at the hardware level so you don't need to consume regular RAM for buffering like would be necessary with regular serial).

A small amount of RAM is needed to hold a few variables related to the USB configuration.  It's surprisingly small.

The USB chips do have a regular UART built in, and if you use that the regular serial buffer memory will be needed.
Title: Re: AVR with embedded USB?
Post by: westfw on Dec 08, 2008, 05:59 pm
thanks for the info.  Having the separate dpram makes having half the normal ram a lot less worrisome...
Title: Re: AVR with embedded USB?
Post by: pjrc on Jan 07, 2009, 01:28 pm
This crazy idea is now in beta test....

http://www.pjrc.com/teensy/teensyduino.html
Title: Re: AVR with embedded USB?
Post by: mem on Jan 07, 2009, 01:47 pm
Interesting device, it looks like the USB can be configured so it appears as mouse or keyboard ( and presumably as a mass storage device) , is that correct?

Although it does not have a timer2, the data sheet does say it has 5 PWM channels (3 using timer1)

Looks to be a nice addition to the arduino world.
Title: Re: AVR with embedded USB?
Post by: vputz on Jan 07, 2009, 02:56 pm
Good stuff.  Couple quick questions for my amusement:

1) Does TeensyDuino software have any way to interface with the AT90USBKey devices?  I grabbed two of those early on and haven't done anything with them since the Arduino's a little more permissive.

2) It says "serial:1", but just to confirm--would these allow basic TTL-style serial while simultaneously using the USB port (for say HID)?  (I'm thinking in the context of a serial-interface game controller mapped to a HID device from the USB port, which I'm doing with Arduino's serial port and the UsbJoystick library but might be cleaner with the AT90USBKey's proper USB interface and LUFA).
Title: Re: AVR with embedded USB?
Post by: dcb on Jan 07, 2009, 04:13 pm
Paul, I like the project, but you should publish all source files and schematics or be extremely upfront about your plans to not open source the teensyduino hardware and bootloader and any other exceptions.

I ran the install but did not see a bootloader created and have not seen a schematic anywhere.  Are you keeping your hardware and bootloader closed?  People need to know this as it is a key motivating factor when deciding to participate in a particular project or not.
Title: Re: AVR with embedded USB?
Post by: pjrc on Jan 08, 2009, 12:40 am
Yes, the hardware most definitely is able to act as a HID, Mass Storage or almost any type of USB device.  Currently, Teensyduino only adds files to Arduino for a serial type device.  I intend to add other types.  However, the Arduino IDE contains a lot of serial-only assumptions, so support non-serial device types on Arduino is going to take a lot of work.  I am working on that....

You most certainly can use the serial at the same time as the USB.  It's like having 2 serial ports.  Or a HID and serial, if you program the USB to act as HID.

Teensyduino only supports the Teensy.  If you have a usbkey board, Dean Camera's LUFA library, win-avr, and Atmel's FLIP tool are your best option.

Please understand that this project is very new and the website and supporting files are still under development, and Teensyduino (the software add-on for the Arduino IDE) is only in its very first beta test right now.  A full schematic will be added soon.  Many more examples are also planned.  It is a lot of work, as so many people have said dismissively regarding the possibility of using this chip with Arduino.  I'm working on a giant TO-DO list.

However, the bootloader is not open source.  If you are looking for a 100% pure open source project, including bootloader source code and CAD files under a share-alike license, Teensy is not for you.  It is most certainly NOT my intention to deceive anyone.  Building excellent web pages is an iterative process, and the teensyduino page has already been revised substantially based on feedback from many people.  Please if you have any constructive and specific suggestions, contact me directly at paul@pjrc.com  

All code that becomes part of your program is open source.  Everything I have added is under the MIT license, which is more permissive than the LGPL which Arduino uses.  Of course the additions to the Arduino IDE are open source under the GPL, and they are placed in a "src" directory when you run the Teensyduino installer.  The IDE changes have also been offered to the Arduino developer list.

About the PWM, while Atmel's datasheet says there are 5 PWM, and indeed there are inside the chip.  Unfortunately Atmel decided to put 2 of them on the same pin!  The web page says 4 because you can never actually use all 5.  I wouldn't want anyone to buy the board or plan their project around 5 PWM outputs and later discover you can only use 4.
Title: Re: AVR with embedded USB?
Post by: zooto68 on Jan 08, 2009, 11:40 am
I personally wouldn't be interested if it is not Open Source no matter what the advantages are. The beauty of the Arduino is peopel can modify the hardware and code to their liking and there are lots of nice clone kits out there all tailored to your individual needs or you can make your own.

I'll stick with my Arduino thanks.
Title: Re: AVR with embedded USB?
Post by: timstamp on Jan 11, 2009, 12:47 pm
To be honest, it just looks like a less comprehensive but cheaper alternative to the Arduino Nano..

http://arduino.cc/en/Main/ArduinoBoardNano

I'm sure this will appeal to some people, but I personally only use Arduinos for interfacing with the outside world, not my USB port.. 38Kbps is plenty fast enough for this purpose IMHO.
Title: Re: AVR with embedded USB?
Post by: vputz on Jan 11, 2009, 04:16 pm
There's a fair bit of use for turning that USB port into a proper USB device, though (particularly a lot of HID applications).  It's less to do with speed than with seamlessness.  I personally would love to have a "proper USB" support rather than just bit-banging with the AVRUSB library (which I'm doing now because I want to use the Arduino).

I'm all for it, basically, just like I'd love to see a better option than SoftwareSerial for serial interfaces (even if it means a little more add-on circuitry).
Title: Re: AVR with embedded USB?
Post by: dgmzaiq on Jan 30, 2009, 11:52 am
Don't know if anyone's interested, but see my post "Arduino for AT90USB1287 / AT90USBKey demo board with Eclipse"
Title: Re: AVR with embedded USB?
Post by: Jestersage on Jan 30, 2009, 12:12 pm
Thanks zaiq. read my reply.

As to Paul Stoffregen, I would rather you do not decieve others by using -duino. While we legally cannot stop you, -duino implies true compatibility to Arduino, not just in hardware and software but also how they share, which is in GPL/LGPL. You may see MIT as less restrictive, but we do see it as a loophole for people to decieve the openness of a platform.
Title: Re: AVR with embedded USB?
Post by: pjrc on Jan 30, 2009, 01:24 pm
Clearly you're very unhappy with me, apparently due to using the -duino suffix, and because I used the MIT license?

Would it help if I were to switch to LGPL & MIT dual license in the next release?  Or maybe just LGPL and no mention of MIT at all?

That USB code was developed separately, and is also released as a stand-alone project intended for use in C language projects, totally separate from the Arduino IDE and wiring API.  For that, I chose the MIT license for few reasons.  1: it's short and simple.  2: it's OSI approved.  3: everybody claims it is compatible with all other open source licenses.  I specifically wanted a license that's as compatible as possible with any other project, and MIT seemed like a good idea.  I never imagined anyone would take exception to that decision.

Anyway, the only reason there's MIT licensed files in there is because I copied them from my other work and because OSI says the MIT license is compatible I didn't bother to change it.  But I could certainly change that to LGPL in a future release.  I'm an engineer, not an attorney, so these finer license details really don't mean a lot to me, and I've based most of my decision making on the what I've read from the OSI website.

You also seem pretty upset about the name.  I'd first like to point out the FAQ that appears on the Arduino website.   http://arduino.cc/en/Main/FAQ

Quote

What should I call my boards?

If you're making your own board, come up with your own name! This will allow people identify you with your products and help you to build a brand. Be creative: try to suggest what people might use the board for, or emphasize the form factor, or just pick a random word that sounds cool. "Arduino" is a trademark of Arduino team and should not be used for unofficial variants. If you're interested in having your design included in the official Arduino product line, please see the So you want to make an Arduino document and contact the Arduino team. Note that while we don't attempt to restrict uses of the "duino" suffix, its use causes the Italians on the team to cringe (apparently it sounds terrible); you might want to avoid it.


As nearly as I can tell, this seems to say that the name "Arduino" is what implies true compatibility and while the -duino suffix many sound terrible to Italians, its use it not restricted.

As a practical matter, there are lots and lots of projects using the -duino suffix to communicate they are somehow intended to be used together with the Audino IDE, or an official Arduino board or an unofficial clone or unofficial non-clone or whatever it might be called.  If the -duino suffix were meant to imply "true compatibility" (your message being the first I have ever seen suggesting it), the reality is the suffix is already in very widespread use for a very diverse range of projects.  That really isn't so surprising considering the FAQ.

It's certainly never been my intention to deceive anyone.  I've tried to be very clear.  Many people have offered advise and several times I have improved the web page, trying to make it as clear as possible.  In fact, it even says 'While many types of sketches can run, Teensy is NOT an "Arduino clone" due to the substantial technical differences. The Teensy hardware and Teensyduino software add-on are NOT endorsed or supported by the Arduino developer team.'

I've tried, perhaps not successfully, to apply the -duino suffix only to the software add-on that gets included into the Aduino IDE, but NOT to the hardware itself.

I'm really sorry you're so upset with me.  I have listened to feedback from many people and tried to incorporate suggestions where I can.  I have tried to follow the published guidelines on naming, and I've tried to follow OSI's advise regarding open source licenses.  I've edited the web page many times to clarify things.  I am only human and far from perfect, but I am continuing to make incremental improvements as I can.
Title: Re: AVR with embedded USB?
Post by: dcb on Jan 30, 2009, 02:23 pm
Has anyone messed with bootloadHID recently?
http://www.obdev.at/products/avrusb/bootloadhid.html

or it's parent, avrusbboot?
http://www.fischl.de/avrusbboot/

It is all open source as far as I can see, though I have a feeling we've been here before :)

Paul, only problem is that random person X cannot verify your claims without ordering your stuff, because it isn't entirely open.  And so who is going to send you money to help you build your credentials and reputation so you can have a monopoly on your hardware?  I don't think this is the right forum for non-open projects personally.
Title: Re: AVR with embedded USB?
Post by: dcb on Jan 30, 2009, 03:46 pm
Ooohh, looks like follower has been active in the HID department as well :)
http://code.rancidbacon.com/ProjectLogArduinoUSB
Title: Re: AVR with embedded USB?
Post by: Jestersage on Jan 31, 2009, 01:31 am
I am more upset the fact that it is not open source, more than the license itself. As you said, you design this project not as open source.

You can change it to LGPL or GPL, but as long as the hardware, software, and bootloader is not open source, it's moot. On the other hand, if you make it open source, keeping it as MIT is perfectly fine for me.
Title: Re: AVR with embedded USB?
Post by: vputz on Jan 31, 2009, 06:49 pm
I'd agree with the above, Paul--I'm actually a prime candidate for the Teensy, as my current project (a serial input to USB HID device) is a prime candidate for Teensy; I'm currently using a bit-bang USB interface with the Diecemila, and there are some frustrations there-- what I really need is something with one serial port and one USB connection that can be configured as a HID device--sound familiar?  (and I have another project or two on the same vein).  But I'm pretty committed to everything being completely open.  What if you give up the Teensy project?  We'll be out of luck if we'd committed to that platform and everything wasn't completely open.

Politicians attach a "weight" to correspondence from constituencies, so a personal email, say, might reflect the opinion of 10 or so people.  Not sure what a public forum post is, but I'd say if a few of us have this objection (or confusion--feel free to put us straight) there are a few more quiet folks out there who think it's important too.  Heck, even the LUFA USB driver author has concerns about the openness (http://fourwalledcubicle.com/blog/archives/235):

Quote
This is one area where the Teensy could open up a bit -- it would be nice to see the communication protocol published so that others can create compatible bootloaders and host-side software


I see on your page the "HalfKay Protocol Reference", so that's encouraging.  It could be that you've opened it completely now; I'm not sure.

Now, it could be that I just didn't look hard enough.  I see you have the schematic up on your site, which is great, because while it's important to me that the hardware be open, I frankly would rather just buy the thing (board layout files would be swell too, but at least the schematic satisfies that requirement for me).  But it sounds from above that the bootloader is still closed, and I'm not certain about the licensing on the Arduino environment changes.

Please do consider this.  It looks like a great project, but if it's not completely open, I know I would feel uncertain adopting it as a platform--and I certainly wouldn't feel comfortable about you using the -duino suffix.

I know it sounds like a bit of zealotry, but it's an important theme for this sort of thing.  I have just sent some Arduino-shield Gerber files out for manufacturing (for about 5-6 people actually) that probably should have used the AT90USB platform, but decided against it because I didn't find a completely open one (I've since found AVROpendous and ordered a board to play with, but it's also important that my end users have an easy environment like Arduino).

Just saying--please consider opening everything completely.  I'd wager you'll get more orders overall even with open specs, just like I'm guessing more Arduinos are sold than Seeeduinos, etc, and the market is bigger for Arduino because of its openness.

In fact, I'll place money where mouth is, because I think an easy-to-use AT90USB platform is an important project.  If you open all the code, bootloader and Arduino environments included (or show me where I'm wrong and that it is already open), I will buy one myself the next day and fork my project to support both the Arduino and the Teensy.  Not that one person's purchase is really that big a deal, but actions speak louder than forum posts.
Title: Re: AVR with embedded USB?
Post by: pjrc on Feb 01, 2009, 07:36 am
Quote
I've since found AVROpendous and ordered a board to play with


Last time I checked, the DFU bootloader and GUI-based FLIP loader program were both closed source!

Sure, the website says "Open Hardware and Open Software Development Platform", but what does that really mean?  Can you find the bootloader source?
Title: Re: AVR with embedded USB?
Post by: retrolefty on Feb 01, 2009, 08:32 am
Quote
Can you find the bootloader source?


If you mean for the Arduino:

http://svn.berlios.de/viewcvs/arduino/trunk/hardware/bootloaders/  ?

Title: Re: AVR with embedded USB?
Post by: vputz on Feb 01, 2009, 11:00 am
Quote
Last time I checked, the DFU bootloader and GUI-based FLIP loader program were both closed source!

Sure, the website says "Open Hardware and Open Software Development Platform", but what does that really mean?  Can you find the bootloader source?


Well, damn; hadn't noticed that.  Guess I don't have any options for the AT90USB then, and I'm stuck with my crappy bit-banging shield.  That's really a pity.

They do have Gerber/CAD files available, so that's a start:

Quote
If you need larger quantities you can always manufacture your own. AVRopendous
 is an Open Hardware design so all files are available for Open Source KiCAD
 (schematic/layout/gerbers/BOM/solder paste stencil).  For the adventurous,
 there is a simplified Quasi-Single-Layer version which can be built without
 needing to drill any holes and etching only one copper layer.


So that's one step up.  And hmm, okay, the magic AVROpendous bootloader source isn't available for... oh, wait, again from the LUFA guy's blog:

Quote
By contrast, the AVROpendous uses either the stock Atmel bootloader, or the LUFA (formerly MyUSB) DFU/CDC class bootloaders. The LUFA bootloaders are much bigger - 4KB a piece - however may be jumped to from the user application (with the processor in any state) and use the LUFA library as a backend, rather than a smaller set of custom USB code.


So there isn't a magic AVROpendous bootloader source to be had at all, and evidently it's possible to use the LUFA bootloaders, which are (I believe) open-source, which does indeed leave the problem of the FLIP programmer, which I'm not happy about.  That's a good point, because I do want my (five or so) end users to be able to reprogram it with a minimum of fuss, which is why I chose the Arduino instead of the AT90USBKey (which at the time was the only AT90USB board I knew of).  So now I not only have a spare AT90USBKey, but an incoming AVROpendous that I probably won't do much with.  

Although in the end I would still rate AVROpendous as more open, because if a bus came by tomorrow and wiped out the entire AVROpendous team, we could recreate everything they have available based on the source from their website; I'd still be reliant on the FLIP tool from Atmel, but then I'm already reliant on the AT90USB chip from Atmel.  I suppose a magic bus could come along tomorrow and wipe out all Atmel employees, but that's unlikely.

If you get hit by a bus tomorrow, Teensy dies, because HalfKay is gone forever.  Sure, it's probably FLIPable without HalfKay, but we're right back to where we started.

Crappy USB-bitbanging shield it is then.  Pity, because a Teensy would reduce the hardware to three parts: the teensy, a MAX233, and a DB9 male plug.  That'd be nice.

Paul, I know this probably seems like frustrating and bizarre behaviour to you, and I appreciate that.  You have made the decision that the assembler source for about 512 bytes of bootloader--which incidentally is a heck of an achievement that you should be congratulated for; I sure couldn't do it--is more important than a few lost sales from crazy hobbyists.  

And I respect that, I really do; I probably come across as a bit off my rocker here, but I really do think the Teensy is a feat of engineering and design, which, regrettably, I don't feel I can use.  But you also chose to name your device close to something which is 100% open, from everything I can see, and you have to expect some backlash from that.  In fact, that's the only part I can imagine anyone being upset about, because a new hobbyist tool of any sort is to be praised.

But why is there an Arduino name to leverage?  Sure, there's ease of use, but the free-as-in-beer tools from Atmel aren't that bad.  Why has this one particular design exploded in popularity?  The openness really does mean something.  To rather a few people.  Yes, obviously the core Arduino folks are "losing sales" to all the Arduino clones--but the size of the market is so much larger because of the openness that I imagine it's done them more favors than not.

Offer still stands: if it becomes completely open, I'll order one immediately and post the order number here as proof.  You can even provide a less-efficient-but-open bootloader than HalfKay if you'd rather.  And no hard feelings if you don't--my bit-banging shield does the USB job just fine (nothing fancy; it's just the rancidbacon shield from above).  Either way, the world will keep turning, and eventually an open solution will appear from somewhere, like the earlier-mentioned one on this thread.  Or not.  But it'd be nice if it did.

I don't want this to be a flamewar in any way.  And I don't even want to try and convince you to open up HalfKay because it'll give you a warm feeling inside (although it might) or because it sounds like a good piece of engineering that should be shared with the coding world because it will inspire future programmers (although it probably would).  I personally think it's in slightly poor taste to name a closed product in the style of an open one, but that's personal preference on my part.

But I do want to get across the idea to you as a businessman (and other businessmen who read this thread) that at least in the world of hobbyist electronics, there really are people (probably a fair amount) who make purchasing decisions based on licensing, and that the decision to keep part of your  product proprietary, while a perfectly legitimate decision (and you may have plenty of reasons for it), is costing you some customers.
Title: Re: AVR with embedded USB?
Post by: pjrc on Feb 01, 2009, 07:43 pm
Quote
Paul, I know this probably seems like frustrating and bizarre behaviour to you,


Honestly, I'm simply not very impressed by everything I've read here.

I realize there are several voices here, but in particular I'm amazed that on the heels of such hostility that I'm supposedly abusing the Arduino trademark and being intentionally deceptive (despite my following the Arduino FAQ guidelines), I'm seeing what look like a lot of apologizing for avropendous having a closed source bootloader and relying on closed source software, especially when the site claims such openness!

Specifically, if LUFA publishing a bootloader that isn't actually shipped with a board somehow makes that board a fully open, then Teensy is fully open and you can go ahead and buy a Teensy!

There are so many other examples in this thread of incorrect information, poor fact checking, and not actually doing any substantial review of the subject.  I'm truly not impressed.

But I do hear your overall message, that you want me to make all aspects of Teensy open source.  I haven't actually answered this yet, so I will do so now.

Teensy is more than bits and bytes.  Teensy has a business model which has been carefully considered.  That model involves a mostly open source approach, but also some closed source tools.  PJRC has made very substantial capital investment into this business model.  More developments are on the way, which I won't discuss at this time.

Yes, factored into the business model are potential lost sales opportunities for "zealots" who will only buy a completely open platform.... or perhaps one with crafty marketing that seems like it has openness but in fact ships with a closed source bootloader and recommends closed source tools.  You won't see PJRC doing that!

But if the business model is successful, you should in time see more and more compelling advantages to using a Teensy.
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 01, 2009, 08:38 pm
I'm not being hostile at all; I've repeatedly praised Teensy as a technical achievement and I think you've done a great job with it... as a closed-source product, which is why I offered repeatedly to buy one if you opened it; I tend not to offer money to people as a means of being hostile.  I simply would like to see it opened, as I  feel it would get you more customers and become a de facto standard; if you don't, eventually someone will produce an open version, and Teensy will fall by the wayside, and that would be a pity, because it looks a great little board.

Quote
I'm seeing what look like a lot of apologizing for avropendous having a closed source bootloader


More correctly, they don't seem to provide any bootloader at all, thus forcing users to use the AVR bootloader and tools.  What you seem to be doing is saying "this will work with your open tools, but only if you use my proprietary bootloader."  Neither is exactly ideal.  There is a slight difference between "everything we offer you is open, but we didn't make you any extra tools" and "everything we offer you is open except this secret part which you can't have but need in order to use the tools you are using."

The problem with the latter approach is that you are leveraging the Arduino name and taking advantage of an open platform, but are in fact extending it with proprietary extensions which you control.  This may seem to make sense from a business perspective, which is why Microsoft made it such an established practice.  From the Wikipedia article, emphasis mine:

Quote
"Embrace, extend and extinguish," also known as "Embrace, extend, and exterminate," is a phrase that the U.S. Department of Justice found was used internally by Microsoft to describe their strategy for entering product categories involving widely used standards, extending those standards with proprietary capabilities, and then using those differences to disadvantage its competitors.


Unfortunately the open-source community is extremely sensitive to embrace-and-extend tactics (as this thread and others are showing), because they run counter to the ideals of open-source practices, and because they are almost always unnecessary.  They add complications where they don't need to.  I truly believe that if you had made the Teensy open from the start, you would have more customers and probably not many people would bother competing.  Evidently you have made an analysis and concluded otherwise, which is your prerogative.

I think you've done a good job of portraying your point of view.  But I hope you can see at some level that what it looks like to the "fully-open, everyone share" community of Arduino is that you don't "get" the idea of open-source hardware/software, and are saying "I don't care about your values; I just want your money"--and indeed that feels rather hostile from this end as well.

Not to worry--I'm certain you'll have some customers, just as I'm certain that before too long someone will make a fully-open AT90USB board which works with the Arduino environment, which probably won't be as elegant or tiny as the Teensy.  And as mentioned, life will go on.

Title: Re: AVR with embedded USB?
Post by: westfw on Feb 02, 2009, 05:22 am
Carefully "curling my fingers" (the e-equivalent of "biting my tongue"), I'll just say that I suspect that the complexity of implementing USB devices beyond a simple serial port simulation is going to be a much bigger barrier to success of things like the teenydunino than a lack of "openness" in the distribution model...  The "USB-whacker" has existed in PIC-land for quite a while now, for instance...
Title: Re: AVR with embedded USB?
Post by: Jestersage on Feb 02, 2009, 08:57 am
Quote

But I do hear your overall message, that you want me to make all aspects of Teensy open source.  I haven't actually answered this yet, so I will do so now.

Teensy is more than bits and bytes.  Teensy has a business model which has been carefully considered.  That model involves a mostly open source approach, but also some closed source tools.  PJRC has made very substantial capital investment into this business model.  More developments are on the way, which I won't discuss at this time.

Yes, factored into the business model are potential lost sales opportunities for "zealots" who will only buy a completely open platform.... or perhaps one with crafty marketing that seems like it has openness but in fact ships with a closed source bootloader and recommends closed source tools.  You won't see PJRC doing that!

But if the business model is successful, you should in time see more and more compelling advantages to using a Teensy.


Fair enough. Just take out the -duino part, then label compatible with Arduino IDE, and I will be satisfy enough. It's no worse than a BIOS or the X-PORT, or even XBee at worse, which are also close source in such sense.

But even some boards that use components similar to Arduino and can use with Arduino IDEdon't name themselves as Arduino, such as the ZB1 (http://www.makershed.com/ProductDetails.asp?ProductCode=MKWB1). Even though being zealot does have a connotations, I do have to say that this is an ugly truth you and us have to accept.

It could be worse of course, we could be forcing you to use GPLv3, which I do think is overboard. But able to change bootloader is nice: For example, it was the openness of Arduino bootloader that allows the development of Sanguino, and also open up a route for a multi-core Arduino.

Since our worry is that the product will die when you die, maybe you can open it in your last will and testament? J/K
Title: Re: AVR with embedded USB?
Post by: westfw on Feb 03, 2009, 05:40 am
Quote
we could be forcing you to use GPLv3
Just curious: Jestersage, just who are you,  to be using "we" so ... dramatically?  Which pieces of code have your written and kindly released under something less virally oppressive than GPLV3?
(I note that Mellis made rather encouraging complementary noises, without delving into open source politics.  In general, I think the arduino team members have done a really good job of treading the open source political lines, not always in their own favor...  For instance, I think the whole Freeduino controversy worked out pretty well for all parties, in the end.)

(Sigh.  So much for keeping my fingers curled.)
Title: Re: AVR with embedded USB?
Post by: Fjornir on Feb 03, 2009, 06:17 am
Quote
Quote
we could be forcing you to use GPLv3
Just curious: Jestersage, just who are Which pieces of code have your written and kindly released under something less virally oppressive than GPLV3?


Virally oppressive? Don't you mean "Downstream protective" ?
Title: Re: AVR with embedded USB?
Post by: AlphaBeta on Feb 03, 2009, 07:54 am
Quote
....you should in time see more and more compelling advantages to using a Teensy.


For me, the opensource nature and community contribution is the compelling advantage.
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 03, 2009, 09:28 am
Quote
I'll just say that I suspect that the complexity of implementing USB devices beyond a simple serial port simulation is going to be a much bigger barrier to success


Well, in terms of implementing a HID device, it's really not that bad--and by now my Arduino and bit-banging shield are implementing a composite device (six-axis, 16-button joystick, plus keyboard and mouse, with a binding interface) quite nicely, using AVRUSB.  With the LUFA (http://www.fourwalledcubicle.com/LUFA.php) library, implementing devices on an AT90USB chip isn't too bad at all.

When I wrote the admittedly rather dodgy HidSporb (http://hidsporb.sourceforge.net) driver for Windows, things were much worse because I had to deal with the Windows driver stack.  Implementing everything in USB is turning out to be a ton easier, because hotplugging, resource management, etc is done for you by the Windows driver--all you have to implement in the device is a continuous supply of HID reports, which is easy enough.

So I'm not sure that the complexity of implementing a HID device really is that much of a barrier for success, particularly with something like the LUFA library, which is really quite nice.

Now if you didn't use LUFA or the Arduino environment, developing a similar thing for a device like the USBKey (or AVROpendous or Teensy) is a great deal more difficult.

And this I suppose is at the heart of my disagreement with Paul on including/requiring his proprietary bootloader to work with the Arduino environment.  The success of Teensy seems (from my external point of view--there are obviously other issues I'm not seeing, and that's okay) to rely on the user using open-source tools (Arduino, LUFA) to make Teensy more appealing; in fact on the very nice Teensy page (http://www.pjrc.com/teensy/) the only Software Tools mentioned are WinAVR, MyUSB (now LUFA), and Arduino--all fully open-source.

So it seems pretty clear that the Teensy is aimed at the open-source development community--indeed it seems to rely on open-source tools to make it appealing.  But when asked to contribute everything back, the response is

Quote
I'm simply not very impressed by everything I've read here.


And, well, that's the problem, I suppose.  I'm impressed by the Arduino community and would love to contribute something back (and if my pathetic shield ever comes back from Seeed and works, I'll at least have sample code for Serial-game-device-to-HID-device apps to contribute, which sure isn't much but one does what one can).  

And the other side of it is, well, in a sense we don't have to impress him; we're not the suppliers producing something which is looking for customers.  And it seems curious from a business perspective to try to appeal to a community without displaying a commitment to their values.  It's a bit like offering to buy a PETA spokesperson a hamburger.  It might seem like a nice gesture, but...

I don't have some manic objection to closed-source (I'm writing this from my Windows partition, after all).  I do have an objection to closed-source which derives its success from open-source; it seems to be missing the point entirely.  
Title: Re: AVR with embedded USB?
Post by: westfw on Feb 03, 2009, 09:29 am
Quote
Virally oppressive? Don't you mean "Downstream protective" ?

You may disagree with me, and I might even be wrong, and this is certainly not the place to debate the issue in detail, but "virally oppressive" is exactly what I meant...
Title: Re: AVR with embedded USB?
Post by: follower on Feb 03, 2009, 10:13 am
Quote
Well, in terms of implementing a HID device, it's really not that bad--and by now my Arduino and bit-banging shield are implementing a composite device (six-axis, 16-button joystick, plus keyboard and mouse, with a binding interface) quite nicely, using AVRUSB.

I would be interested in seeing your shield/code for this. :-)

--Phil.
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 03, 2009, 10:45 am
Quote
I would be interested in seeing your shield/code for this.


Well, it's not ready for prime-time and is a horrible hack, but in the spirit of the thread: http://orbduino.sourceforge.net, go to downloads (I haven't even set up the page yet, so the only things there are the files; orb_board is the Eagle file, orb_library is the library (like UsbKeyboard, UsbJoystick, etc), and orb_sketches is the actual sketch (orb1 is just a testing sketch; hidsporb is the one that actually makes the thing go)).

The Eagle shield is my first attempt at designing a PCB, so it's not great; this is a revision of the "one layer with three jumpers" design that I etched in my kitchen.  It looks terrible, but I can now use a $300 CAD device (the SpaceBall 4000FLX, about $20 from eBay) to play Left4Dead, which is good fun.  Also works like a champ in Google Earth.  You can see why I had high hopes for using Teensy, though-- you could get rid of the USB B socket, the zener diodes, and the resistors (and probably the DIP switch) and just have a socket for the Teensy, a socket for the Max233, and the DB9 plug; it'd be pretty sweet.

Basically this was done as a continuation of the Hidsporb driver mentioned earlier, because I like old gaming devices like the SpaceOrb 360 and think it's a pity they aren't supported by modern operating systems.  I've ordered a batch of the boards from Seeed for the tiny SpaceOrb community (it must be at LEAST five people, lol : http://www.jaycrowe.com), so until they get the shields and their arduinos and other people besides me have a chance to test it out, it's still well in beta, but hopefully that'll be fixed in the next week or two.  I'm curious to see if anyone expands it for use with, say, old serial joysticks or racing wheels.  Unless they're changing the logical device (what Windows sees--not necessary with a joystick but if you wanted to implement hat-switches or a steering wheel, maybe) you'd just need to implement a "physical_device" object and a "translator" object.  I tried making those proper abstract base classes but the Arduino environment got fussy about it and it probably used memory I didn't need to.  Only the back end ("orb_device.h") would need to be rewritten significantly to use, say, LUFA on an AT90USB chip.

It does use PROGMEM pretty extensively for bindings (so you have to reflash to change bindings) but it seemed the best way to use memory.  Also, the shield has a DIP switch so that you can disable communications to the orb for programming and reenable it for use (and so you can turn off "transmit to the orb" and still debug with serial messages).  It's not elegant, but it works OK.

I still may have to implement a "sensitivity curve" like I did with HidSporb; it doesn't quite "feel" right with a linear response (the original orb driver and Hidsporb implemented a sort of "cubic curve" for response which felt much better.  But that shouldn't be too hard; I may add it this weekend but honestly I'm tired of working on it for a while and want to get back to the game-playing business, which is why I wrote it to begin with.  I'll make a proper announcement once it's tested (and has a better website!).
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 03, 2009, 12:48 pm
Bitkeeper!  It was bugging me that I couldn't remember what this reminded me of.  Bitkeeper.

A lot of people don't even remember Bitkeeper, although BitMover industries are still in business and presumably doing roughly OK.  But for those who don't want to read the grim history of it, BitKeeper was a proprietary distributed revision control system that Linus Torvalds used for the Linux kernel--you'd have a hard time imagining a higher-profile project.  And it was really good!  I used BitKeeper as a client for a bit when playing with the OpenZaurus build system, and it worked like a champ, really a great technical solution.  But although it was free-as-in-beer for these projects, a lot of people were nervous about mixing a proprietary product in with open-source development.

And they should have been--after a fellow named Andrew Tridgell reverse-engineered some of the protocols to try and get more information out of the repositories, BitMover sort of had two choices: open up, give away the software for free, and become the international world leader with name recognition, or close the license down and stay proprietary.

And the lesson out of this--the business/customer dollars-in-your-hand lesson, not the hippie "peace, love, and open-source" lesson everyone seems to think these conversations degenerate into--is that in shocking short order, the open-source community generated a slew of distributed version control systems (Git, Mercurial, Monotone, Darcs, Bazaar, Arch, some of which were in production at the time) and now no one but large corporations use Bitkeeper, and not that many of those.  The funny thing is, BitKeeper in many ways is still technically better than the alternatives.

That's my business point here.  The situation is even better for small hardware developers because while anyone could replicate the hardware, it's usually not an advantage to do so when a supplier is already there.  But if there's a reason not to, the community tends to work in such a way that it creates alternatives.

And that's what's happening.  Already you have projects like Zaiq's experimental interfacing of Arduino with the AT90USBKey using Atmel's (yes, closed-source) bootloader, but how long will it be before it uses something like the open-source LUFA bootloader or its own?  Maybe for some people the 3.5k difference between the LUFA bootloader and HalfKay will be compelling; myself, I'm having trouble using even half of the 16k available in the Arduino for my HID project and LUFA would be just fine.

In no way do I want to imply that Paul is trying to decieve anyone--he's been very forthright:

Quote
Teensyduino only supports the Teensy.... the bootloader is not open source.  If you are looking for a 100% pure open source project, including bootloader source code and CAD files under a share-alike license, Teensy is not for you.


And since I don't know what his business plan is, I could certainly be way wrong; I just feel that the best business decision would be to open it up and become the open standard for Arduino/At90USB development.  Because there will be one, eventually.  Probably several.  As long as there isn't a fully-open option, people will keep trying to create one.  As soon as there is one, that effort drops significantly.

That's why I keep persisting in beating this semi-dead horse, because the Teensy is a great product and I'd like to see it be the open standard.  But if it stays closed, another project will almost certainly step in, because obviously there is a niche there.
Title: Re: AVR with embedded USB?
Post by: opendous on Feb 03, 2009, 01:40 pm
Came across this post and wanted to clarify some things regarding the AVRopendous.

  Linux
  gcc and avr-gcc (gcc.gnu.org)
  dfu-programmer (dfu-programmer.sourceforge.net)
  LUFA and LUFA bootloader (fourwalledcubicle.com/LUFA.php)
  KiCAD EDA Suite (kicad.sourceforge.net)
+ AVRopendous (code.google.com/p/avropendous/downloads/list)
---------------------------------------------------------------------
= Open Hardware and Software Development Platform for the Atmel AT90USB162

All elements are licensed such that you can develop commercial or non-commercial projects without restrictions other than Attribution (creativecommons.org/licenses/by/3.0/) and/or MIT License inclusion (LUFA is MIT licensed and AVRopendous-related code follows that lead).

You do not need to touch proprietary software to design and develop both hardware and software with the AVRopendous.

Atmel's FLIP Programmer is currently used under Windows for programming as dfu-programmer is in the process of being ported to Windows.  The Linux route is completely Free and Open Source.

Having said all that, I did not consider that people might want the AVRopendous to come with the Open Source LUFA bootloader pre-installed.  I am now offering the LUFA bootloader as an option and want to thank the Open Source community for pointing out this flaw.

Title: Re: AVR with embedded USB?
Post by: pjrc on Feb 03, 2009, 03:41 pm
Who here is using Linux exclusively and not doing any development using Windows or Macos?
Title: Re: AVR with embedded USB?
Post by: dcb on Feb 03, 2009, 04:26 pm
Thanks for the input opendous, it certainly seems your intent is to be open with the available tools to me.  And anyone is free to help port dfu-programmer to their OS of choice, or use open source linux.

All the usb discussion does make me wonder what the benefits are though, from an arduino perspective.  What percentage of projects actually need faster serial or need to look like a certain kind of usb device, and cannot do so with avrusb?  

I have to guess that ftdi is a pretty good choice for %99 of the projects out there, and could be replaced with a tiny running avrusb without turning arduino on its ear.
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 03, 2009, 05:30 pm
Thanks for the correction, opendous.  Having said that, I do want to make sure this thread doesn't become a platform war.  I know a few semi-harsh things have been said, but I think this is still an interesting and fairly civil conversation and one worth having.

Quote
What percentage of projects actually need faster serial or need to look like a certain kind of usb device, and cannot do so with avrusb?  


Good question.  The answer is probably very few--with some caveats:


I could be slightly wrong with the above, but to invert your question a bit--aside from cultural inertia, is there a compelling reason not to use a USB-style chip?  (actually, there can be--half the SRAM and fewer analog pins if I remember right, but on the "FTDI vs proper USB" side, I think "proper USB" actually is better, while FTDI is just "good enough").

At any rate, it's an interesting distinction.  Those willing to take on the complexity of USB/HID may not need the ease of use of the Arduino environment and may well be OK with a proprietary part.  There is nothing inherently wrong with closed parts--I simply choose not to use them because I consistently have better long-term experiences with open tools.

I want to state that again, because tempers can flare and I want to be clear: I bear no ill will toward Teensy simply because it is closed.  What concerns me is that it is closed but relies on an openly-provided infrastructure for its appeal, up to and including naming conventions.  That, and I still admire it as a product and would love to see it fully opened.

Quote

Who here is using Linux exclusively and not doing any development using Windows or Macos?


Another good question.  You will be interested to note that currently I am developing primarily on MacOS (at work) and Windows (at home).

But in case you are going where I suspect you are with this, it's worth saying that I would rather not be; my primary development environment is indeed Linux (such that at my last job, I even did most programming on a laptop running Ubuntu which my IT manager wouldn't let me connect to the network--I preferred the environment that much).  All previous opened projects were again under Linux with the exception of YakIcons, an open-source gaming toolkit I wrote in 1996, which is I think understandable since Linux wasn't very tractable for gaming in 1996.

I'm using MacOS at work because the IT management removed the Linux terminals and replaced them with Macs, without much choice in the matter.  The Mac has been a constant irritation which I have only assuaged by installing the open-source tools I am familiar with.  I am able to proceed with open-source tools running in a layer over the Mac OS, which is the best I can do under the circumstances.  It was a good thing I was using all open-source tools at the time, I can tell you!  I was able to transfer everything and recompile it without difficulty.

I'm using Windows at home because my current project is building this device such that the SpaceOrb, an old serial gaming device, can be used in Windows as an OS-agnostic USB device; again, all tools involved are open-source (including cygwin/emacs; I'm glad that Arduino has the external editor option!).

My point is that I feel like many times people in these discussions really assume that I want things opened up simply because I don't want to pay for them.  But the benefits of open tools go well beyond that, such as longevity and portability; the low cost of many of the software tools is just a pleasant side effect.

As for why the SpaceOrb can't be used in Windows, it's a sad story; it was a technically excellent product, but only communicated via a proprietary driver, and once the company went out of business, well...
Title: Re: AVR with embedded USB?
Post by: Jestersage on Feb 04, 2009, 08:43 am
First off, when I mean we, I mean the other people in Open Source community. I know that there are some people who is more warlike.

Though on the other hand, it's clear that Paul does not want to give concession even in the form of removing -duino, especially when we all know why he asked that question on Linux and mac and windows.
Title: Re: AVR with embedded USB?
Post by: vputz on Feb 04, 2009, 09:34 am
Quote
especially when we all know why he asked that question on Linux and mac and windows.


Well, let's be fair--we don't know that.  I made an assumption, which may turn out to be unwarranted, and even if it wasn't unwarranted, it's a fair point that many advocates of open source tools still have to use closed-source items.  It's certainly true!

And as mentioned, I don't really have a problem with closed source items depending on their role.  I play closed-source games all the time, for example; I just accept that they have relatively short "lives" and that I probably won't be able to play them again in a few years after operating systems change.  Development tools are different; I want those to stick around a good long time.

One thing we haven't heard from Paul, and this would be good for our education: why is it so important that the bootloader remain closed?  It could be very important!   In particular, it'd be good to hear how it benefits both you the provider and we the potential customers.
Title: Re: AVR with embedded USB?
Post by: dcb on Feb 04, 2009, 11:52 am
Did you look at the bootloadHID link I posted?
http://www.obdev.at/products/avrusb/bootloadhid.html

It isn't using the uart, and it is HID, and you can put it on a $2 tiny (in pdip as well) if you want to offload the 168.  And keeping with a 168 or compatible is a huge benefit IMHO, so much less of the libraries and examples will break that way.

Title: Re: AVR with embedded USB?
Post by: vputz on Feb 04, 2009, 12:48 pm
Pretty slick, dcb--you caught me; I hadn't looked  :).  Although I don't know that there's a good Arduino-environment-to-bootloadHID bridge yet (although if not, I'm sure there will be-- I just haven't looked).  

Now, this does still require building the external USB circuit for the AVRUSB usb port, right?  And since you're using AVRUSB there are still the other problems mentioned (manually calling refresh() periodically, which you may still have to do with LUFA (I haven't checked). And there are possibly some other issues.  So in actuality this doesn't change my usage much (my shield will still be essentially the same) but it's a great alternative to know about and if I was building an end-device I can see how you could set up sketches for serial port monitoring and stuff.  I'm academically curious to know if it flashes any faster (heh), but that's obviously not a big deal.

Cool development, though--thanks for being more insistent on bringing it to our attention!
Title: Re: AVR with embedded USB?
Post by: follower on Feb 04, 2009, 01:09 pm
Quote
but in the spirit of the thread: http://orbduino.sourceforge.net,

Thanks for uploading that. :-)

--Phil.
Title: AVRUSB90 analog read
Post by: marser on Feb 18, 2009, 06:38 pm
I've seen on the Teensy page that analog input is not supported:
"There are no analog inputs on the Teensy"

This is in spite of the AT90USB162 supposedly providing 8 ADC channels.

So is this a software limitation? What about AVROpendous, does it support analogRead() or equivalent?

I'm in a situation where I'd like to prototype with an AT90USBxxx to find a way around the well known serial-over-USB limitations inherent with the Arduino. However I don't really want to etch PCB's and solder SMT's if I can avoid it. So shelling out $20 or so for a teensy or opendous seems a much better option, especially if there's ready made, compatible software to go with it. But I need those analog inputs!

cheers,

/m
Title: Re: AVR with embedded USB?
Post by: opendous on Feb 18, 2009, 07:31 pm
The AT90USB162 (http://www.atmel.com/dyn/Products/product_card.asp?part_id=4097) does not have any ADC inputs.  It does have one analog comparator.  The larger USB AVRs do have 8 ADCs.

Your best bet for now is to buy an USBKey (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=AT90USBKEY-ND), 6 headers for your USBKey (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=S9009E-05-ND) and some 24AWG wire (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=C2003B-100-ND) so you can connect your USBKey to a solder-less prototyping breadboard.

Take a look at the LUFA (http://www.fourwalledcubicle.com/LUFA.php) library which is designed for and around the USBKey.

Good luck with your project.
Title: Re: AVR with embedded USB?
Post by: marser on Feb 19, 2009, 05:41 am
Alright, that explains it - thanks!
I looked on avr freaks (http://www.avrfreaks.net/index.php?module=Freaks%20Devices&func=displayDev&objectid=137) and it says "Analog-to-Digital Converter (10-bit)  8 ch".
Maybe a copy paste error?

In any case, thanks for the info. I'll either try the AT90USBKEY or roll my own proto board with one of the bigger AT90's - or wait until farnell uk starts stocking ATmega16U4.
Title: Re: AVR with embedded USB?
Post by: marser on Feb 19, 2009, 08:35 pm
BTW there is also the benito (http://blog.tempusdictum.com/index.php/products/benito-boards), a tiny, no-frills AT90USB162 pcb.