Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Microcontroller question

Status
Not open for further replies.

unix60959

New Member
Hey, everyone. I'm studying to be an electrical and computer engineer. I've been through DC and AC circuit analysis and a semiconductors class so far. I've also taken C++ programming. I also know other languages that are self taught. Anyway, I want to get into microcontrollers mainly to control LEDs and make those neat designs and shapes and what have you. The only problem is I'm not sure what kind of microcontroller to get. I want something that's easy and beginner friendly but not that limiting. In other words when I want to do more complex things I don't want to have to buy a new microcontroller.

Thanks,

Unix60959
 
I'm biased toward the Arduino, for a number of reasons:

1. Fairly inexpensive - and the bare chips are really cheap.
2. Easy to set up and program (all you need is a USB cable - no special ISP programmer required)
3. Software (open-source and free - for all platforms - Windows, Mac, Linux)
4. Awesome and friendly user forum
5. Tons of info and users across the globe

Some might say that it is too "beginnerish" - but that's what you want! But here's the thing: Once you get past the beginner stage, if you want - you can just transition to bog-standard AVR coding in C/C++ and/or assembler (using gcc for AVR, etc - all open source). You can use the Arduino board as what it is (a carrier board for the microcontroller) - the ICSP headers are all there (in fact, you can easily turn an Arduino into an ISP if you want - there's a sketch for it). There are a ton of options for supported microcontrollers in the Atmel range - the common ones being the ATMega8/168/328/644/1280/2560 - a few ATTiny devices are supported as well by the Arduino software (ATTiny84/85 mainly).

All the Arduino software is, is a library wrapper of common functions, plus a pre-parser that takes your code, and attaches some header files, and a small "loop" construct, then runs the mess thru avr-gcc to compile it.

Even further down the road, you could transition to ARM devices and such, and take your learned skills with you - if you needed more horsepower (though right now, the Arduino system has not been ported to the ARM platform); ARM has plenty of open-source and gcc support (heck, there's even an open-source ARM core out there).

Now - if your goal is commercial production of widgets that would use microcontrollers - I -would not- reccommend Atmel's devices; they are much more expensive than Microchip's offerings (in the commercial realm of things - in one's and two's, depending on the features and such needed, the difference between Microchip and Atmel is not that great; certainly not enough to bother with).

Something else to keep in mind - recently, there's been a push by Microchip (?) to make an "Arduino-like" PIC development platform (PicKit?); it's for sale, has it's own dev software system based on the Arduino stuff (it looks fairly the same), and is cross platform as well; Microchip's offerings have been "spotty" in the past when it came to developing for the chips on anything other than Windows (there was only support for some families, not all) - this hasn't really changed, but they seem to be making steps toward changing this (maybe).

As far as Parallax and their offerings: Their stuff is good, but non-Windows support for development is fairly low (I think there is a few open-source projects around for the Propeller, IIRC) - I think their product line is great (though not cheap), but if you are using anything other than Windows, do your research carefully.

Hope this helps! :)
 
I say go with PIC microcontrollers from Microchip Inc. For $50USD you can get the PICKit 2 Debug Express, which comes with the PICKit 2 USB programmer and a 44 pin development board with a 16F887 44 pin PIC on the board. The board has 8 LEDs on PORTD of the chip, a push button switch, and a trimmer potentiometer that is on one of the AD converter pins. There are solder pads on every I/O line of the chip along with the 6 pin programming header to interface the PICKit 2 programmer/debugger.

Microchip's support is also second to none. The PIC16F887 only has 35 ASM instructions to learn, and if you wish to go the C route, Microchip has the Hitech C compiler for 10/12/16F PICs. The Debug Express kit comes with Microchip's Integrated Development Environment, MPLAB IDE (which is also a free download right from their site) where you can write/compile your code, simulate the code, and do in circuit debugging where you can single step through your code while the PIC itself does the instruction executing (or you can use MPLAB SIM in MPLAB IDE to simulate the PIC).

Among the software suite that comes with Debug Express you also have a logic tool that turns the PICKit 2 and your PC into a logic analyzer where you can monitor and analyze digital logic signals in real time on your PC.

Seriously...go with the PICs. You won't be disappointed.
 
Depending on your finances and level of commitment, I'd suggest the Microchip ICD3. It's an expensive bird, but it's a very fast programmer, supports all Microchip products, and all debug capabilities.

In Circuit Debug is much more functionality than simple In Circuit Programming. PicKit 3 does use ICD, but I'm not sure how it measures up. Not all chips support ICD, and some have notably better debug capabilities than others.

Some people assume ICD is not something beginners need to worry about getting into early on, but the fact is, you'll learn what you're doing many times faster by using ICD because you can see what's going wrong in your code instead of struggling with messages sent through an LCD or serial port. Those are of much more limited utility, and the basic problem is, when things go wrong like getting stuck in an endless loop, the code will be unable to send debugging messages.
 
I'm biased to the PIC's too but because I'm an assembler programmer and PICs were already being used in the environment I was programming for.
But there is good Basic, C and even Pascal support for them.

The PICAXE chips are also quite popular with high level programmers.

The Arduinos have become quite popular so you might find they will suit your purposes.

There are a few other options like the AVR series chips.
I'd find the hardware that suits your needs first and then look to see if the C compiler for it works for you.
 
The Arduinos have become quite popular so you might find they will suit your purposes.

There are a few other options like the AVR series chips.

Just to clarify this further, the Arduino is an AVR - the Arduino is NOT a processor, it's basically a PCB based development system containing an AVR.

People keep mentioning the Arduino as if it's something different to an AVR, and that's just confusing everyone.
 
Just to clarify this further, the Arduino is an AVR - the Arduino is NOT a processor, it's basically a PCB based development system containing an AVR.

People keep mentioning the Arduino as if it's something different to an AVR, and that's just confusing everyone.

I don't think I made this point clear enough in my post; there is definitely some confusion going on.

What is an "Arduino"? One person on the Arduino forums said that the Arduino was the community; that person is probably more correct than they know. Ultimately, it's a term that encompasses an entire system or "way" of doing things. It's a hardware and software platform that has brought together a diverse community of individuals that has made microcontrollers more accessible and easier to use than ever before (IMHO). For some reason, this gets more than a few people "up in arms".

By that I mean that some think of the "Arduino" as something of a "toy", not meant to be used for "real work" - which couldn't be further from the truth.

At the hardware level, the Arduino system (generally) is:

1. An Atmel (AVR) ATMega8/168/328/644/1280/2560 microcontroller (DIP/SMT)
2. For the DIP IC versions of the ATMega, a custom carrier board with breakout headers
3. For SMT versions, the board serves the same function as in (2), but the processor isn't removable
4. The carrier board utilize a standard breakout header layout to facilitate the design and building of add-on boards which can be stacked on top of the base Arduino hardware, called "shields"
5. An on-board programming interface (typically a USB port and ICSP pins are available)

5a. On older versions, as well as some homebrew versions, an RS-232 serial port (and associated level conversion hardware) could be used
5b. Some homebrew and third-party carrier boards leave off the USB interface, but provide pins for using a level conversion USB cable or similar interface
5c. In the case of the Uno - an ATMega8u2 on the "carrier board" replaces the original FTDI chipset used for the USB interface; this microcontroller has ICSP pads available, and is reprogrammable itself.

At the software level, the Arduino system (generally) is:

1. An open-source IDE and development environment based on Processing and Wiring (the Arduino IDE shares roots with both), which runs on Windows, Macs, and Linux (Java based)
2. A pre-processor and a main library integrated with the IDE to provide common and easily used methods to access the microcontroller's functions in a defined manner

2a. The pre-processor builds a "wrapper" around the library and setup of code, eliminating a step which will ultimately be the same for nearly all users (and eliminating certain setup errors newbies might have)
2b. The library methods and their usage don't change from one ATMega microcontroller to the next (so your code is generally fairly portable between all members of the "family")
2c. By both (2a) and (2b), the use is left with two easy to define functions in their code - setup() and loop() - these are called by main(), which the user doesn't see

4. An open-source compiler and interface for the microcontroller (avr-gcc and avrdude)
5. A piece of firmware resident on the microcontroller called a "bootloader", which interfaces with avrdude and allows the transfer of the binary compiled file from avr-gcc to the ATMega microcontroller's flash memory for execution.

At the community level, the Arduino system (generally) is a collection of a diverse, international group of individuals of all ages and education levels - hobbyists, artists, engineers, kids - who share a love for an easy-to-use and accessible microcontroller system that can grow in capability as needs change, that has software (and a skillset) that can be easily migrated up or down the family of microcontrollers supported, while providing a system, for those with the need and skills - that is open-ended enough to allow for a full-on AVR development system (without using any of the Arduino system software), if and as needed.

Some look at the Arduino system as "training wheels for microcontrollers" - I personally don't; while I wouldn't recommend the usage of the standard IDE for serious development beyond the prototyping stage (due to certain limitations it has), the system as a whole feels more to me like a RAD (rapid application development) environment that can allow a user to get their application built with a minimum of fuss. It may not be the most efficient code, but it generally will do what is needed, and it can be developed quickly, to the skill level of the person implementing it.

If the Arduino's microcontroller needs to be in communication with a host PC, the user can opt to use either their own software (as long as it can use an on-board serial port - actual, or virtual USB), or they can use Processing/Wiring, which can act as a multiplatform, somewhat "RAD" toolkit with similar ease-of-use as the Arduino software system.

Interestingly, as I was writing this, I remembered that there was a similar "animosity" from the software development world to Microsoft's Visual Basic platform (pre-.NET days - not sure now, as I am not involved in VB.NET, nor other Microsoft development platforms); there was a similar level of disdain from programmers that VB was a toy - yet all over the world tons of VB applications were built and sold, that helped to run businesses and other systems (and still do!) - simply because it was a very easily accessible language for beginners and experts alike, with a fairly large community of users, that just let you get what needed to do done, and didn't get in your way (much). It's not quite the same as what is going on with the Arduino system, but a similar level of "disdain" was there from "outsiders".

Now, VB was a different beast; it wasn't open-source, and it didn't offer the same kind of "upgrade your skills" path that the Arduino system allows for (though with Microsoft going with .NET, that is changing, I think - now if only they'd make it open-source - I guess Mono counts a little).

I am not sure why this attitude is there (and it seems like something across the tech world, to an extent); I am sure back in the day there were people who pooh-pooh'd integrated circuits, and the developers who used them in their designs rather than using discreet components "like real engineers should". There's this great reluctance toward "code reuse" - whether that "code" is actual software, or electronic "modules" (such as ICs, or Arduino systems), to make development (software or hardware) more accessible, quicker, cheaper, and easier. Indeed, I seem to recall a similar discussion (from the Nuts and Volts pages) back when hobbyists started to really get into microcontrollers (mainly PIC and 8051) in the early 1990s, when they started to become cheaper and more accessible to the hobbyist. There was discussion as to why you would put a microcontroller into something when you could easily build the same functionality with a handful of logic ICs (or PALs, etc).

We now know where that argument ended up: On the rather large pile of similar arguments about modularity and re-use that has been building since a stone was tied to a stick.

Why do we go through this with each and every similar "advance"? Why don't hobbyists, engineers, etc - who have experience - jump at the chance to use these new tools, instead of arguing about them? It always ends up going in one direction anyhow; probably in 10 years or less, something similar to the "Arduino-way" will be standard (just as using microcontrollers and code is the "standard", rather than discrete logic or similar was before). I surmise that it is likely, at some level, a form of "arrogance" - the (mostly male-oriented, I might add) attitude of "well, it took me a long time to get this experience, and sonny, you have to do the same before I will consider you my equal" - your basic "macho" posturing, from a "geek" level, I suppose...

---

Now - on a different note: On my original post, I mentioned that the Arduino platform wasn't available for the ARM series - this is inccorrect; there are implementations - for example:

https://leaflabs.com/devices/maple/

**broken link removed**
https://antipastohw.blogspot.com/2009/08/introducing-illuminato-x-machina.html
https://antipastohw.pbworks.com/w/page/26652347/Illuminato X Machina

Both of these products are "Arduino"-like; the first (Maple) being closer to Arduino in spirit than the second (the Illuminato is a device unto itself - think of it as something like a node that can be used standalone, but is more designed as a singular piece for an ARM-based multi-processor, parallel processing system, with an open-source development environment, etc).

In short, though - if you start out with a basic Arduino and skillset, the skills you acquire along the way can take you very far indeed...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top