Getting started with micro controllers

Thread Starter

Engineer_tech

Joined Sep 19, 2014
31
Hi
I am planning to start learning micro controllers (programming ).i have studied few subjects in my school related to micro controllers(PIC and 8051) few years back but since then i didn't get a chance to work with micro controllers.i am kind of confuse on where to start to refresh my knowledge and start working.

i am putting this question to take expert advises from all the great contributors out here.please suggest me some good resources to get started.

Thank you all
 

Thread Starter

Engineer_tech

Joined Sep 19, 2014
31
thank you for the replies.The suggested wesbites seems to be a great resource for starters.
i would like a quick advise on whether I should start from assembly language first or directly from C.As i already have bit of experience with C so what you guys suggest?
 
Last edited:

spinnaker

Joined Oct 29, 2009
7,830
thank you for the replies.The suggested wesbites seems to be a great resource for starters.
i would like a quick advise on whether I should start from assembly language first or directly from C.As i already have bit of experience with C so what you guys suggest?

Some people like assembly because they say it helps you understand the ship better. There might be some merit in that idea but I don't really think that level of understanding is necessary. Almost no one today programs PCs in machine code. They in fact use hundreds of libraries where they do not know what is going on inside the library. But they still turn out some very robust programs.

So you can spend your time learning the complexities of assembly or you can use that same time to quickly create some really nice projects using a higher level language like C.


My advice is to get going with an easier language like C so you do not get frustrated. Later you can learn assembler if you want to get closer to the chip.
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
thank you for the replies.The suggested wesbites seems to be a great resource for starters.
i would like a quick advise on whether I should start from assembly language first or directly from C.As i already have bit of experience with C so what you guys suggest?
When I started out assembly was the only game in town, unless you wanted to go the Pascal route etc, so I have stuck with it and now find it very easy to convert over to the small instruction set of Picmicro.
Max.
 

shteii01

Joined Feb 19, 2010
4,644
MrChips makes interesting point. Take something simple like flashing led. You can easily write it in C, and it is not really hard to write it in assembly. On the other hand, I would dread writing large-ish program in assembly when I can do it somewhat easily in C.

My microcontroller class was on 8051. The textbook that we used for that class had both, examples in assembly and same or nearly same examples in C. So, if you still have your old textbooks... you could do both.
 

Thread Starter

Engineer_tech

Joined Sep 19, 2014
31
MrChips makes interesting point. Take something simple like flashing led. You can easily write it in C, and it is not really hard to write it in assembly. On the other hand, I would dread writing large-ish program in assembly when I can do it somewhat easily in C.

My microcontroller class was on 8051. The textbook that we used for that class had both, examples in assembly and same or nearly same examples in C. So, if you still have your old textbooks... you could do both.
Ya i would like to try both my understanding is C is far more easier and easily manageable in terms of changing and playing around with program.
i do remember my first lesson was some what mix of c and ASM.
the reason i am posting here to get advise from you guys so i can remain focused.Grabbing things from here and there isn't helping me a lot.
i have two choices either i have to go back and study my school text book or follow one platform(PIC/AVR or MSP430) and website for now and move on from there.
all i need is guidance from where to start.slowly and gradually i would learn to switch between micro controllers.

thanks for all contributors for taking time out and suggesting me some great resources.
 

sirch2

Joined Jan 21, 2013
1,037
Mr Chips, hopefully this is not too off topic but I have noticed that you often recommend the MSP430, I also respect your opinion and you seem like the sort of person who would think these things through so, if possible, I would be interested in a brief summary of why you favour the MSP over PIC or AVR?
 

shteii01

Joined Feb 19, 2010
4,644
Mr Chips, hopefully this is not too off topic but I have noticed that you often recommend the MSP430, I also respect your opinion and you seem like the sort of person who would think these things through so, if possible, I would be interested in a brief summary of why you favour the MSP over PIC or AVR?
"I hear them fighting words!"
☺7
 

MrChips

Joined Oct 2, 2009
30,821
I teach this stuff. I wouldn't want to teach Microchip PIC ASM.

I love teaching Freescale HC11 or HC12 ASM.
Atmel AVR gets second prize from me.
TI MSP430 ranks third place.

Why do I recommend MSP430 Launchpad? Because it is the lowest priced development kit on the market (used to be $4.30 but now $10) and IAR Embedded Workbench tops them all.
 
Last edited:

iimagine

Joined Dec 20, 2010
511
Here is my 2 cents:
Code:
boolean whatToDo()
{
  if (you know C) then
  {
    if (startsWithC() < speedNeeded) then
      return optimizeInASM(findBottleNeck());
    else
      return imHappy();
  }
  else
  {
    learnC();
    return whatToDo();
  }
}
 

MrChips

Joined Oct 2, 2009
30,821
From my perspective as an educator in electronics and computer technology, the purpose of learning ASM is not to optimize one's code but to gain a solid understand of computer technology.

There are many concepts in C that are difficult to grasp and understand unless one is exposed to the inner operation of the machine. Examples are data types, data structures, unions, logical versus boolean operations and of course, pointers.

To become a thorough expert in computer technology, the logical progression in learning would be firstly, digital logic and then assembler language before moving up to a higher level language such as C. But that's ok to come at it from a different direction.
 

absf

Joined Dec 29, 2010
1,968
I teach this stuff. I wouldn't want to teach Microchip PIC ASM.

I love teaching Freescale HC11 or HC12 ASM.
Atmel AVR gets second prize from me.
TI MSP430 ranks third place.

Why do I recommend MSP430 Launchpad? Because it is the lowest priced development kit on the market (used to be $4.30 but now $10) and IAR Electronic Workbench tops them all.
Just downloaded the instruction set of the MSP430G2553. One day I'm gonna try it out to just flash a LED. Is an assembler needed to write in assembly or I can enter the code in the IAR IDE enviroment?

Allen
 

MrChips

Joined Oct 2, 2009
30,821
You create ASM code in the IAR IDE.
Here is an example:

Code:
#include "msp430.h"

  PUBLIC mytest
  RSEG CODE ;code is relocatable 
     
  mytest:

  clr.b &P1OUT
  mov.b #0x01, &P1OUT

  ret
             
  END
Create a file and give it a name such as test.asm
Add the file to the project.

The code defines the entry point "mytest".
All the code does is clears PORT1 and then writes 01 to PORT1, in effect toggling P1.0
Then the code returns to the calling program.

In your calling program, declare

extern void mytest(void);

simply insert in your main program loop:

mytest();
 

sirch2

Joined Jan 21, 2013
1,037
I teach this stuff. I wouldn't want to teach Microchip PIC ASM.

I love teaching Freescale HC11 or HC12 ASM.
Atmel AVR gets second prize from me.
TI MSP430 ranks third place.

Why do I recommend MSP430 Launchpad? Because it is the lowest priced development kit on the market (used to be $4.30 but now $10) and IAR Embedded Workbench tops them all.
Thanks.
 

sirch2

Joined Jan 21, 2013
1,037
"I hear them fighting words!"
☺7
Not at all, I was genuinely interested. I use PIC's, AVRs and Arduino (I know, I know, it's an AVR but I mean the whole platform as opposed to a bare ATMega) so I have no axe to grind and I like to use the right tool for the job. I have never used the MSP430 and am interested in what it offers and could it be another tool in the box.
 
Top