Which microcontroller to learn?


by BillBLack
Tags: learn, microcontroller
BillBLack
#1
Jul8-05, 10:19 PM
P: n/a
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,
Phys.Org News Partner Engineering news on Phys.org
Lifting the brakes on fuel efficiency
PsiKick's batteryless sensors poised for coming 'Internet of things'
Researcher launches successful tech start-up to help the blind
berkeman
berkeman is online now
#2
Jul8-05, 10:57 PM
Mentor
berkeman's Avatar
P: 39,638
Great question, Bill. But your footer already says that.

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.
BillBLack
#3
Jul10-05, 09:56 AM
P: n/a
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.
:)

willib
willib is offline
#4
Jul10-05, 10:41 AM
P: 228

Which microcontroller to learn?


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 dont 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/appm...Guide&col=adc1
BillBLack
#5
Jul11-05, 01:02 PM
P: n/a
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!!!
willib
willib is offline
#6
Jul11-05, 02:12 PM
P: 228
Quote Quote by BillBLack
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 ( similiar 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...
BillBLack
#7
Jul12-05, 10:00 AM
P: n/a
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?
willib
willib is offline
#8
Jul12-05, 10:56 AM
P: 228
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..
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...
berkeman
berkeman is online now
#9
Jul12-05, 11:02 AM
Mentor
berkeman's Avatar
P: 39,638
Quote Quote by BillBLack
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.
BillBLack
#10
Jul14-05, 07:09 AM
P: n/a
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. :)
berkeman
berkeman is online now
#11
Jul14-05, 11:12 AM
Mentor
berkeman's Avatar
P: 39,638
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-
Jelfish
Jelfish is offline
#12
Jul17-05, 05:51 PM
P: 130
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.


Register to reply

Related Discussions
Freescale Microcontroller Help Electrical Engineering 1
What to learn in classical mechanics?How to learn it well? Classical Physics 0
microcontroller programming Engineering, Comp Sci, & Technology Homework 7
Microcontroller Suggestions... Electrical Engineering 8
PIC16F877 Microcontroller Electrical Engineering 1