Author Topic: Absolute beginner interested in learning to use microcontrollers  (Read 7709 times)

0 Members and 1 Guest are viewing this topic.

Offline ParadoxineTopic starter

  • Newbie
  • Posts: 5
So for a project I want to do, I'll need to use a micro-controller. Not a particularly complex circuit mind, and indeed I could get away with doing it with some more basic components but it'd be far more work and cost more in addition. Anyway, I'm currently in (UK)College and would like to learn to use PIC micro-controllers (material is easiest to find). I have found the following books:

http://www.amazon.com/PIC-Microcontrollers-Know-All-Newnes/dp/0750686154/ref=sr_1_7?s=books&ie=UTF8&qid=1352591966&sr=1-7&keywords=PIC+microcontroller

http://www.amazon.co.uk/The-PIC-Microcontroller-Introductory-ebook/dp/B0014D4R1K/ref=cm_cr_pr_product_top

http://www.amazon.com/Designing-Embedded-Systems-Microcontrollers-Edition/dp/1856177505/ref=cm_cr_pr_product_top

I'd appreciate it if you guys could give me any advice and or suggest any alternative material. I don't mind learning assembly, but not just for the sake of it, at least not at this point when results are more important. I have ample experience in C++ so using C won't be too much of an issue, apart from learning the necessary API etc. Unfortunately, I don't have much money either, so buying multiple (expensive) books is probably not possible. Also, any good free online guides would be much appreciated.

At this point I'm tempted to just jump down into hell, buy a kit and then just google relentlessly until I know enough to get by. I'd prefer getting a more rounded knowledge base though.
 

Offline montcler

  • Contributor
  • Posts: 28
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #1 on: November 11, 2012, 01:00:05 am »
Hello,

There are plenty of books (C, assembly, Basic) you can download them in PDF through the network.
Simply search. Luck!

Greetings.
 

Offline croberts

  • Regular Contributor
  • *
  • Posts: 94
  • Country: us
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #2 on: November 11, 2012, 01:53:09 am »
Hello

Lately, I do a lot of design and programming with the PIC16F690. I use microchip's free MPLAB IDE to write and compile code and to program the chip. I use a PICSTART Plus programmer and DIP versions of the chip. I do all assembly language programming. I am currently using the chip to control the LED lighting system I designed for my home (see Topics "Solar Powered LED Lighting System","LED Light",  and "LED Driver" in the Projects, Designs and Technical Stuff section). I use the plain MPLAB IDE (I think they are on version 8) not MPLAB-x (might be great I just haven't used it). I hope this helps you get started. Let me know if I can help you get a project started.
 

Offline ParadoxineTopic starter

  • Newbie
  • Posts: 5
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #3 on: November 11, 2012, 02:31:14 am »
Hello

Lately, I do a lot of design and programming with the PIC16F690. I use microchip's free MPLAB IDE to write and compile code and to program the chip. I use a PICSTART Plus programmer and DIP versions of the chip. I do all assembly language programming. I am currently using the chip to control the LED lighting system I designed for my home (see Topics "Solar Powered LED Lighting System","LED Light",  and "LED Driver" in the Projects, Designs and Technical Stuff section). I use the plain MPLAB IDE (I think they are on version 8) not MPLAB-x (might be great I just haven't used it). I hope this helps you get started. Let me know if I can help you get a project started.

Thanks for the reply, I think the first step is to know exactly what I'm dealing with, so even just stating what it is you use is very helpful. I just recently found a Pickit3 PDF user guide and it may be just enough for me to get started.
 

Offline dr_p

  • Frequent Contributor
  • **
  • Posts: 309
  • Country: ro
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #4 on: November 11, 2012, 02:47:14 am »
I started with PicKit2 and the tutorials from http://www.gooligum.com.au/tutorials.html which I found to be excellent. They used to be free, now only the baseline ones are. I chose the PicKit2 programer because I wanted everything to work together on the first try - MPLAB, compiler, hadware. There are also some useful tutorials on the CD that came with it.
Gooligum also sell a training board that goes hand in hand with their tutorials, but you still need a programer.

You might want to stock some cheap PICs for all those tutorials - 10F200, 12F509, 16F505, 16F629, 16F684, 16F690 (included in PicKit2).
 

Offline johnboxall

  • Supporter
  • ****
  • Posts: 652
  • Country: au
  • You do nothing, you get nothing.
    • Books, services and more:
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #5 on: November 11, 2012, 04:04:15 am »
I started with PicKit2 and the tutorials from http://www.gooligum.com.au/tutorials.html which I found to be excellent. They used to be free, now only the baseline ones are. I chose the PicKit2 programer because I wanted everything to work together on the first try - MPLAB, compiler, hadware. There are also some useful tutorials on the CD that came with it.
Gooligum also sell a training board that goes hand in hand with their tutorials, but you still need a programer.

You might want to stock some cheap PICs for all those tutorials - 10F200, 12F509, 16F505, 16F629, 16F684, 16F690 (included in PicKit2).


