Message from discussion
Multiple Programs on a Single ATmega?
Received: by 10.101.21.5 with SMTP id y5mr3792297ani.14.1320094013058;
Mon, 31 Oct 2011 13:46:53 -0700 (PDT)
X-BeenThere: nycresistormicrocontrollers@googlegroups.com
Received: by 10.101.55.11 with SMTP id h11ls7835873ank.4.gmail; Mon, 31 Oct
2011 13:46:49 -0700 (PDT)
Received: by 10.236.170.198 with SMTP id p46mr23942639yhl.8.1320094009310;
Mon, 31 Oct 2011 13:46:49 -0700 (PDT)
Received: by 10.236.170.198 with SMTP id p46mr23942634yhl.8.1320094009271;
Mon, 31 Oct 2011 13:46:49 -0700 (PDT)
Return-Path: <dro...@gmail.com>
Received: from mail-gx0-f174.google.com (mail-gx0-f174.google.com [209.85.161.174])
by gmr-mx.google.com with ESMTPS id m17si3523112ybe.0.2011.10.31.13.46.49
(version=TLSv1/SSLv3 cipher=OTHER);
Mon, 31 Oct 2011 13:46:49 -0700 (PDT)
Received-SPF: pass (google.com: domain of dro...@gmail.com designates 209.85.161.174 as permitted sender) client-ip=209.85.161.174;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of dro...@gmail.com designates 209.85.161.174 as permitted sender) smtp.mail=dro...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by mail-gx0-f174.google.com with SMTP id b1so6299879ggn.19
for <nycresistormicrocontrollers@googlegroups.com>; Mon, 31 Oct 2011 13:46:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type;
bh=VW6RaeB84aUWXJiJ1vZ19j0AheaK5g/mPu8vPafSIAM=;
b=Zh7RX2d3P17ew6LBfTeBgwYTLjZn0ZZdrsRyfhwKqQTZ0nfBAlr2NXruipU8d6lT83
0NZb9geCXnP3VDpz9o+n9hYs4EMFRbMAGDIF0wcLx3quGP9Icoc2AFjWNcWy7eL0z5L9
yz5NahZl6wOdgIxuJtw4ud6kFDwTn8c66NEj0=
Received: by 10.101.165.18 with SMTP id s18mr2967386ano.108.1320094009094;
Mon, 31 Oct 2011 13:46:49 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.100.242.4 with HTTP; Mon, 31 Oct 2011 13:46:28 -0700 (PDT)
In-Reply-To: <CAJeefhCRUg8T38ZL2YijD-wo=0nJNnG9K-vSkNiuzBduaU0mDg@mail.gmail.com>
References: <CA+9Hec1zZrxpOwjKzQKM7zaiugGkR7tZ=FvrYS2wwtivpWm...@mail.gmail.com>
<CAO9+LVS1Bt6iOc8i38n8TZN3Gz_uUerbTy5FuuXChjW87q0...@mail.gmail.com>
<185600744-1319593502-cardhu_decombobulator_blackberry.rim.net-7498246...@b15.c2.bise6.blackberry>
<CA+9Hec3AsnVf1KYvbmOQxHh6iAb1VmYjHbK0pMSNvFNuPU0...@mail.gmail.com> <CAJeefhCRUg8T38ZL2YijD-wo=0nJNnG9K-vSkNiuzBduaU0...@mail.gmail.com>
From: David Rorex <dro...@gmail.com>
Date: Mon, 31 Oct 2011 13:46:28 -0700
Message-ID: <CACAQXeJULtenP3scP7HkEFZz9y+Jn1yRVRWcWMNL7pJinLY...@mail.gmail.com>
Subject: Re: [NYCR:Microcontrollers] Multiple Programs on a Single ATmega?
To: nycresistormicrocontrollers@googlegroups.com
Content-Type: multipart/alternative; boundary=001636c5bc6c7b748004b09e5658
--001636c5bc6c7b748004b09e5658
Content-Type: text/plain; charset=UTF-8
The library you want to look into is called "LUFA", it makes doing USB on
AVR's much easier than using the native USB API as mentioned below. I'm not
sure offhand, but I believe the teensyduino libraries use LUFA internally.
It can do stuff such as multiple USB devices in one, included in the many
LUFA examples are things like: Mass Storage+Keyboard, Serial Port+Mouse,
Keyboard+Mouse.
On Wed, Oct 26, 2011 at 10:01 AM, Dave Clausen <daveclau...@gmail.com>wrote:
> I've never worked with a mega32u or with a teensyduino, however I have
> used the at90usb series which I believe is similar to the mega32u. It is
> very possible for the one microcontroller to act as both a keyboard and a
> MIDI device simultaneously, if that's what you want. It is also possible
> for you to dynamically choose one based on the position of a switch.
> However you may not be able to do any of this with the stock Teensyduino
> development tools. You probably will have to interact directly with the
> microcontroller's native USB APIs, which I suspect are a lot more
> complicated than the teensyduino library APIs . It's been a while since
> I've done this so I've forgotten all the details, but you can see some
> sourcecode here: http://dclausen.net/projects/tfam/ . This is an
> at90usb128 device that implemented both the keyboard and mouse protocols.
> It didn't dynamically switch between one and the other, but it will at
> least give you some idea of how to use the USB API directly and how to
> implement multiple USB device types using a single program.
>
>
> On Tue, Oct 25, 2011 at 9:51 PM, Andy Leviss <a...@ducksecho.com> wrote:
>
>> On Tue, Oct 25, 2011 at 9:44 PM, <mattqui...@gmail.com> wrote:
>> > Is there anything stopping you from creating two separate ports on 1
>> device?
>>
>> The fact that there's only one USB port on the MCU, and I'd rather not
>> have to put two MCUs in to only use one at a time...
>>
>> --Andy
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "NYCResistor:Microcontrollers" group.
>> To post to this group, send email to
>> nycresistormicrocontrollers@googlegroups.com.
>> To unsubscribe from this group, send email to
>> nycresistormicrocontrollers+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/nycresistormicrocontrollers?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "NYCResistor:Microcontrollers" group.
> To post to this group, send email to
> nycresistormicrocontrollers@googlegroups.com.
> To unsubscribe from this group, send email to
> nycresistormicrocontrollers+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nycresistormicrocontrollers?hl=en.
>
--001636c5bc6c7b748004b09e5658
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
The library you want to look into is called "LUFA", it makes doin=
g USB on AVR's much easier than using the native USB API as mentioned b=
elow. I'm not sure offhand, but I believe the teensyduino libraries use=
LUFA internally. It can do stuff such as multiple USB devices in one, incl=
uded in the many LUFA examples are things like: Mass Storage+Keyboard, Seri=
al Port+Mouse, Keyboard+Mouse.<br>
<br><div class=3D"gmail_quote">On Wed, Oct 26, 2011 at 10:01 AM, Dave Claus=
en <span dir=3D"ltr"><<a href=3D"mailto:daveclau...@gmail.com">daveclaus=
e...@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" sty=
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I've never worked with a mega32u or with a teensyduino, however I have =
used the at90usb series which I believe is similar to the mega32u.=C2=A0 It=
is very possible for the one microcontroller to act as both a keyboard an=
d a MIDI device simultaneously, if that's what you want. It is also pos=
sible for you to dynamically choose one based on the position of a switch. =
However you may not be able to do any of this with the stock Teensyduino de=
velopment tools.=C2=A0 You probably will have to interact directly with the=
microcontroller's native USB APIs, which I suspect are a lot more comp=
licated than the teensyduino library APIs .=C2=A0 It's been a while sin=
ce I've done this so I've forgotten all the details, but you can se=
e some sourcecode here: <a href=3D"http://dclausen.net/projects/tfam/" targ=
et=3D"_blank">http://dclausen.net/projects/tfam/</a> . This is an at90usb12=
8 device that implemented both the keyboard and mouse protocols. It didn=
9;t dynamically switch between one and the other, but it will at least giv=
e you some idea of how to use the USB API directly and how to implement mul=
tiple USB device types using a single program.<div>
<div></div><div class=3D"h5"><br>
<br><div class=3D"gmail_quote">On Tue, Oct 25, 2011 at 9:51 PM, Andy Leviss=
<span dir=3D"ltr"><<a href=3D"mailto:a...@ducksecho.com" target=3D"_bla=
nk">a...@ducksecho.com</a>></span> wrote:<br><blockquote class=3D"gmail_=
quote" style=3D"margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204=
, 204);padding-left:1ex">
<div>On Tue, Oct 25, 2011 at 9:44 PM, =C2=A0<<a href=3D"mailto:mattquinn=
2...@gmail.com" target=3D"_blank">mattqui...@gmail.com</a>> wrote:<br>
> Is there anything stopping you from creating two separate ports on 1 d=
evice?<br>
<br>
</div>The fact that there's only one USB port on the MCU, and I'd r=
ather not<br>
have to put two MCUs in to only use one at a time...<br>
<font color=3D"#888888"><br>
--Andy<br>
</font><div><div></div><div><br>
--<br>
You received this message because you are subscribed to the Google Groups &=
quot;NYCResistor:Microcontrollers" group.<br>
To post to this group, send email to <a href=3D"mailto:nycresistormicrocont=
rollers@googlegroups.com" target=3D"_blank">nycresistormicrocontrollers@goo=
glegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:nycresistor=
microcontrollers%2Bunsubscribe@googlegroups.com" target=3D"_blank">nycresis=
tormicrocontrollers+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/nycresistormicrocontrollers?hl=3Den" target=3D"_blank">http://groups.g=
oogle.com/group/nycresistormicrocontrollers?hl=3Den</a>.<br>
<br>
</div></div></blockquote></div><br>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;NYCResistor:Microcontrollers" group.<br>
To post to this group, send email to <a href=3D"mailto:nycresistormicrocont=
rollers@googlegroups.com" target=3D"_blank">nycresistormicrocontrollers@goo=
glegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:nycresistor=
microcontrollers%2Bunsubscribe@googlegroups.com" target=3D"_blank">nycresis=
tormicrocontrollers+unsubscribe@googlegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/nycresistormicrocontrollers?hl=3Den" target=3D"_blank">http://groups.g=
oogle.com/group/nycresistormicrocontrollers?hl=3Den</a>.<br>
</div></div></blockquote></div><br>
--001636c5bc6c7b748004b09e5658--