Arduino IDE and Direct USB Connection to Microcontroller

If you look at the Arduino Esplora Reference Design Schematic (for example), you can see that the USB connection simply goes right into the ATMEGA32U4-MU. Simple. I'm hoping to design an Arduino IDE compatible gadget that has this kind of simple direct USB interface, like the Esplora does, only I need a much more powerful processor.

The ATSAMD21 seemed tempting as it is the heart of the Arduino Zero, but it appears that the USB needs to go through the EDBG chip (then onto the ATSAMD21's SWD pins). Although the D21 does have a USB port of it's own, it doesn't look like that USB port is capable of providing a direct interface to the Arduino IDE (am I mistaken about this?)

Can anyone tell me what is the most powerful microcontroller that the Arduino IDE can support that uses a direct USB connection, like the Esplora employs?

Thank you for your thoughts on this.

Matt

Teensy 2++
https://www.pjrc.com/teensy/

Of course, the IDE is a patched older version, but same look & feel. I know you are only asking about the uC, but you do have to program the beast!

Ray

Teensy 2+ isn't really "more powerful" than a 32u4.
Try a Teensy3.1, or a Due.

SamD21 does seem to have a direct USB connection - the Arduino Zero has two USB connectors, one of which goes through the debug chip, and one which goes directly to the CPU. I'm not sure what you mean by "a direct connection to the IDE." (what within the IDE are you wanting to talk to?)

Thank you both for your replies. First off, I have to admit that while I've done a lot of embedded design, I'm new to Arduino and trying to ramp up as quickly as possible. I've always simply used the manufacturer supplied IDE and a JTAG or ICE device to connect to the micro's debug interface. I've done ARM (NXP LPC Cortex-M0) and even a recent Xmega (A4U) design, but I just used Atmel Studio and the Atmel-ICE.

But now I'm hoping to design a gadget that will be easily approachable by those Makers/Hobbyists who are familiar and comfortable with the Arduino IDE and might not be up for buying an ICE or using an Eclipse or Visual Studio type IDE. I want them to be able to program it with their familiar Arduino IDE environment. Ideally, I will be able to design my circuit such that users would just run Arduino IDE on their PC and connect a USB cable between their PC and a Micro-B USB connector on my board that connects directly to a USB interface on the micro itself.

I've observed that many Arduinos use an intermediate chip to perform a USB-to-Serial conversion. The Arduino Uno R3 for example, uses that ATmega16U2 between the USB connector and the ATmega328P. Of course this is necessary as the 328P doesn't have a USB interface built in. But some micros do, and I'm hoping to identify one of those and have a very simple/direct interface between the user's PC and the micro on my board.

Not coming from an Arduino background, I may have some misconceptions, so please feel free to correct me if I'm off track.

Another goal is to not use a 100 or 144 pin micro! I only need about 18 bits of I/O. The 48-Pin TQFP D21 seems perfect, I just don't want to have to use that EDBG chip! Is there a D21 Bootloader for the D21 that would use the D21's native USB interface and work with the Arduino IDE? And would there need to be a D21 descriptive file of some sort used by the Arduino IDE as well? I'm likely exhibiting my ignorance here, please feel free to enlighten me.

Bottom line is that I want users to be able to easily write their own code on the Arduino IDE and program my gadget. I need some speed and some program space (and hopefully at least 8k RAM), but otherwise I don't need much from the micro other than some simple resources like SPI, ADC, Timers, etc...

So I'm trying to figure which chip I should be using to accomplish my goal, and any additional circuit requirements for pulling off this interface between my gadget and the USB port on the PC running the Arduino IDE. Ideally there would already be a Design Reference Schematic of some sort demonstrating the interface as well as the necessary bootloader and any IDE-related files. I expect I'm not the first to approach this and I don't want to reinvent the wheel here.

Again, I am grateful for any guidance and insight you can share to help me define what my best solution would be for designing in a higher performance micro and still providing a direct (no intermediate chip) USB interface to the PC running the Arduino IDE.

Thanks again,

Matt

There are about 4 different functions for the USB port(s) on an Arduino-class Single Board Computer.

  • "uploading" new software to the SBC.
  • providing a "virtual serial port" for communications between the host-side applications and the SBC.
  • providing a lower-level USB programming interface, so that the SBC can implement USB peripherals OTHER than a serial port (Mouse, keyboard, etc.)
  • Intelligent debugger interface.

Most of the early arduino boards combine 1 and 2; they include a dedicated USB/Serial converter chip to provide the VSP, and then use a serial bootloader in the SBC cpu itself to upload new code over that same serial port. When the bootloader is not in use, user applications can use the same serial port for "regular" communications.
With Uno, the USB/Serial chip is reprogrammable to provide other USB functions as well (I don't know how much that is actually used.)
With Leonardo and the other 32u4 based boards, the USB is built into the main chip, and the same port can be more easily converted to and from serial vs other USB devices. Not without occasionally confusing hosts that might not be used to a USB peripheral suddenly "changing" without cleanly shutting down first. Due has both native USB and USB/Serial converters, to help address some of these problems.
Zero is the first Arduino to have the separate debug usb connection (4), and it hasn't come out of hiding enough for anyone to see exactly how that's going to work. It should be possible to provide all of the OTHER usb functionality typical of an Arduino, even without that debug circuitry. Or if the debug circuitry were in an external pod instead of on the board. (Some of us are watching for exactly what will happen here...)

Thank you for your reply - this is all interesting stuff!

So consider this:

  1. I take the bootloader for the 32U4 (which works with the chip's native USB interface) and modify it so that it is adapted to the D21, then use the Atmel-ICE to program this modified bootloader into the D21. Now the D21 will boot from its native USB interface just like the 32U4.

  2. I make the necessary updates to the Arduino IDE files which specify the target hardware, thereby adding a native D21 USB option. I am not familiar with how the Arduino IDE provisions itself for interfacing with different hardware targets. Is there a .h file for the IDE that specifies the relevant parameters? I need to look into this further, but if you have a brief answer to point me in the right direction that would be great.

Now I can do the functions you indicated as "uploading" and "virtual serial port" just like how the Arduino IDE currently works with the 32U4, right?

Does anyone in the Forum know if this kind of D21 native USB Bootloader functionality has already been developed by someone?

The D21 seems like a great chip, but while commercial manufacturers will be fine with the BGA EDBG chip, most hobbyists are not going to be able to work with the BGA EDBG component to build their own hardware. Because of this, I'm guessing that a simple D21 native USB Bootloader would be quite popular among hobbyists, which is Arduino's target market, right?

The Arduino IDE does have the "File -> Upload Using Programmer" command. And I understand also that a regular Arduino board can be configured to act as a programmer device. In this case then, the combination of these two capabilities may provide the simplest solution. Don't even worry about a bootloader, just use an ICE or an Arduino programmed to function as an programmer, then use the Arduino IDE with the selection to "Upload Using Programmer". But I'm guessing that while this will get the D21 programmed, it doesn't help with any debugging resources like the "virtual serial port", right?

Again, my intention here is to provide the end user with the Arduino IDE experience they want for working with this gadget I plan to design.

Any suggestions or ideas...?

Thanks,

Matt

I am not familiar with how the Arduino IDE provisions itself for interfacing with different hardware targets

Bit more complex but designed so ZIP self-extracting can get the job done.

Arduino IDE-1.5.x 3rd-party-Hardware-specification

Now I can do the functions you indicated as "uploading" and "virtual serial port" just like how the Arduino IDE currently works with the 32U4, right?

One would think so... The 1.5.x spec is still in-flux, but should be stable enough in the areas of your concern.

And I understand also that a regular Arduino board can be configured to act as a programmer device.

Yes... But if you use a USzB-serial interface w/ boot loader, this would be nessary only for re-flashing the uC.

intention here is to provide the end user with the Arduino IDE experience they want for working with this gadget I plan to design.

The "Micro" was designed by Adafruit and the "Pro Mini" by Sparkfun so you can see how those integrate.

Ray

Thank you for the link and the reference to the other boards. I will study these - looks like they might contain a lot of good information.

Thanks Again!

Matt