Author Topic: Simple Microcontroller for a beginner  (Read 30473 times)

0 Members and 1 Guest are viewing this topic.

Offline cowboy303Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: us
Simple Microcontroller for a beginner
« on: February 21, 2012, 03:20:00 pm »
I've made a few circuits and and I would like to try my hand at Microcontrollers but there are so many out there I don't know which one to get.  I don't know much about them I thought if I get my feet wet, it would help me understand what others are talking about.
So which Microcontroller do you suggest I want to make blinky LED and some PWM maybe some stuff with rotary encoders just some of the basics.
And which programmer and software do I use.
I've watched a few of Dave's videos but they don't make much sense, And that's I'm doing this, If somebody has a good video or something they know of If they wouldn't mind sharing it that would be very nice

Thank you all and if you got any questions feel free to ask goodness knows I forgot something.
And thank you all for all your help in the last few weeks.
 

Offline caffeinatedbard

  • Regular Contributor
  • *
  • Posts: 66
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #1 on: February 21, 2012, 03:27:51 pm »
For a beginner, I would suggest you get yourself an Arduino board starter kit from either adafruit or sparkfun. 

Then, for a video tutorial series I suggest Jeremy Blum's blog.  If you are more ambitious, the Arduino software has tons of example code.

http://www.jeremyblum.com/category/arduino-tutorials/

If you want to learn about more of the hardware side, visit sparkfun's website.

http://www.sparkfun.com/tutorials/57

This should keep you busy for a couple of months if you go at it diligently.  Once you become very familiar with these building blocks you will begin to understand the lingo and be more knowledgeable in the world of embedded systems.

Good luck!
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Simple Microcontroller for a beginner
« Reply #2 on: February 21, 2012, 03:33:20 pm »
Yep, Arduino seems the way to go.  You can pick one up at your local Radio Shack.
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Simple Microcontroller for a beginner
« Reply #3 on: February 21, 2012, 08:02:51 pm »
I'll probably get jumped on for suggesting it, but I think you should try PICs

Arduino is just too easy. You get things done very fast, and get results you want, but you learn little on the way.
 

alm

  • Guest
Re: Simple Microcontroller for a beginner
« Reply #4 on: February 21, 2012, 08:24:25 pm »
I don't see the problem. Just start with Arduino to learn the basics of embedded programming and hardware interfacing, and move to programming the AVR in plain C once you outgrow the Arduino. You can even continue using the same hardware. I see no inherent advantage in PIC for learning, but no disadvantage either.
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: Simple Microcontroller for a beginner
« Reply #5 on: February 21, 2012, 08:26:20 pm »
6 months ago I too would have suggested PIC but since then I have been introduced to ARDUINO, reluctantly I might add, and am now persuaded as to its benefits for a beginner.


I used to teach Microprocessor Techniques at collage level, way back in the 80's on 6800 and 6809 platforms, so picking up a PIC was just a matter of learning a new assembler and working out the advances in technology since the 80's.


I was up and running reasonably fast, but I had to invest in a development board, PICKit programmer, learn a new IDE, and worst off all, I had to wade through 13inch thick pile of Microchip data sheets.


The Arduino, on the other hand, is a development board that needs no programmer, has a simple IDE, comes with a ton of examples, has lots of easily accessible tutorials and a very helpful community to back it up.


And don't be persuaded by people (and I used to be guilty of this) that tell you that you have to learn Assembler to truly program a microcontroller. Learn C, all embedded development is headed that way now, and you can still use assembler later once you are used to the concepts of programming.


You are doing this for fun, not a theoretical computing course in collage, why make it hard on yourself.



« Last Edit: February 21, 2012, 08:29:40 pm by caroper »
 

Offline sacherjj

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #6 on: February 21, 2012, 09:36:28 pm »
I'll probably get jumped on for suggesting it, but I think you should try PICs

Arduino is just too easy. You get things done very fast, and get results you want, but you learn little on the way.

There is plenty to learn just in the interfacing with a micro, for those that have not done it. 
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Simple Microcontroller for a beginner
« Reply #7 on: February 21, 2012, 09:43:32 pm »
I'll probably get jumped on for suggesting it, but I think you should try PICs