http://tronixstuff.wordpress.com/2012/10/25/review-gooliegum-electronics-pic-training-course-and-development-board/
It's a very good learning environment. Cheaper than just buying a book in some cases. David has also released a few more tutorials.

Offline notsob

  • Frequent Contributor
  • **
  • Posts: 696
  • Country: au
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #6 on: November 11, 2012, 04:23:33 am »
There are also some PIC tutorials on pcbheaven.com
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #7 on: November 25, 2012, 02:37:58 pm »
C? Too bad, the free compilers for PICs are crippleware.
You would be better off with 8bit Atmels (ATmega etc).
Winavr gcc is full featured without silly limits, and 8 bit PICs kind of suck in comparison with 8 bit AVR even before they are crippled by not using the instructions that help C programs most.

Good enough is the enemy of the best.
 

Offline hlavac

  • Frequent Contributor
  • **
  • Posts: 536
  • Country: cz
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #8 on: November 25, 2012, 02:43:35 pm »
Anyway, considering that ARM is coming to low end very soon it may be pointless to invest in learning an architecture that will be obsolete by the time when you are finished learning...
Good enough is the enemy of the best.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #9 on: November 25, 2012, 09:27:09 pm »
My suggestions:

1 Atmel AVR and AVR Studio
- As common and as many variants as PIC
- Some say (me included) the internal architecture is more... shall we say orthogonal, and supports higher level languages better. Not a big deal but anyway
- 32 bit chips available if you need more oomph
- AVR Studio is uncrippled freeware; dead easy to install and to start coding. Comes with full gcc toolchain containing all you need. Same toolchain is usable for all Atmel chips.
- Studio supports C++, and it is the same compiler you use on your PC (or very close, AVR-gcc variant)

2 ARM Cortex (M3 or M4)
- ARM - can you get more standard than that? Everyone and their cousin makes chips
- Definitely programmable with high level languages
- 32 bit horsepower and >100 MHz clocks when you need it. Not to mention HW floating point in M4F
- For TI chips there is the free version of Code Composer. Sure, it is crippleware - max 32kB executables but that will get you up to speed.
- For Atmel SAM chips the Atmel Studio is available uncrippled and free
- With a bit of work there are many free uncrippled toolchains for ARMs of all kinds, especially if you do Linux
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #10 on: November 25, 2012, 09:43:14 pm »
I wouldn't choose Atmel. They like to lie about the specs. On an inherited design someone choose an Attiny to run at 1.8V. It turns out the device cannot run at 1.8V reliably even though the datasheet says it should. Fortunately the design could be fixed by adding an extra 2V regulator but it does add extra costs on a medium volume product.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #11 on: November 25, 2012, 11:02:59 pm »
Strange, i've run tinys at 1.8V with no issues.

But i agree with above, as much as i love AVR's there isn't much point getting into them when ARM is so close to replacing the low end MCU market.

If you want something easy to learn look at the Arduino, if you want something to teach you a good platform which will be around for ages, choose ARM.

In reality it doesn't matter so much as programming skills transfer between platforms pretty easy.
So if you really want to learn PIC, go for it.
Don't get forced to pick a different platform just because others say so.
The most important factor is that you enjoy it and your more likely to give up when things get hard if you're using a platform someone else recommended and not the one you really wanted.

Also, don't learn ASM unless you actually want to or are interested in it.
Its nice to understand ASM and how things work at that level but its not required.
Use C, it makes things much easier.
« Last Edit: November 25, 2012, 11:10:03 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #12 on: November 26, 2012, 09:09:23 am »
I wouldn't choose Atmel. They like to lie about the specs. On an inherited design someone choose an Attiny to run at 1.8V. It turns out the device cannot run at 1.8V reliably even though the datasheet says it should. Fortunately the design could be fixed by adding an extra 2V regulator but it does add extra costs on a medium volume product.
Atmel _likes_ to lie? Bullshit. Maybe i am easily pleased but of my numerous applications of Atmel chips, i have yet to fail in a single one. I find Atmel documentation generally satisfying or better, although they too employ human beings capable of mistakes. At least they have responded every time i have requested support, and every time the issue has been resolved.

Don't make an isolated problem into a general feature of a manufacturer's entire offering. Atmel processors can be found all over the place - not likely if they were in the habit of failing.
Anecdotes like yours have the problem that we have no idea at all where the true root cause of this particular problem might have been. Having seen this kind of complaint so many times, my bet is an incompetent implementation creating the problem at such low supply voltage. There is a general tendency that the more skilled the worker, the less broken the tools are.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline AlfBaz

  • Super Contributor
  • ***
  • Posts: 2184
  • Country: au
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #13 on: November 26, 2012, 03:03:19 pm »
I'm sure most vendor forums are the same, but i can only speak for microchip forums, they are filled with lots of people willing to help. Just make sure you know what RTFM means :D
 

Offline chrome

  • Regular Contributor
  • *
  • Posts: 185
  • Country: be
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #14 on: November 26, 2012, 03:35:33 pm »
Don't make an isolated problem into a general feature of a manufacturer's entire offering. Atmel processors can be found all over the place - not likely if they were in the habit of failing.
Anecdotes like yours have the problem that we have no idea at all where the true root cause of this particular problem might have been. Having seen this kind of complaint so many times, my bet is an incompetent implementation creating the problem at such low supply voltage. There is a general tendency that the more skilled the worker, the less broken the tools are.

