Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: roboninja93 on July 26, 2013, 12:22:49 PM

Title: microprocessor choice
Post by: roboninja93 on July 26, 2013, 12:22:49 PM
Hello all,
I have been using avr microcontollers (atmega 8,32,128) for sometime.
I want to start with microprocessors. I haven't worked with them before.
Which low cost microprocessor should i start with?
Title: Re: microprocessor choice
Post by: jwatte on July 26, 2013, 12:53:26 PM
That depends. What do you want them to do? :-)

"Microprocessor" is a term that's become almost entirely meaningless. Even the biggest supercomputers today are built out of "microprocessors" where those processors have over 1,000 pins each.

I think it would be helpful to understand what you believe the difference between "microcontrollers" and "microprocessors" actually is?
For example, one difference might be word size -- microcontrollers are 8-16 bit, and microprocessors are 32-64 bit. Although the "Z80" and the "6502" (8-bit architectures) were called "microprocessors" at the time, as was the 8086 and 8088 that grew into the chips that now power every big computing device in the world.
Another difference may be program storage -- maybe "controllers" have internal flash memory for programs, whereas "processors" use external memory to store executable code?
Or is it the level of integrated peripherals? A microcontroller typically comes with a number of digital I/O, timers, ADCs, serial busses, etc. A microprocessor often doesn't have those built in, but instead uses separate external circuits for peripherals.
Or is it the CPU speed? Microcontrollers often run in the 1 MHz to 32 MHz range, and typical embedded microprocessors run in the 25 MHz to 120 MHz range, wheras "real computing" microprocessors go up to 4 GHz.
Or is it language choise? Microcontrollers typically use assembly and C, with a small amount of C++, as the available memory limits how much you can do. Microprocessors are typically programmed in C++, or more feature-rich languages like C#, Java, Python, etc.

Also, what does "work with" mean? Develop hardware boards that mount these chips? Programming boards that already exist? Something else?

I'm going to make some assumptions about what you actually want to do. You actually want to develop for systems that run a kernel, with memory protection and virtual memory, and external program storage. You also want to develop for systems with significantly more RAM and compute resources than what's available in microcontrollers. You are OK with a smaller amount of built-in peripherals. You do not want to build your own PCBs to support the microprocessors.

The easiest thing to do is to simply develop for your existing desktop or laptop computer. Either develop for Windows using Microsoft Visual Studio (there's a free "express" version) or install Linux and use a text editor (vim, emacs) and the gcc/g++ compiler and make build system. Almost all desktop and laptop computers use the "intel x86" system architecture and instruction set, at this point evolved to a 64-bit system called "x64."

If that's not what you want, then perhaps look at the Raspberry Pi, or the BeagleBone Black. Both of these systems have approximately the same compute power (700-1000 MHz 32-bit ARM CPU) and storage (SDcard, 512 MB or so of RAM) and they both run Linux. (Again, vim or emacs; gcc/g++; make; would be your typical environment.) The RPi and BBB do have some digital I/O pins and serial busses (I2C etc) built in, so they are easier to integrate to other electronics than your typical PC hardware.

Finally, if you don't want to move all the way up to a "real" OS, but still want more power than 8-bit microcontrollers can give you, then perhaps the STM Discovery F4 board would be for you? Or the TI Stellaris Launchpad? Both of these cost about $10-$15 per board, and you can download development tools from the respective companies (mostly Windows based.) These both use a slimmed-down ARM microprocessor based on the "Cortex-M4" core. This means they run mostly in a 16/32-bit mixed mode called "thumb" although all their registers are still 32-bit. Program storage is typically 128 kB or so, and built-into the CPU; clock rates are in the 72-120 MHz range.
Title: Re: microprocessor choice
Post by: johnwarfin on July 28, 2013, 10:22:57 AM
technically the difference is mcu have io and memory built in whereas uP dont. uP are virtually non-existant in the hobby area these days and relegated to desktop/notebook applications. mcu are everywhere from wristwatch to high performance singe board computers like beagle and raspberry.

generally the next step up for most after avr is 32 bit arm or stm. cheaper and orders of magnitude more powerful but development tools relatively nasty by comparison.