Arduino is just too easy. You get things done very fast, and get results you want, but you learn little on the way.

There is plenty to learn just in the interfacing with a micro, for those that have not done it.

Yes, yes. Connect wires here, there, done.

The point is, it's all out there, ready for you to copy/paste and just follow the instructions. You don't even have to think to use an Arduino.

For blinking an LED, and PWM, PIC would be pretty simple too, but you would have to think more to get the result.

Maybe I'm just tired of Arduino being the standard answer for beginners. I never had an Arduino, and I don't see why everyone needs to be spoon-fed. There's nothing wrong with something taking time and effort to complete.
 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Simple Microcontroller for a beginner
« Reply #8 on: February 21, 2012, 09:53:20 pm »
Yes, yes. Connect wires here, there, done.

The point is, it's all out there, ready for you to copy/paste and just follow the instructions. You don't even have to think to use an Arduino.

For blinking an LED, and PWM, PIC would be pretty simple too, but you would have to think more to get the result.

Maybe I'm just tired of Arduino being the standard answer for beginners. I never had an Arduino, and I don't see why everyone needs to be spoon-fed. There's nothing wrong with something taking time and effort to complete.

Completely agree.
Buy a chip (PIC16/18 or AVR) and a breadboard and learn to read the datasheet, wire it up and program it. Now you are learning about microcontrollers, not just someone else's pre-built modules. You get to learn about the internal architecture of the device, various mechanisms to make it do things and  can rewire it however you want, from blinking leds, LCD's or reading analogue and digital inputs. This is real learning.
Was it really supposed to do that?
 

Offline harnon

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Simple Microcontroller for a beginner
« Reply #9 on: February 21, 2012, 10:07:41 pm »
Yes, yes. Connect wires here, there, done.

The point is, it's all out there, ready for you to copy/paste and just follow the instructions. You don't even have to think to use an Arduino.

For blinking an LED, and PWM, PIC would be pretty simple too, but you would have to think more to get the result.

Maybe I'm just tired of Arduino being the standard answer for beginners. I never had an Arduino, and I don't see why everyone needs to be spoon-fed. There's nothing wrong with something taking time and effort to complete.

Completely agree.
Buy a chip (PIC16/18 or AVR) and a breadboard and learn to read the datasheet, wire it up and program it. Now you are learning about microcontrollers, not just someone else's pre-built modules. You get to learn about the internal architecture of the device, various mechanisms to make it do things and  can rewire it however you want, from blinking leds, LCD's or reading analogue and digital inputs. This is real learning.

I disagree! :D  For most people starting out on micros, a PIC or Atmel is way too scary!  If you don't know what you are doing there are so many things that can go wrong... and then there are the choices - which chip (as a human race we can't even agree on PIC vs Atmel  ;)), too many programming languages (ASM, C, Basic???), too many programmers (Official, unofficial, JTAG, Pickit2, Pickit3, devboard, etc.), and for the beginner without a scope, proper multimeters, logic analysers etc. debugging can be a nightmare.  Whats wrong with buying an Arduino to learn on, which is the cost of a single PIC programmer?

Further, if you run into trouble the options for help with a PIC are - 20 year old articles on the web about extinct chips written in ASM, a 300 page datasheet, or trial and error (ok maybe a bit of an overstatement but not far off).  Not so much a learning experience as a lesson in being demoralised :D   I'm not saying I think buying a breadboard, xtal, caps, programmer, wiring up ICSP etc is a bad way to do it, its just an order of magnitude more difficult and expensive for somebody who knows next to nothing but wants to learn more.  You don't start a university degree in third year... baby steps, right?
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Simple Microcontroller for a beginner
« Reply #10 on: February 21, 2012, 10:26:12 pm »
A blinking LED program in assembler is only a few lines of code, and a few settings for programming. The circuit is also quite simple to breadboard.

What you are saying about cost is true. However, once you have bought, for the sake of argument, a PicKit 3, you then can program just about any PIC you choose. You can use as simple or complex a PIC as you wish. Use the same programmer for multiple projects. There's literally thousands of choices.

PIC datasheets are ~300 pages simply because they contain a lot of information about the chip, most of which you don't need for this. There's only about 6 pages you need to pay attention to to get a blinking LED program to work.


 