Probably a too high a clock on that low a voltage or they chose another version of the same AVR but different specs.
 

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #15 on: November 26, 2012, 04:01:52 pm »
Anyway, considering that ARM is coming to low end very soon it may be pointless to invest in learning an architecture that will be obsolete by the time when you are finished learning...

 :-DD
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26907
  • Country: nl
    • NCT Developments
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #16 on: November 26, 2012, 08:25:59 pm »
I wouldn't choose Atmel. They like to lie about the specs. On an inherited design someone choose an Attiny to run at 1.8V. It turns out the device cannot run at 1.8V reliably even though the datasheet says it should. Fortunately the design could be fixed by adding an extra 2V regulator but it does add extra costs on a medium volume product.
Atmel _likes_ to lie? Bullshit. Maybe i am easily pleased but of my numerous applications of Atmel chips, i have yet to fail in a single one. I find Atmel documentation generally satisfying or better, although they too employ human beings capable of mistakes. At least they have responded every time i have requested support, and every time the issue has been resolved.

Don't make an isolated problem into a general feature of a manufacturer's entire offering. Atmel processors can be found all over the place - not likely if they were in the habit of failing.
If you read the specs for the attiny carefully you'll see the brown out detection (POR) trips at 1.78V. That is a 20mV margin. Ridiculous! The problems occured when trying to program the internal EEPROM. Real 1.8V controllers like NXP's ARM controllers have their POR trip at 1.65V which is a margin of 150mV when operating from 1.8V.  I've contacted Atmel's support but in the end they had to admit the device wasn't suitable for use at 1.8V. It works DOWN TO 1.8V but not AT 1.8V. Your milage (luck) may vary but the numbers speak for themselve. If a manufacturer tries to make their parts look better than they are I rather avoid them than taking the chance of discovering another gold plated turd. If the datasheet says a part works at 1.8V it should work at 1.8V in a real world application which means the actual voltage may vary 3%. I want to be able to rely on the key features without having to read the fine print on page 3175 of the user manual.
« Last Edit: November 26, 2012, 08:33:07 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 671
  • Country: us
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #17 on: November 26, 2012, 09:11:03 pm »

what do you see yourself doing in that field in the long term ?
If you are going to work mainly with peripheral  type products like mouse, keyboard, usb gadjets, things like a controller for a microwave, television, automotive sensors etc then PIC or AVR will work fine and is a great starting point.  If you go the microchip site and register you should be eligible for free samples, so that is a bonus as well.
The mplabx ide is free and the compilers like xc8 are limited by optimizations in the demo version. Nothing that should impact learning the chips.

If you are going to be designing products where every function depends on the MCU in things like smart phones then PIC and AVR are not what you want, look at ARM or Mips.

When it comes to pic books find some by Lucio Di Jasio , of the books I have read, the ones he writes on the PIC are the easiest to understand and he now works for microchip so you know the content is on target.

Some other languages options besides commercial programs are C,  JAL and Basic, all are free.
JAL
http://www.casadeyork.com/jalv2/

Basic
http://gcbasic.sourceforge.net/
http://www.sfcompiler.co.uk/swordfish/

C
http://sdcc.sourceforge.net/


 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Absolute beginner interested in learning to use microcontrollers
« Reply #18 on: November 26, 2012, 09:19:00 pm »
If you read the specs for the attiny carefully you'll see the brown out detection (POR) trips at 1.78V. That is a 20mV margin. Ridiculous! The problems occured when trying to program the internal EEPROM. Real 1.8V controllers like NXP's ARM controllers have their POR trip at 1.65V which is a margin of 150mV when operating from 1.8V.  I've contacted Atmel's support but in the end they had to admit the device wasn't suitable for use at 1.8V. It works DOWN TO 1.8V but not AT 1.8V. Your milage (luck) may vary but the numbers speak for themselve. If a manufacturer tries to make their parts look better than they are I rather avoid them than taking the chance of discovering another gold plated turd. If the datasheet says a part works at 1.8V it should work at 1.8V in a real world application which means the actual voltage may vary 3%. I want to be able to rely on the key features without having to read the fine print on page 3175 of the user manual.

In your case it seems to be a question of the acceptable margin where you and Atmel had different opinions. I don't have any need to defend Atmel so if that was a failure for you then it was so and Atmel's part didn't meet your expectations. Maybe i have never run into these kinds of problems because as a rule i design defensively. One part of that principle is never to use the extreme min/max values of any spec. Unless you really need to, and then that spec becomes the critical one and you do need to read to page 3175.
If the ATTiny didn't meet your expectations - fair enough, but saying that Atmel (or any other mfg) falsifies its specs as a rule is a bit unfair, don't you think? The net is full of those who shoot from the hip and it tends to say more of the shooter than of the target.
Nothing sings like a kilovolt.
Dr W. Bishop
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf