Which microcontroller to learn?

In summary, as a mechanical engineering student interested in designing underwater ROVs and AUVs, the use of microcontrollers in many systems and the variety of microcontroller families and programming languages can be confusing. After researching, it is recommended to start with a medium-to-high performance uC such as the PIC or Renasas uCs, and to invest in a Starter Kit for hands-on learning. The use of C and assembly language is popular and there are various free software packages available for programming. Using a development board may also be beneficial.
  • #1
BillBLack
As a mechanical engineering student who is interested in designing and constructing underwater ROVs and AUVs, I have found that many systems use microcontrollers. I have also found that the number of different microcontroller families and their various programming languages is, to me, confusing.
After attempting to research the different types, I find that I am getting more confused rather than less. Basic stamps, 8051s, PICs, PICStix, Rabbits, Atoms...as you all know, I am sure, the list is near endless.
In order to make a decision about what type of microcontroller to start with, I have decided to ask the experts here on the Physics Forum.
Please give me some insight on where an electronics novice < I CAN breadboard and construct a circuit given a schematic> should start learning to implement and program microcontrollers.
Thanks in advance,
 
Engineering news on Phys.org
  • #2
Great question, Bill. But your footer already says that. :biggrin:

You know, the uC of choice changes every couple of years, and is fairly dependent on what your target application is. Plus, the trend is to try to do as much coding in C as possible, since that is portable across the uC platforms, and only use platform-specific assembly code where it's absolutely needed. Also, most uCs have inexpensive eval boards with example IO circuitry on them, and that's usually a good investment for exploring the capabilities and tool chain for each uC. Having said that, here are a few thoughts:

-- Atmel Tiny 11/12/13 -- these are very low cost uCs with minimal feature sets. But, very popular in low-function, very low cost applications. If you're interested in designing consumer key fobs, etc., it would be good to play with this family.

-- PICs from MicroChip -- Great family with a wide range of cost/features available. This is a good family to learn and buy a tool chain for.

-- 8051 -- Classic uC architecture, and good to learn.

-- HC11 -- ditto.

-- Renesas uCs -- Higher end, but lots of bang for the buck

My best advice to you right now would be for you to decide what class of devices interests you the most (low-cost, medium-performance, or high-performance), and get a Starter Kit for a good uC that fits that category. Then play some and experiment with some demo apps to figure out where the C/Assy boundary is, and write some combined C/Assy code to do something. That will get you 80% of the way to being a productive engineer with uCs.

For example, if you're interested in medium-performance, medium-cost uCs, and maxing out the performance/price ratio, then get a PIC uC Starter Kit, and code up some audio music synth software. The higher level control software can be in C, but the lower level interrupt-driven real-time audio routines will likely be in assembly. One of my consulting projects many years ago was shoe-horning EEG DSP plus music generation into an 8051 for a personal biofeedback machine. I had that sucker running at about 90% assembly language utilization to keep up with all the interrupts by the end of the project! -Mike-


EDIT -- I just re-read your post, and for underwater ROVs and AUVs, you'll want medium-to-high performance uCs. So focus on the higher-end PICs and Renasas uCs in your search.
 
Last edited:
  • #3
Thanks for the reply, Mike!
I believe that I'll go with PICs since there is so much documentation available on the Web.
So much to learn..so little time.
Any additional input would be welcome.
:)
 
  • #4
As for me , the only uController i have ever programmed is a PIC..

You would need a circuit called a programmer to put your program into the uC..
On your PC you then download the various free software packages , to run with the programmer..
the programmer connects to the PC in one of three ways..

there are
serial Programmers (not Recommended)
parallel port programmers (Recomended but are being replaced by USB)
USB programmers ( i would like one myself .lol.)

i have sucessfully programmed a 16F628 and 16F88 ,if you decide to go this route don't use the 16F84, or the 16F84A as they are obsolete ..

Although i havnt used a silicon labs Chip yet ..they are an incredable uC..packed with features and are an 8051 derivitive, but with a lot more features...
http://www.silabs.com/tgwWebApp/app...fpb=true&_pageLabel=interactiveGuide&col=adc1
 
  • #5
O.K. USB programmer...check
Now...since there are also roughly 25 different compilers using roughly 6 different programming languages...Anyone have some insight whether to use C, C++,C,BASCOM,PICBasic, PICBasic Pro, Java, Fortran,or just talk to it with a lilting French accent?

Also...I see some really cool development boards available for PIC from MeLabs and others. Is there an advantage to using one of these?

OK..that's all the newbie questions for today. Thanks in advance for the help!
 
  • #6
BillBLack said:
O.K. USB programmer...check
Now...since there are also roughly 25 different compilers using roughly 6 different programming languages...Anyone have some insight whether to use C, C++,C,BASCOM,PICBasic, PICBasic Pro, Java, Fortran,or just talk to it with a lilting French accent?

Also...I see some really cool development boards available for PIC from MeLabs and others. Is there an advantage to using one of these?

OK..that's all the newbie questions for today. Thanks in advance for the help!
LoL I didnt see Assembly in that list !
I suppose whatever language you are comfortable with , use that..
there are free versions of C , PIC basic, lol no fortran or lilting French accents ..
once you write your program ( in assembly is all i can speak for) , you assemble it..Mpasm is free from microchip..it comes with the MPlab...
the assembler creates a Hex File ( similar to Intel Hex )
the Programmer then takes the Hex file and puts your program in the PIC..
Also...I see some really cool development boards available for PIC from MeLabs and others. Is there an advantage to using one of these?
dont know , never used one...
 
  • #7