Offline DrGeoff

  • Frequent Contributor
  • **
  • Posts: 794
  • Country: au
    • AXT Systems
Re: Simple Microcontroller for a beginner
« Reply #11 on: February 21, 2012, 10:28:48 pm »
I disagree! :D  For most people starting out on micros, a PIC or Atmel is way too scary!  If you don't know what you are doing there are so many things that can go wrong... and then there are the choices - which chip (as a human race we can't even agree on PIC vs Atmel  ;)), too many programming languages (ASM, C, Basic???), too many programmers (Official, unofficial, JTAG, Pickit2, Pickit3, devboard, etc.), and for the beginner without a scope, proper multimeters, logic analysers etc. debugging can be a nightmare.  Whats wrong with buying an Arduino to learn on, which is the cost of a single PIC programmer?

Further, if you run into trouble the options for help with a PIC are - 20 year old articles on the web about extinct chips written in ASM, a 300 page datasheet, or trial and error (ok maybe a bit of an overstatement but not far off).  Not so much a learning experience as a lesson in being demoralised :D   I'm not saying I think buying a breadboard, xtal, caps, programmer, wiring up ICSP etc is a bad way to do it, its just an order of magnitude more difficult and expensive for somebody who knows next to nothing but wants to learn more.  You don't start a university degree in third year... baby steps, right?

Back in the 1970's in my teens I was designing and constructiing (using wirewrap) 2650 based processor projects. Then hand assembling software to key it in using switches. Then came Z80's, S100 bus etc and we were still designing them from data sheets and writing code to get them to go. There was nothing scary about it, it was simply what you had to do. Now with microcontrollers, PC's and IDE's it is thousands of times easier. There is nothing hard or scary about buying a chip, plugging it into a breadboard and reading the data sheet to work out how to make it do what you want to do. If people find that daunting then maybe they should find something else to do, like accountacy. Learning about the details of the device and what the pins do and making decisions about how and what to connect is all part of the process. Having someone else do it for you is not learning.
Was it really supposed to do that?
 

Offline Tony R

  • Regular Contributor
  • *
  • Posts: 117
  • Country: 00
Re: Simple Microcontroller for a beginner
« Reply #12 on: February 21, 2012, 10:32:26 pm »
"For a beginner, I would suggest you get yourself an Arduino board starter kit from either adafruit or sparkfun."

Although Arduino is a popular choice for tinkerers, I feel it can lead to bad habits. I would say a PIC, AVR, or if your looking for budget order a MSP430 launch pad. Tons of example programs, simple enough. and very cheap.

Struggling is learning, if you don't struggle, you don't learn much.
Tony R.
Computer Engineering Student
Focus: Embedded Assembly Programming, Realtime Systems,  IEEE Student Member
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: Simple Microcontroller for a beginner
« Reply #13 on: February 21, 2012, 10:34:45 pm »
Just because the Arduino has libraries and examples doesn't mean you have no access to the internal structure.
What it does mean is that you can prove your concept quickly or use standard libraries like Serial to get debug output whilst you try your hand at developing a timer/counter based implementation of a frequency counter with duty cycle measurement. You can delve into the datasheets and concentrate on the hardware of interest NOT the Fuses, uarts, interupts etc. that take 3 times as long to set up than the bit of hardware you are trying to focus on learning.
« Last Edit: February 21, 2012, 10:40:42 pm by caroper »
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: Simple Microcontroller for a beginner
« Reply #14 on: February 21, 2012, 10:40:29 pm »
If you go the chip/breadboard/programmer route then I suggest you get an FTDI cable as well. 

An FTDI cable will allow you to send information (debug messages, for example) via the MCU's UART (at TTL levels) to a terminal program on your PC.

If you can find one, get the TTL-232RG-VIP-WE.  This one will work with any TTL voltage level from 1.8V to 5.25V.  The other ones will only work with a specific voltage level--3.3V, for example.  You will have to put a connector on the cable yourself, however.

So far as chip and programmer go, I'd suggest an Atmel AVR ATmega 168 and the AVRISP mkII.  Use Atmel's free AVR Studio for development.

