What Micro-Controller Would You Use to Teach With?
Rukie asks: "I'm looking into starting some sort of robotics class for my high school, which severely lacks any sort of technological classes. I am now wondering what micro-controllers are best for an educational environment. I definitely want something more advanced than the Legos, but something that won't fly over people's heads. Are there cheap, scaleable micro-controllers for learning in a classroom or at home? I'm curious how my fellow readers have hacked up toys to make their own robotics at minimal cost."
Check out http://www.parallax.com/ and their Basic Stamp series. They have a wide range or processors and great educational programs based on them. The also have robots and robotics based programs based upon the Basic Stamp.
AVR, and WinAVR (AVR-GCC) for the win.
I like the Brainstem from Acroname. I haven't done any big projects with one, but I've played with a couple and they definitely hit the spot in terms of easeability, powerfulity and economicalness. I've used the SV203 from Pontech in the past and it's a solid & simple board. Great if you're keeping the board tethered to a computer and not doing any actual processing on board. Brainstem gives you a little/lot more high level power.
I would go for PIC: they are cheap, programmers are available everywere, free assembler/IDE and net is full of information. Yes they are stupid small ram devices, but also very easy to use.
The Make magazine featured the leafproject recently which uses a custom board [2] for their "open source robot using artificial intelligence and vision"
The 6808 micro-controller (long version of the name is M9S08GB60) would be excellent for teaching a class on robotics. As its been around since the dawn of time, there's a lot of support readily available for it. Complete, detailed reference manuals are freely available, Freescale will even ship printed copies to you for free. Compilers are available that allow you to program in your choice of assembly, C, or C+. The "M68DEMO908GB60" demo board is available from many online retailers for around $50 which makes it easier to use the microcontroller for prototyping as well as experimentation and class labs.
f
What lends the 6808 microcontroller is its Pulse-Width-Modulation components (it has 2 modules, one with 5 channels and the other with 3 channels and all channels can be set up for either incoming our outgoing). In addition to all that it runs up to 40MHz without cooling and includes 4K of RAM and 60K of ROM all on-die, so no extra chips for those. It has more power than you could ever hope to use in a class-room.
A good example project is available here: http://home.comcast.net/~starwreck/FinalReport.pd
... and in the DRM, bind them.
The Microchip PICmicro is a very good choice. Try the PIC16F84 - the chip is cheap, programmers that connect to a PC parallel port are simple to build, a chip can be electronically erased and reprogrammed hundreds of times.
The assembly language is also very simple. There are only thirty-five instructions and two addressing modes. It's also very easy to calculate instruction timing (for delay loops, etc.). I learned to program those things when I was at high school.
Things like the BASIC stamp are less than helpful. You aren't close enough to the metal. If you don't like the PICmicro, an AVR chip would be my second choice.
As much as I love the open source Arduino board for my own personal use, and even though the basic STAMP is raher expensive (even with the education discount), Parallax has an extremely thourough set of documentation that is perfect for an educational environment. They have a fee book available for download called "What is a Microcontroller" that should fit all your needs. It contains a series of predesigned lessons that assume no technical experience for your students. All your lesson plans are done for you.
I don't know, I think he is going more for a "fun" angle. Lets face it, without even the basics of electronics, going to digital circuits is tricky at best.
That being said, I would recommend a Basic Stamp from http://www.parallax.com/. While their chips are not the fastest, cheapest, or fully featured they offer EXCLELENT learning tools, books as well as a wealth of free code. There are plenty of robot kits you can get and easy to plug in designs. You can quite possibly even get a bulk discount for a school.
To be honest, I would rather have a class where the first half of the semester is designing AND building your radio. (Preferably FM) I learned microcontrollers first before I learned anything about analog components and a radio is the best way to teach that.
PIC is a braindead horror show architecture from the 70s, and Microchip's microcontrollers are the hardware equivalent of spaghetti code, built with kludge upon kludge.
Go with a simple yet elegant architecture, as it will teach good design practice. With PICs these kids will spend a lot of their time writing tricks to compensate for the hardware's flaws, and may get the impression that programming amounts to writing "clever", unmaintainable code.
Avoid the frustration and go with the AVR lineup. If you want to showcase a traditional design, introduce them to the 8051 (but don't necessarily have them in the lab). If you need more features, use the Freescale HCS12 with the GCC toolchain (coding in assembly for the HCS12 isn't practical, since it essentially implements the old fashioned, register starved 68HC11 instruction set). And if you want performance for higher level applications (which may not be the case), go with an ARM part.
There are some robotics groups out there already. FIRST http://usfirst.org/ Robotics has been around for years. However, the cost is a bit steep, so a sponsor is needed. The team I work with was able to get a sponsor after one year of searching. The robots are pretty simple, you are handed a kit for electronics, and a base chassis, from there, you can add on accelleromters, gyroscopes, cameras, and other sensors to make things more complicated. Everything is custom made, so it is a great way to learn how to engineer things.
I'd go with Atmel AVRs.
They are widely used, well documented and well supported.
There are a large range of chips with a consistent instruction set, so they can learn on a simple eight pin 1-Kbyte chip and then apply that knowledge the next day on a large 32-pin 16-Kbyte device.
They are extensively used in industry so students can feel like they are learning something practical.
I'm personally using this : http://www.robominds.com/ There are good available libs for robotics purpose : http://www.motorobots.org/ I also saw others recommending the parallax which might fit better in your budget
This is basically what the Picaxe microcontroller series was made for. Their website is at http://www.picaxe.co.uk/ and a reseller for them in the united states is located at www.phanderson.com. It is basically a PIC microcontroller (they use various models, from 8-pins to 40, so the scalability factor is there), with a custom ROM flashed onto them that has a BASIC interpreter. Think of a Parallax BASIC-STAMP, only all in one chip, and the chips range from $3-10 for most of them, so its almost as cheap as you can get it. Additionally, the BASIC software development environment is free to download, has no limitations, and is geared towards an academic setting (it even includes the ability to draw out simple logic circuits and have it convert them to basic code). Also, THEY DO NOT REQUIRE A SEPARATE PROGRAMMER. To program a PIC normally, you would need a ~$50-100 programmer for each student, but these hook directly up to the serial port (a cable is just 3 wires coming out of a DB9 connector), so each student can easily reprogram their own, or even do it from home. They're incredibly versatile (check out the forum at their main site), and perfectly suited to academic use, for both younger and older students
I'm perfect in every way, except for my humility.
Anybody even remotely interested in serious robotics at a high school level will have already completed Algebra in 8th grade. Everyone else is to busy talking about/having sex to care.
Extracurricular groups sound great, except no one ever has time for them. I cannot spend my time doing an extracurricular activity when I have 4 hours of homework each night. Again students interested in robotics will have significant homework each day. I agree with that, except that AP Physics C covers a great deal of the basics of circuits and EM.
AP Physics C should be offered at ALL high schools, if it is not then he shouldn't be trying to add another elective.
Teaching how a computer works is a GREAT idea. Frankly no one really gets it.
Internet resources for figuring out how computers work is great and all, but a real classroom experience cannot be beaten here.
As a side note:
Most people have absolutely no idea how a computer works. I don't care. No they don't need to know. No I'm not going to tell them they are stupid. I don't know how to do a French manicure, does that mean I'm stupid? didn't think so
If you want to start off with C, I recommend the AVR Butterfly.
You can get an AVR Butterfly http://www.atmel.com/products/AVR/butterfly/ for $20 at digikey... it comes with an LCD screen, a five way joystick-like button, a speaker, some sensors, RS232 level converters, and an ATMega processor. To program it, you just wire up an RS232 plug to the board and download the C/Assembly compiler from their web site. GNU tools for this are also available. No specialized programmer required.
The advantage of a board like this is it's quick. You don't need to wire up a micro with an oscillator and some output devices. You don't need a special programmer. You don't need to buy a C compiler. It's all there, and $20 is fairly cheap. If the kids like 'em, they can buy their own for home.
If you want to start off with something easier, like BASIC, the BASIC stamp seems like the way to go.
Good luck!
I think you're students will become extremelly enthusiastic towards robotics if they get involved in a program like FIRST robotics. Check out regional event this year and talk to some of the students, a huge majority of them will tell you that because of FIRST they intend to persue a carrer in engineering.
Check what people are working on at chiefdelphi, the environment there is very much like what the students are like at their schools. They ask questions, chat with each other, have fun, and mentors offer guidance for some of the tougher problems.
I'd recommend Atmel AVRs without a moment's hesitation.
The PIC and 8051 grew from architectures that were considered spartan and stripped to the bone a generation ago, and got a foothold only because (compared the "real" CPUs) they were somewhat affordable. They've matured, of course... but people who start on PICs almost inevitably get saddled with all the legacy baggage. In contrast, people whose first exposure is to Atmel or Motorola take one look at the PIC's legacy stuff, say "eeeewwww!", skip the first 20 chapters of the book, and go right to the good (modern) stuff.
The Motorola/Freescale MCUs are powerful, but they're NOT for newbies.
The nice thing about AVRs is that they're fairly robust and hard to permanently kill. I've abused AVRs pretty badly, and I've NEVER had one permanently die on me. There were a few I'd thought were dead, but ultimately they were all resurrected via high-voltage programming or by supplying an external clock signal to them. I've grossly exceeded the i/o pins' current-draw capabilities, connected power backwards, created pin-to-pin shorts, and still lived to tell about it. From what I've read, other platforms aren't quite as forgiving and wantonly abusable as AVRs. I know people who've driven 5v-relays straight from AVR i/o pins.
AVRs also have a great resource -- avrfreaks.net
AVR development tools are fairly cheap. An ISP-only programmer costs around $30-35. The Dragon costs $50, but adds support for high-voltage programming (handy for fixing messed up fusebits and reviving chips that otherwise appear to be dead) and Debugwire (think of it as single-wire JTAG for debugging). Unless you actually care about compatibility with Atmel's old chips, I'd recommend a Dragon over the STK500, if only for the Dragon's Debugwire capabilities.
AVR Studio is a free IDE (Windows only, though... but I think there's a Linux alternative) that natively supports assembly, but also integrates seamlessly with WinAVR for C/C99/C++ (of the 3, C99 is the one I find the most useful... it basically gives you the linguistic niceties of C++, like parametric polymorphism, without the huge libraries and resource requirements normally required for full-blown C++).
One major tip: if you want to use C (or eventually C99 or C++), buy John Pardue's book ("C Programming for Microcontrollers) and a Butterfly. He sells it directly from his website (smileymicros.com) for less than it costs from Amazon, and you can pick up the relevant hardware from him for less than you'd spend buying it all from Digikey. No, it's not the greatest book on C programming ever written... but it's the single best book you can get for learning C as it applies to AVR microcontrollers. Remember, 99% of C is learning how to use its libraries. Let's just say that time spent learning to use stdio in a generic C programming book isn't going to do much for your AVR programming skills...
Architecturally, AVRs are fairly well-behaved. The biggest problem I've had is the fact that they're SO well-behaved, it's easy to get a false sense of security and overlook details that are different between them. Unfortunately, Atmel's datasheets seem to have the same general editorial philosophy as the first O'Reilly books (say it once, never repeat anything, and bury important details in the middle of otherwise nondescript paragraphs on page 183, without so much as a gray box or sidebar to call attention to it). However, everyone at avrfreaks.net is painfully aware of those documentation shortcomings, and when somebody gets snared by one of them, someone else usually notices within 5 minutes, sighs, yawns, and politely points them in the right direction. It's exceptionally rare for anyone to get flamed.
As far as robots go, AVRs definitely seem to be just about everyone's favorite 8-bit processor. 6809s are popular with some more advanced users (though many of them freely admit that they aren't quite sure why they used a 6809 instead of an AVR), and the 68332 is a longtime favorite at the high en
That's no lightweight system, and it comes with a serious set of development tools who's big brother version is used in the real world.
p p/14149.html
Looks like they offer an educational version too:
http://www.arm.com/markets/embedded_solutions/arm
Bavarian Purity Law of Rice Krispie Squares: Rice Krispies, Marshmallows, Butter, Vanilla.
"Most of these kids you'll teach probably wont have a mastery of algebra, let alone have the mental concept of complex systems like robotics."
I disagree (not with the algebra bit), they are teenagers and will see leggo as a kids toy (what teenager want's to be mentally defeated by a "toy", better to just ridicule it from day one). A well designed project that results in a simple robot that reacts to light and/or sound will encourage some of them to find out more by themselves. That's what HS is supposed to be about, giving you a basic education and a taste of things that might interest you later.
As an example when one of my kids was in HS he came home from his first computer class with one sheet of paper and said to me "they reckon this is a years worth of work". I read the project he had been given, it was basically the requirements for a simple database with each stage of the project adding more complexity. I gave it back and said that if he could do that in a year and pass he could claim to know something about programming and databases. He did a great job and at the same time he setup and ran his own BB on an old PC (circa-1995). My youngest kids HS maths teacher used a spreadsheet to teach basic algebra (when a lot of teachers were still avoiding the new fangled "computer room"). Both were fucking brilliant ideas for teaching the subject at hand and the kids were actually interested in what they were doing.
As for TFA, I won't say anything about electronic because I know just enough to get laughed at on slashdot, however as some other posters have suggested, use a popular language, maybe "template" the source and let them fill in the blanks to flatten the learning curve a bit.
Not sure what the budjet is, but perhaps each kid could build a simple "robotic cricket" and let them all loose in the gym at the end of the course.
And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
100% agree. Microchip's products are really great as they do a range of devices from cheap and simple devices up to quite complex ones. They are fun to use and quick to learn - sure, in the real world, high level languages like Java are desired by employers, but these are so abstract that you don't get a feel for the actual workings of the computer. Its vital that people understand how the actual machine works, and there's nothing like a bit of assembler and some flashing LEDs and push buttons to do this.
If you really wanna dive into AVR programming, you could also check out the Arduino.
It uses an AVR for the controller and doesn't require a PIC programmer, connects over USB to the computer, has support for Windows, Linux and OSX, and comes ready for working when you get it. The only part that is kinda limiting to people unfamiliar with programming is that it uses C++ as the language, but has a very simple instruction set, so the learning curve may be slightly steep for beginner programmers.
...spike
Ewwwwww, coconut...
First off, I'd dump any mention of 68hc08, 68hc11, 8051, z80, etc. There are more of those doing more than you would ever believe out there in the world, but it's like suggesting that someone learn GUI programming by giving them an 8086 with dual floppy drives and 256K of memory, and a copy of Windows 1.0. Time has passed them by; learning the quirks and tricks necessary to get them running happily is more an exercise in dedication in the modern world than any way to learn modern processing./ edu_base.php LPC2148 Education board on my desk at the moment. It's a bit pricey at 99 EU, but without all the motors, LCD and LED displays you can get the basic board http://www.embeddedartists.com/products/boards/lpc 2148.php a bit cheaper.
/frank
As a professional embedded programmer, I'm quite surprised by the number of recommendations for the AVR in this thread. I've never used it, but I may have to look into it. Quite a rabid following there.
I would recommend getting into ARM. In the professional world, they have pretty much taken over the middle ground of 30-200 MHz 32-bit processors, especially in the custom-chip arena.
With the NXP (nee Philips) LPC versions, you can have a 256KB FLASH/32KB RAM device with a USB port and a million on-board peripherals for the cost of a $10 chip (Digi-key quantity 1), a PCB, and a crystal. Pre-built development boards are a dime a dozen; I'm partial to the http://www.embeddedartists.com/ boards, and happen to have their http://www.embeddedartists.com/products/education
ARMS are extremely well supported by the excellent GNUARM toolset (http://www.gnuarm.com/), giving you a completely free C/C++/Assembly toolset, and there are a huge number of sample programs available from Embedded Artists, Keil, Olimex, etc., for doing almost anything you might want.
Why teach them about code pages, completely screwey function call mechanics, 256 byte jumps, limited capability C libraries, etc., when they could be learning about putting their name on the display, spinning a motor, playing a tune, and shipping data up to a PC over USB?
And the worms ate into his brain.