Assssssssssssssssembly??
The very typing of the word gives me chills and a vague feeling of syntax induced confusion. Are my fears unwarranted? All I have ever done is some good ol' BASIC and a semester of Visual Basic.
Input please?
 
  • #8
the syntax is easy ,a typical line may or may not have a label in the leftmost column, tab over insert your opcode and operand..
comments are designated with a ;
the pic has a reduced instruction set so for the majority of them there are only 35 instructions to learn..
Code:
label     opcode,operand


           movlw,d'255'   ;W is the working register almost everything must go through W
           movwf,Var1     ; loads Var1 with 255
Loop     decfsc,Var1     ;this decrements Var1 , till it is zero, then exits loop
           goto Loop
if your eyes are glazed over at this point , then maybe a basic compiler for the pic is right for you...
 
  • #9
BillBLack said:
Assssssssssssssssembly??
The very typing of the word gives me chills and a vague feeling of syntax induced confusion. Are my fears unwarranted? All I have ever done is some good ol' BASIC and a semester of Visual Basic.
Input please?
As I mentioned, you will generally write in a mix of C and Assembly. C for portability and readability, and Assembly where you need the extra speed or need to minimize the code footprint (fit the code into as small a memory space as possible). You won't generally use C++ for uC coding, unless you're up in the Renesas range of higher-end uCs.

If all you've used in the past is Basic, I would strongly recommend that you take a C class or do self-study. Get a copy of "The C Programming Language" by Kernighan and Ritche, 2nd edition or higher if there's a newer one. You can use the Microsoft Visual Studio tools to compile C, or you can download a free compiler like Pacific C off the Internet for your PC. To target a uC, you'll usually need to buy a toolset specifically for that uC from the uC manufacturer or an associated 3rd party. I first learned Fortran and Pascal in college back in the late 70's, but when I got out in the real world, most everybody was writing in C. So I taught myself C with the K&R book, and it was pretty easy to pick up. Especially since I had real stuff that I needed to get done soon -- a good motivator for learning!

And don't worry about Assembly coding. It's pretty natural and intuitive. You just have to be a bit more careful to set some rules for yourself and follow them, because the Assembler is not going to do as much error checking as a C compiler would.

I think the demo boards are a great way to get up and running. Try to get one with some I/O features on it that will make it easier to use in some of the experiments that you have in mind.
 
  • #10
OK...programmer ordered...demo board ordered... Kernighan book ordered...thank GOD for EBay!
I am almost prepared to make that LED blink.
Any additional input would be appreciated and I thank you all for your help.
I'll be back with more questions... so don't get too comfortable. :)
 
  • #11
Hi Bill, Sounds like you're moving right along! You should also download a free C compiler or two, so that you can start playing around writing simple programs on your PC right away when your K&R book arrives. Here's a good website to find a free C compiler:

http://www.thefreecountry.com/compilers/cpp.shtml

I like the Pacific C compiler, but it's just a klunky DOS interface. Some of the other choices at that web page might be better, especially some of the ones that go with the free GUI development packages.

Have fun! -Mike-
 
  • #12
If you go to the microchip website (http://www.microchip.com), you can get free samples of PIC microcontrollers every month. They also have a max 16(I think) pin microcontroller programmer for about $25. It's great for educational purposes and small projects.
 

1. What is a microcontroller?

A microcontroller is a small computer on a single integrated circuit that is used to control electronic devices. It contains a processor, memory, and input/output peripherals, making it a self-contained system that can be programmed to perform specific tasks.

2. Why should I learn about microcontrollers?

Learning about microcontrollers can open up a wide range of opportunities in the fields of electronics, robotics, and automation. Microcontrollers are used in a variety of devices, from household appliances to industrial machinery, and understanding how they work can be beneficial for a career in STEM.

3. Which microcontroller is the best to learn?

There is no one "best" microcontroller to learn, as it ultimately depends on your specific interests and goals. Some popular microcontrollers include Arduino, Raspberry Pi, and PIC, each with its own strengths and applications. It's important to research and choose a microcontroller that aligns with your learning objectives.

4. Do I need any prior knowledge to learn about microcontrollers?

While having a basic understanding of electronics and programming can be helpful, it is not necessary to have prior knowledge to learn about microcontrollers. There are many resources available, such as online tutorials and starter kits, that can guide beginners in learning about microcontrollers.

5. What are some applications of microcontrollers?

Microcontrollers have a wide range of applications, including but not limited to: home automation, robotics, medical devices, automotive electronics, and industrial control systems. They can be used to control and monitor various parameters, making them an essential component in many electronic devices.

Similar threads

  • Electrical Engineering
Replies
4
Views
5K
  • Electrical Engineering
Replies
1
Views
2K
Replies
8
Views
3K
Replies
9
Views
4K
Replies
4
Views
4K
Replies
4
Views
2K
  • Electrical Engineering
Replies
21
Views
23K
  • Electrical Engineering
Replies
30
Views
25K
  • Electrical Engineering
Replies
8
Views
17K
Replies
2
Views
3K
Back
Top