EmbeddedRelated.com
Forums

Selection of a USB microcontroller

Started by FD April 26, 2007
Hi there,

I am in the process of selecting a general purpose microcontroller for
several new developments.
There are several uCs with USB, but how to select the best one?
I guess some of you already have some hands-on experiences.

Apart from the USB port, for easy interfacing to a PC, it is important that
it is low cost in quantities of 10s to 100s.
A requirement is ease of programming, not only for the microcontroller but
also the driver on the PC, to get the communication up and running quickly.

The best programming language would be C. C++ and Pascal (Delphi) on the PC
is no problem and so is some assembler in the microcontroller.
The microcontroller should be around 5 to 20 MIPS with at least 8KB Flash,
2KB RAM and a little non-volatile storage (like EEPROM).

I have experience with Atmel ATmega8, 32 and 128 (without USB). Lots of
Flash and RAM, but they are not so good in industrial environments.
The 8051 family is much more reliable, but my very good experiences with 
these are over 5 years old.
I consider the Microchip PICs as being to light-weighted.

Any recommendations are highly appreciated.

Frank


On Apr 26, 5:41 am, "FD" <f...@fd.ods.org> wrote:
> Hi there, > > I am in the process of selecting a general purpose microcontroller for > several new developments. > There are several uCs with USB, but how to select the best one? > I guess some of you already have some hands-on experiences. > > Apart from the USB port, for easy interfacing to a PC, it is important that > it is low cost in quantities of 10s to 100s. > A requirement is ease of programming, not only for the microcontroller but > also the driver on the PC, to get the communication up and running quickly. > > The best programming language would be C. C++ and Pascal (Delphi) on the PC > is no problem and so is some assembler in the microcontroller. > The microcontroller should be around 5 to 20 MIPS with at least 8KB Flash, > 2KB RAM and a little non-volatile storage (like EEPROM). > > I have experience with Atmel ATmega8, 32 and 128 (without USB). Lots of > Flash and RAM, but they are not so good in industrial environments. > The 8051 family is much more reliable, but my very good experiences with > these are over 5 years old. > I consider the Microchip PICs as being to light-weighted. > > Any recommendations are highly appreciated. > > Frank
ARM
> I am in the process of selecting a general purpose microcontroller for > several new developments. > There are several uCs with USB, but how to select the best one? > I guess some of you already have some hands-on experiences.
...
> Any recommendations are highly appreciated.
While I'm no expert in USB stuff, I have made my fair share of mistakes. My next USB outing will certainly capitalize on what I learned from my mistakes. Here's what I found out: The host side driver will be your biggest headache, by far. You'll need to consider it carefully. It's usually best to choose a built-in device class supplied by your host computer so you don't have to write, test, and pay for compliance testing. My efforts have only supported Windows computers but I'll bet a whole bunch of problems will surface if you choose others (like Mac or Linux). The downsides to my suggestion are: 1. Supporting a class driver might mean extra programming on the device side to support the entire class whether you need the full functionality or not. 2. You might have trouble getting a good fit for you needs vs. what the class driver will support. 3. Specifically, if you choose the COM port emulation (usbser.sys), you'll be dogged with always wondering what the COM port is when you plug it in. I hate that problem. Love to know if there's a solution. The upsides is you could get lucky or even pin your decision to use a specific chip if the chip maker will give you device code to do what you need (for example, Cypress PSOC and USB-UART). Lots of examples and good vendor support are key unless you're the adventurous type. Be wary of vendors that will supply the drivers. They're not always high quality. Alternative to built-in device classes, you can go the opposite route and design your endpoint interfaces to suit your needs. It's much simpler from the device side but you'll need a driver. I've had my eye on the generic Thesycon driver. Not sure if you need to WHQL test it or not. Certainly, if you write your own driver, it takes a good bit of programming ability, tool investment, and testing requirements. I'd like to hear other's opinion on the matter. It's all tradeoff (as usual) and how one implements is probably driven by one's talents and resources (as usual, too). JJs
On Apr 26, 8:43 am, jetq88 <jetq5...@gmail.com> wrote:
> On Apr 26, 5:41 am, "FD" <f...@fd.ods.org> wrote: > > > > > > > Hi there, > > > I am in the process of selecting a general purpose microcontroller for > > several new developments. > > There are several uCs with USB, but how to select the best one? > > I guess some of you already have some hands-on experiences. > > > Apart from the USB port, for easy interfacing to a PC, it is important that > > it is low cost in quantities of 10s to 100s. > > A requirement is ease of programming, not only for the microcontroller but > > also the driver on the PC, to get the communication up and running quickly. > > > The best programming language would be C. C++ and Pascal (Delphi) on the PC > > is no problem and so is some assembler in the microcontroller. > > The microcontroller should be around 5 to 20 MIPS with at least 8KB Flash, > > 2KB RAM and a little non-volatile storage (like EEPROM). > > > I have experience with Atmel ATmega8, 32 and 128 (without USB). Lots of > > Flash and RAM, but they are not so good in industrial environments. > > The 8051 family is much more reliable, but my very good experiences with > > these are over 5 years old. > > I consider the Microchip PICs as being to light-weighted. > > > Any recommendations are highly appreciated. > > > Frank > > ARM-
AVR + ARM At90USB82 + LM3S301
> > 3. Specifically, if you choose the COM port emulation (usbser.sys), you'll > be dogged with always wondering what the COM port is when you plug it in. > I hate that problem. Love to know if there's a solution. >
A well behaved CDC uses a serial number and you allocate a new port for every new serial number you detect. This is not so good in a school environment where you can have a large qty of USB devices and you will eventually have a COM port allocated for each such device. -- Best Regards, Ulf Samuelsson This is intended to be my personal opinion which may, or may not be shared by my employer Atmel Nordic AB
FD wrote:
> Hi there, > > I am in the process of selecting a general purpose microcontroller for > several new developments. > There are several uCs with USB, but how to select the best one? > I guess some of you already have some hands-on experiences. > > Apart from the USB port, for easy interfacing to a PC, it is important that > it is low cost in quantities of 10s to 100s. > A requirement is ease of programming, not only for the microcontroller but > also the driver on the PC, to get the communication up and running quickly. > > The best programming language would be C. C++ and Pascal (Delphi) on the PC > is no problem and so is some assembler in the microcontroller. > The microcontroller should be around 5 to 20 MIPS with at least 8KB Flash, > 2KB RAM and a little non-volatile storage (like EEPROM). > > I have experience with Atmel ATmega8, 32 and 128 (without USB). Lots of > Flash and RAM, but they are not so good in industrial environments. > The 8051 family is much more reliable, but my very good experiences with > these are over 5 years old. > I consider the Microchip PICs as being to light-weighted. > > Any recommendations are highly appreciated.
The EVAL boards from both SiLabs and Atmel are cheap, so I'd get both, and trial both pathways. SiLabs also have boards and chips that are RS232-USB, which is another option, and can be good if your expected range of Embedded devices is wide. ST have uPSD devices with USB, if you are looking at the higher pin count end. Above this, there are ARM devices with USB and the new Atmel AT32UC3A0512 is also capable looking silicon - but you are then getting way above 8K Flash. -jg
"Ulf Samuelsson" <ulf@a-t-m-e-l.com> schreef in bericht
news:f0r6kh$ge0$1@aioe.org...
> > >> 3. Specifically, if you choose the COM port emulation (usbser.sys), >> you'll be dogged with always wondering what the COM port is when you plug >> it in. I hate that problem. Love to know if there's a solution. >> > > A well behaved CDC uses a serial number and you allocate > a new port for every new serial number you detect. > This is not so good in a school environment where > you can have a large qty of USB devices and you will eventually > have a COM port allocated for each such device. > > -- > Best Regards, > Ulf Samuelsson > This is intended to be my personal opinion which may, > or may not be shared by my employer Atmel Nordic AB
I am a newbie on the USB front and the host side driver is something that I overlooked a bit. I definitely need Windows and Linux support. A USB to serial convertor (in my design) might be a very simple solution. It is not too hard to find the COM port where the device is connected to: - scan the first 20 ports for availability (open the device) - provide a handshake method between application and device - for multiple devices: serial number the device with handshaking I already use this with the serial devices I developed, since I implemented a serial communications protocol. Frank
"FD" <fd@fd.ods.org> wrote in message 
news:4631d3e9$0$30828$e4fe514c@dreader19.news.xs4all.nl...
> "Ulf Samuelsson" <ulf@a-t-m-e-l.com> schreef in bericht > news:f0r6kh$ge0$1@aioe.org... >> > >>> 3. Specifically, if you choose the COM port emulation (usbser.sys), >>> you'll be dogged with always wondering what the COM port is when you >>> plug >>> it in. I hate that problem. Love to know if there's a solution. >>> >> >> A well behaved CDC uses a serial number and you allocate >> a new port for every new serial number you detect. >> This is not so good in a school environment where >> you can have a large qty of USB devices and you will eventually >> have a COM port allocated for each such device. >> >> -- >> Best Regards, >> Ulf Samuelsson >> This is intended to be my personal opinion which may, >> or may not be shared by my employer Atmel Nordic AB > > I am a newbie on the USB front and the host side driver is something that > I > overlooked a bit. I definitely need Windows and Linux support. > > A USB to serial convertor (in my design) might be a very simple solution. > > It is not too hard to find the COM port where the device is connected to: > - scan the first 20 ports for availability (open the device) > - provide a handshake method between application and device > - for multiple devices: serial number the device with handshaking > I already use this with the serial devices I developed, since I > implemented > a serial communications protocol. > > Frank >
I have had good luck with the Silabs CP2103 USB to Serial Bridge components. They provide good utility programs for low level programming of the parts. They seem to work with less problems than other Serial/USB converters. For my serial communications, I use SerialNG: http://www.domis.de/serialng.htm. It seems to work well with Delphi 4. There is a function that returns a list of all COM ports that have been enumerated by the PC, so you don't need to try opening all possible ports. I send out a test code and detect proper response to determine if a device is connected. The device I developed is essentially a data collection device, operating at 2400 samples per second to read line frequency waveforms to 10 bit accuracy. My port is set for 57600 Baud. I use a Microchip PIC18F242, 14.7456 MHz clock, which divides exactly to the usual baud rates. I programmed in assembly using a reference application as a starting point. The 18F parts are designed to be used efficiently with C compilers. I have C18, but have not yet used it. Paul
> > I have experience with Atmel ATmega8, 32 and 128 (without USB). Lots of > Flash and RAM, but they are not so good in industrial environments.
Could you elaborate on this please? Are AVRs at a given voltage and frequency more susceptible to noise than 8031 variants?
> The 8051 family is much more reliable, but my very good experiences with > these are over 5 years old.
You could do worse than an 8031 variant with an FDTI USB chip.
John Speth <johnspeth@yahoo.com> wrote:

> Certainly, if you write your own driver, it takes a good bit of > programming ability, tool investment, and testing requirements.
There's also the option of user-mode drivers which are easier to implement. Libusb works on virtually all platforms, Windows Vista has WinUSB and on OS X has IOKit. There's also some commercial offerings for Windows, eg. Jungo's WinDriver. -a