All of this will cost you about $60.
 

Offline harnon

  • Regular Contributor
  • *
  • Posts: 215
  • Country: au
  • Is this thing on?
    • My Personal Website
Re: Simple Microcontroller for a beginner
« Reply #15 on: February 21, 2012, 10:49:42 pm »
A blinking LED program in assembler is only a few lines of code, and a few settings for programming. The circuit is also quite simple to breadboard.
If its that simple, how does it provide a better or worse experience than an Arduino? Aren't the concepts similar or the same? 


Back in the 1970's in my teens I was designing and constructiing (using wirewrap) 2650 based processor projects
Dr Geoff, I don't doubt that things are easier now than they were 30 years ago! Although perhaps thats part of the problem, as what may seem trivial to some of you (as you've been doing it for yonks) is much more daunting to newcomers.

or if your looking for budget order a MSP430 launch pad. Tons of example programs, simple enough. and very cheap.
Wow, they are very cheap...

Struggling is learning, if you don't struggle, you don't learn much.
I don't quite follow the correlation between quantity of struggling and quantity of learning :D


I'm not really arguing in favour of Arduino over any other particular method, just defending those who seem to be automatically against it as a "weak" alternative.  Looking at this yet another way, until a few years ago I was coached state championship junior basketball in Oz.  I would still go back and run basic, fun clinics for kids at my old club to get them involved in the sport. I found experimentally that for most kids having a fun introduction was far more likely to make them come back for more.  Anyway, I hope we aren't hijacking the thread too much!
 

Offline johnboxall

  • Supporter
  • ****
  • Posts: 652
  • Country: au
  • You do nothing, you get nothing.
    • Books, services and more:
Re: Simple Microcontroller for a beginner
« Reply #16 on: February 21, 2012, 10:54:18 pm »
Get an Arduino or compatible board. Have fun, find success and enjoy yourself. However consider this a stepping-stone onto more involved methods and architectures.

Offline cowboy303Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #17 on: February 21, 2012, 10:55:12 pm »
Struggling is learning, if you don't struggle, you don't learn much.
I absolutely agree I want something easy to program.  But I'm not going to copy paste if you know what I mean.
The cheaper the better for me for this is only my hobby so I don't want a go to crazy <$20 but if it stands out and is much better I would be willing to go a bit higher.
I would like something I can program a chip with, and disconnect it then put it in my circuit.
That way if have another project I can just get another chip for <$10

Thank you for all your answers ;D
 

Offline cowboy303Topic starter

  • Regular Contributor
  • *
  • Posts: 82
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #18 on: February 21, 2012, 11:03:44 pm »
Get an Arduino or compatible board. Have fun, find success and enjoy yourself. However consider this a stepping-stone onto more involved methods and architectures.
Which Arduino/PIC/AVR programmer do you suggest there seam to be a lot of different models ;D Thanks.
« Last Edit: February 21, 2012, 11:11:36 pm by cowboy303 »
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: Simple Microcontroller for a beginner
« Reply #19 on: February 21, 2012, 11:14:34 pm »
You could jump in the deep end and silence both camps with a ChipKit Uno 32 - PIC32 based Arduino clone :)

The Arduino can be used as a programmer to program AVR chips.

If you do want to go for a basic PIC set up on a bread board, my favorite is a 16F690 for beginners.
It has a full set of peripherals and a pretty good internal RC oscillator.
Easy to set up and Not to hard to learn.

BUT even as a PIC fan I suggest you go arduino to start and I say that based on many years of teaching, it is a damn good tool when you get beneath the hype.
You learn more in Arduino Playground than Arduino.cc


Offline johnboxall

  • Supporter
  • ****
  • Posts: 652
  • Country: au
  • You do nothing, you get nothing.
    • Books, services and more:
Re: Simple Microcontroller for a beginner
« Reply #20 on: February 22, 2012, 02:26:14 am »
Get an Arduino or compatible board. Have fun, find success and enjoy yourself. However consider this a stepping-stone onto more involved methods and architectures.
Which Arduino/PIC/AVR programmer do you suggest there seam to be a lot of different models ;D Thanks.

In the Arduino world, these guys have the best boards:
http://www.freetronics.com/collections/arduino

