Society of Robots - Robot Forum

General Misc => Misc => Topic started by: ErikY on February 08, 2013, 08:14:42 AM

Title: STMicro 32 bit microcontrollers
Post by: ErikY on February 08, 2013, 08:14:42 AM
Does anyone have any experience working with the STMicro 32 bit micro controllers?

I have been working with the 8 bit AVR's and have been wondering what else is out there, I know AVR has 32 bit mcu's as well, and I have been looking into those too.


I know these are used on the Netduino boards, but not much else.

I am opposed to using the Netduino based on .Net and MS platforms, I really don't want to depend on .net.

My main questions are:

1) Are the only options for development, .NET based, or are there any other options? I did some digging and found some professional third party tools, but nothing free like there is with AVR.

2) Is there any support for these things the way there is for AVR, I again did some digging but could not find anything.

Any other opinions would be great as well.
Title: Re: STMicro 32 bit microcontrollers
Post by: jwatte on February 08, 2013, 02:32:36 PM
Most of the ARM based boards have support by GCC. GCC is the compiler actually used by the Arduino tools.
For AVR chips, the GCC package you use is avr-gcc.
For ARM, you instead use a tool called "summon-arm-toolchain." This will take a time to run and build, and when it's done, you will have a version of GCC that can generate ARM executables.
ARM comes in a bunch of different flavors. There's "full-size" ARM vs "thumb-size" ARM, which roughly translates to ARMv9/11 vs Cortex cores. For embedded use, you pretty much always use the Thumb/Cortex based ones. But not always -- because of cell phone volumes, the high-end ARM chips are really squeezing the low-end chips from above.

If you want a nice development environment that's still about the size of the Arduino, yet has *lots* more power, try the Raspberry Pi. It runs Linux, has 512 MB of RAM, built-in Ethernet, USB support for WiFi, and also built-in display support through HDMI. You can develop *on* the RPi if you want to, or develop using a cross compiler and use ssh/scp/rsync to deploy to the RPi.

The main drawback with almost all the ARM systems is that they use 3.3V I/O instead of 5V I/O. This is true for the Arduino Due, too. The Due is a Cortex/Thumb based embedded ARM chip from Atmel, packaged in an Arduino-like form factor -- but with 3.3V I/O.
Other popular ARM options is the Stellaris system from TI (the Launchpad is quite affordable, at about $12) and, as you say, the STM ones. Also, the LPCExpresso are nice price/performance contenders, but no real GCC support. mBED is better supported, but pricier. And BeagleBone is even better -- dual core! -- but costs $99.

In reality, I haven't found any reason to waste time on the small ARMs. For small stuff, I use AVR-8 (like the Arduino.) If I need anything bigger, I use a Raspberry Pi, as it has a good price/performance ratio. For bigger things than that, I stick with the x86 architecture. FWIW: I just upgraded my robot Onyx from RPi to a Zotac AD-11 NUC-size (4"x4") dual-core AMD computer.
Title: Re: STMicro 32 bit microcontrollers
Post by: ErikY on February 08, 2013, 08:48:04 PM
J, thanks!

As usual, this is very informative!

A couple of questions if you don't mind, I am VERY interested in both Raspberry Pi and x86 for robotics.

If using a Raspberry Pi, or something with x86 architecture, how are the IO pins used/connected?

I always kind of thought the reason we use the mcu's was because they were setup for analog pins and digital pins, which enabled us to connect to motors, servos, sensors, PWM, etc.

I was under the impression that Raspberry Pi and x86 was not really connected to IO pins, am I mistaken on this?

If so, are there any resources, or tutorials that you know of to get started with either of these for hobby robotics? I have searched in the past and never found anything.

Also, with regards to your robot Onyx, what type of robot is it? Would you mind sharing some info about it?

Thanks!
Title: Re: STMicro 32 bit microcontrollers
Post by: jwatte on February 09, 2013, 11:13:36 AM
The Raspberry Pi has a 16-pin GPIO header with a variety of peripherals -- basic digital pins, SPI port, I2C port, UART, etc. It does not really have analog I/O; you'd need some peripheral chip for that.
Here's a link: http://www.adafruit.com/blog/2012/08/31/webiopi-control-your-pis-gpio-with-a-browser-piday-raspberrypi-raspberry_pi/ (http://www.adafruit.com/blog/2012/08/31/webiopi-control-your-pis-gpio-with-a-browser-piday-raspberrypi-raspberry_pi/)
Here's a random link to a robot made with Raspberry Pi: R2D2 Robot Powered by Raspberry Pi (http://www.youtube.com/watch?v=znuUm5vbSpI#)

A x86 PC doesn't have any GPIO, so you'll have to use a peripheral of some sort. What I do is using an Atmega32u4 for the low-level I/O; it has plenty of analog and digital I/O, and speaks USB. I then speak USB to that Atmega from the x86. The PC can also use USB to speak to other sensors, such as cameras, or GPS receivers, or game controllers, or WiFi, or whatever.

Here's a link to Onyx in its previous (Raspberry Pi) powered state: http://forums.trossenrobotics.com/showthread.php?5932-Onyx-walking-under-own-power-for-first-time (http://forums.trossenrobotics.com/showthread.php?5932-Onyx-walking-under-own-power-for-first-time)
Currently, I'm working on the next, narrower chassis, at the same time as upgrading to the PC, so I don't yet have video of all that together.
Title: Re: STMicro 32 bit microcontrollers
Post by: ErikY on February 09, 2013, 02:33:47 PM
J,

Thanks for the info, I am going to look into Raspberry Pi a bit more.

Your robot Onyx is awesome!