The Digilent Chip kit Uno32 is a good 32-bit PIC board, but not so good for a direct Arduino replacement.

Offline sacherjj

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #21 on: February 22, 2012, 02:35:51 am »
Which Arduino/PIC/AVR programmer do you suggest there seam to be a lot of different models ;D Thanks.

I don't think you would go wrong with either a PicKIT 2 or 3.  I would not currently recommend an AVR ISP II.  Through the brilliance of AVR, this no longer works with the latest version 5 of their development system.  If you get one (it is what I use) just know that you must stay with version 4.  With all the bugs in 5, you are better off anyway.

If you start with an Arduino, you will need to programmer, save your USB port.  You can also use the Arduino board to work as an ISP.

As someone who had to build an 8-bit RISC processor from gate level components in college, I don't mind taking a shortcut to systems that are easily modifiable or have previous software written.  Arduino can be restricting, but can also let you just get crap done.  :)
« Last Edit: February 22, 2012, 02:38:43 am by sacherjj »
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Simple Microcontroller for a beginner
« Reply #22 on: February 22, 2012, 04:05:15 am »
A blinking LED program in assembler is only a few lines of code, and a few settings for programming. The circuit is also quite simple to breadboard.
If its that simple, how does it provide a better or worse experience than an Arduino? Aren't the concepts similar or the same? 

Writing for Arduino is like simply writing software. You know it makes real physical things happen, but you don't know how. All you know is that you asked it to set a pin high and it did it for you.

This isn't bad in itself, and you can always read the device datasheet if you want to understand more, but it's the fact that you don't have to do anything extra in order to get things done that I consider a barrier to learning.

When you write for PICs, you must refer to the specific device's datasheet etc. There's much more exposure to more information, which I consider a good thing.

Without getting into specific code examples, I will just say that I consider Arduino to just be a toy, for when things need to get done, but most definitely not a tool for learning about microcontrollers. More of a tool for just learning about...Arduino.
« Last Edit: February 22, 2012, 04:13:48 am by 8086 »
 

Offline MarkS

  • Supporter
  • ****
  • Posts: 825
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #23 on: February 22, 2012, 04:25:17 am »
My first micro was a Parallax Propeller. Sure, it has its issues, but it is shockingly simple to use and it is powerful. Being able to wire up a circuit including a micro and program it to do something without having any prior MCU knowledge really helped my confidence.

I just cannot bring myself to the level required to jump on board the Arduino bus. It has the feel of a cult. Like you have to drink the Kool-Aid to get started. :o
 

Offline sacherjj

  • Frequent Contributor
  • **
  • Posts: 993
  • Country: us
Re: Simple Microcontroller for a beginner
« Reply #24 on: February 22, 2012, 04:35:29 am »
A blinking LED program in assembler is only a few lines of code, and a few settings for programming. The circuit is also quite simple to breadboard.
If its that simple, how does it provide a better or worse experience than an Arduino? Aren't the concepts similar or the same? 

Writing for Arduino is like simply writing software. You know it makes real physical things happen, but you don't know how. All you know is that you asked it to set a pin high and it did it for you.

This isn't bad in itself, and you can always read the device datasheet if you want to understand more, but it's the fact that you don't have to do anything extra in order to get things done that I consider a barrier to learning.

When you write for PICs, you must refer to the specific device's datasheet etc. There's much more exposure to more information, which I consider a good thing.

Without getting into specific code examples, I will just say that I consider Arduino to just be a toy, for when things need to get done, but most definitely not a tool for learning about microcontrollers. More of a tool for just learning about...Arduino.

That is unless you write for PICs using the various PICBasics out there or any other abstraction layer.  :)   It will always be up to the person if they wish to learn the low level of anything.  Abstractions layers will continue to exist.  Otherwise, we will refuse anyone from writing micro code in C and insist on Assembly only!  ;)

I personally love to hook up my Arduino Uno when I'm writing some code in C for AVRStudio 4.  It is all what you take from it.  I like a USB based test platform that is really cheap.  I've found AVR assembly to be much nicer than PIC assembly, when working on some of the ATTiny chips and I'm not allowed the C abstraction layer.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf