Author Topic: Microcontroller for begginer  (Read 7790 times)

0 Members and 1 Guest are viewing this topic.

Offline jimkonTopic starter

  • Newbie
  • Posts: 4
Microcontroller for begginer
« on: October 09, 2013, 01:09:46 pm »
Hallo to all,
i am a new here,

i am a student in computer engineering in greece and i wanna start learning more about mC.So i am searching a mC to start.I would an as simple as possible mC,and a nice tutorial or book.
I am between an arduino

kit http://www.amazon.com/Arduino-Ultimate-Starter-Includes-Instruction/dp/B00BT0NDB8/ref=sr_1_6?ie=UTF8&qid=1381323857&sr=8-6&keywords=arduino

and a pic kit which i dont know yet(maybe pic kit 3).

I would like to ask,
1.What is programmer/debugger and if i need it why i need it?
2.What is the simulation program and if i need it why i need it?
3.Can i program arduino in c?
4.Arduino doesng have debugger and programmer?

i am totally new.


thank you very much.I will apreciate any help.Sorry for my bad english.

« Last Edit: October 09, 2013, 02:09:01 pm by jimkon »
 

Offline filip_cro

  • Regular Contributor
  • *
  • Posts: 71
  • Country: hr
Re: Microcontroller for begginer
« Reply #1 on: October 09, 2013, 02:03:05 pm »
If you have background in C you can start with breadboard, programmer and MCU. No need for arduino. I started that way and I found many excellent tutorials no web.
 

Offline RjSa

  • Contributor
  • Posts: 21
  • Country: ve
Re: Microcontroller for begginer
« Reply #2 on: October 09, 2013, 02:46:53 pm »
I agree with filip_cro. Get a basic microcontroller, a breadboard and build the circuit.

1. A programmer is a circuit that transfer your code to the microcontroller.
2. Is a software that simulates a circuit within your PC. Its up to you if you want to use it or not.
3. Yes you can
4. It has a programmer, I dont know if it has a debugger.
 

Offline jimkonTopic starter

  • Newbie
  • Posts: 4
Re: Microcontroller for begginer
« Reply #3 on: October 09, 2013, 03:50:47 pm »
ok i like your idea.Can you suggest me a  a mC kit or mC with a nice tutorial?
What is the difference of arduino in comparison with your suggestion?
« Last Edit: October 09, 2013, 04:23:12 pm by jimkon »
 

Offline RjSa

  • Contributor
  • Posts: 21
  • Country: ve
Re: Microcontroller for begginer
« Reply #4 on: October 09, 2013, 04:51:07 pm »
An arduino is a pre-assembled board with an AVR microcontroller and all the circuitry involved to operate.

The main difference is that the arduino is pre-assembled and you wont have the need to breadboard the circuit. I´ve only used PIC microcontrollers so I can only suggest you start with a PIC.
 

Offline Alana

  • Frequent Contributor
  • **
  • Posts: 297
  • Country: pl
Re: Microcontroller for begginer
« Reply #5 on: October 09, 2013, 04:54:23 pm »
I quite like Bascom due to build-in simulator module thats good for debuging.
Programing language is a dialect of basic language or mix of basic and assembly. Hardware - just an atmega and USBasp and breadboard.
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 7374
  • Country: nl
  • Current job: ATEX product design
Re: Microcontroller for begginer
« Reply #6 on: October 09, 2013, 05:47:39 pm »
FYI, Pickit 1 and 2 are discontinued.
Are you looking into the microcontroller world as a hobby or you want it as a career? If the latter, I'm strongly against the arduino. You shouldnt take the easy way, know at least 2-3 architectures of these, and be open minded.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5022
  • Country: ro
  • .
Re: Microcontroller for begginer
« Reply #7 on: October 09, 2013, 06:17:04 pm »
Arduino is cheap, there's libraries and source code available, but... if you want to buy something to learn about microcontrollers, it may not be the best choice. It really depends on how a particular person learns something.
I personally don't think someone would learn working with microcontrollers properly, as arduino software hides away from you basic things through the built in software, things a person should understand because they'll face them when working with other microcontrollers.

PIC chips are easily available, cheap, in dip packages, the datasheets for the them have loads of info and easy to understand. Microchip also has some good application notes, tips and tricks pdf's.
The only downside is that there are few third party programmers for the chips, and the official PicKit 3 is a bit expensive. 
In my opinion , it's worth buying either just PicKit 3, or Pickit 3 with the PIC18F dev board.

 

Offline klox

  • Newbie
  • Posts: 4
Re: Microcontroller for begginer
« Reply #8 on: October 09, 2013, 09:53:57 pm »
What's your goal? If you are just looking to do some embedded C you can get the TI Launchpad MSP430 for really cheap (I got my sibling one for like $8 a year ago). There is a bit more hand-holding for you, and a ton of good documentation.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Microcontroller for begginer
« Reply #9 on: October 09, 2013, 10:30:49 pm »
I actually thought one of those TI ARM launchpads would be great for someone to start: it allows a beginner to start with an arduino like interface and simplicity, and tons of peripherals if one wishes to dive into the details via CCS.

The virtual com port is handy for debugging / communications purposes, not to mention a hardware debugger.

And it is cheaper than most Arduinos, and offers (infinitely) more value: 12 timers (can be split into more), dedicated pwm, 12-bit adc, 8 uarts, etc.

With that kind of horse power, why would anyone buy Arduino?
================================
https://dannyelectronics.wordpress.com/
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Microcontroller for begginer
« Reply #10 on: October 10, 2013, 12:37:35 am »
I agree. At least start with something modern. Your not going to take driving lesson in a model-T Ford either. Not having to deal with low level hardware is a great plus. First get to know the developments tools and get some simple projects going. You can always look under the hood later.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline rverm

  • Newbie
  • Posts: 8
  • Country: us
Re: Microcontroller for begginer
« Reply #11 on: October 10, 2013, 01:22:44 am »
I have been working with pic chips since school in 2002. using protonbasic as the basic programming software for pic chips and the mikroe pic programmer.  I also use the isis circuit simulator. its great when you want to work out the circuit details first before building the circuit. its been really useful for learning too.
 you'll find the nich of tools you prefer.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Microcontroller for begginer
« Reply #12 on: October 10, 2013, 12:10:54 pm »
You can turn the arduino into an avr programmer too. So you can write the code in Atmel Studio and flash the hex with avrdude using the arduino as ISP sketch and avrdrude setting.
The larger the government, the smaller the citizen.
 

Offline Warhawk

  • Frequent Contributor
  • **
  • Posts: 821
  • Country: 00
    • Personal resume
Re: Microcontroller for begginer
« Reply #13 on: October 10, 2013, 02:58:32 pm »
Hello all,

I totally agree with one of the posts above. You should definitely first decide, why you want to learn  an embedded development. A career or a fun ? If you choose the "fun" way, then it does not matter what you choose and arduino seems to be a good choice. Kits like MSP430 launchpad or arduino have big support and community on the web and you can make your hobby electronic stuff much "smarter" with minimal effort. To get LED blinking takes usually few minutes including installation.

If you are thinking about career of embedded developer, then the answer might be more complicated. Let me please share my personal opinion based on my current experience with embedded development (mainly HW design and FW support) in the field of industrial automation.

Embedded developer should be familiar with "concept" of embedded programming, software architecture and each step of development. He should know his development tools (linker, compiler, IDE...) and hardware (PIC, AVR, ARM..) in detail. I am not saying, that you should learn assembler first, but it is definitely benefit. Only with assembler knowledge, you can understand devil's race condition problems, critical sections etc. "toolsuites" like Arduino hide a lot of basic and important work and do it for you, which is not right I think.

When you browse the web, you can find a lot of arguments what is better, if PIC, ARM, AVR or something else. Every developer, which has became  to a true professional knows, that this is a topic with no answer.
We can not tell you what is better, because each MCU has its benefits like simplicity, robustness, availability, package , power and lot of other criteria.
Past few years many hobbyists have been switching to an ARM based MCU. It is not generally bad, but it somehow "trendy". The desire to have an excellent chip shifts the true and practical knowledge of embedded development to a second track. When I check some projects on the web
(for inspiration) , I often find very poor (means unreliable) software/firmware, but some overkill processor with million megahertz is inbuilt  ;D

Let me give you an example I saw some time ago:

Simple heating system for aquarium - STM32 gets temperature from i2c temperature sensor and based on result drives relay. Nothing bad, but i2c communication does not have any state machine and simply in a loop waits for a correct answer. (something like while( i2c_read > xxx  )... ) but what happens, when sensor dies or your mum accidentaly cut the wire. Das it mean, that relay stays on and boil all your fauna and flora  :scared: ?

There are very few reliable source code examples or design tips on the web and that is something you should focus on. The controlling system described above could be probably done with every controller on the market...

I mean "why the hell we need led flashing application with 100 MHz chips in QFP packages ?!"

We have a new girl - student in a company and she expressed her wish: "I would like to learn ARM programming". I asked her, why ARM and what she exactly means. She answered "it is modern and everybody wants it". I had to explain her, that it is better to start with something easier to configure and better learn how to make robust code, instead of _delay_ms(300) for LED blinking...

So let's go back to some serious recommendation:

- Look, what kind of chips are available in your local store, or how you can get more of them.
- I suggest to learn ansi C language - it is most common programming language for embedded.
- Consider packages - ARMs might work for you, but only few of them are in DIP package which can be used in breadboards with no problem.
- Focus on toolchain availability - opensource (benefit of AVR,)

More specifically:

ARM

+ modern, opensource toolchain (GCC+ OpenOCD)
+ cheap boards available (Discovery Kit, Launchpad)
- packages are usually not so friendly for breadboard
- configuration (startup code, initialization, time domains) is not super friendly for newbies


PIC (18F, 24F)
+ cheapest (?)
+ every chip in several different packages
+ Pickit 3
+ big portfolio
+ easy to start
- free compilers provide not extra efficient code (eg. SDCC)
- development is closely coupled with MPLAB IDE

AVR
+ cheap
+ different packages (but not as good as Microchip)
+ easy to start
+ opensource toolchain supported in AVR studio
- not sure about open source debugging


MSP430
+ launchpad available
+ opensource toolchain available or CCS without code restriction (for G series)
- not as cheap as expected from value line
- very slow debugging (experience with launchpad), not extra stable
- too much stuff in errata .....

PS: I usually start development with PIC18 or PIC24.

regards

Jiri
« Last Edit: October 10, 2013, 03:06:13 pm by Warhawk »
 
The following users thanked this post: s8548a

Offline jimkonTopic starter

  • Newbie
  • Posts: 4
Re: Microcontroller for begginer
« Reply #14 on: October 10, 2013, 04:33:12 pm »
First of all thanks for all the answers.

I want the microcontroller because i want to learn how it works,how i can program it,how i can use the tools,and maybe i will do my diplomatic at microcontroller field.
So i dont know if i want it for carrer or for fun.Maybe the answer is both of them.

If i will buy a kit it would be easier because i am begginer and i cant deside which are all the components which i need.Also it has some projects and i can start without thinking what i need for every project,something that a begginer doesnt know.

So i wanna recommend me a kit or tell me all the components that i need if i will buy a pic finally.
Also i need a book or a good tutorial step by step how i will do everything with my kit or pic.

Also i dont know if in circuit debugger is so important and what exactly do.
« Last Edit: October 10, 2013, 04:35:53 pm by jimkon »
 

Offline filip_cro

  • Regular Contributor
  • *
  • Posts: 71
  • Country: hr
Re: Microcontroller for begginer
« Reply #15 on: October 10, 2013, 05:18:14 pm »
If you are just starting in circuit debugging won't be needed but you will get it with most programmers.

Just buy:
Breadboard (real, not some 200 holes cr*p)
Jumpers (or buy wire and made some)
few MCU (use something not that old but cheap, you will blow 5 first week  :P)
programmer (Pickit 3 or AVR Dragon or ...)
power supply (battery and linear regulators will work)
LEDs and resistors for them
buttons

After you learn some basic you will know what to buy next.

I'm using Atmel's AVR (atmega168) and tutorials from:
http://www.avrfreaks.net/
http://www.newbiehack.com/
 

Offline jimkonTopic starter

  • Newbie
  • Posts: 4
Re: Microcontroller for begginer
« Reply #16 on: October 11, 2013, 08:53:00 am »
Thanks for all the answers.Finaly i will buy an arduino kit and i will try to program it in c instead of using his language "wiring".

Does anyone know how i can use c language instead of "wiring" in arduino?


 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Microcontroller for begginer
« Reply #17 on: October 11, 2013, 10:58:39 am »
Quote
Does anyone know how i can use c language instead of "wiring" in arduino?

Just use it - no how. C is natively supported by the arduino ide as its back-end is gcc.

Alternatively, you can use CB for Arduino - a far better ide in my view.
================================
https://dannyelectronics.wordpress.com/
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: Microcontroller for begginer
« Reply #18 on: October 11, 2013, 02:07:34 pm »
Or you can download Atmel Studio 6 and the Visual Micro plugin for Arduino development (http://www.visualmicro.com/). That way you can write your code in a "real" environment and as a bonus you get a rudimentary debugger that is so markedly lacking from the basic Arduino IDE.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline geraldjhg

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Re: Microcontroller for begginer
« Reply #19 on: October 11, 2013, 11:05:20 pm »
hi
if you want something very usefull and you can get things working real fast is
BASCOMAVR and atmel avr chips-i would choose avr mega88 to start with
you will also need a pc with a parallel port to keep the programmer real simple ( 2 resistors)
the whole idea is so simple and usefull.

bascomavr by mcs electronics has an full working demo up to 4k size
saludos from far away

G E R A L D
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Microcontroller for begginer
« Reply #20 on: October 11, 2013, 11:30:44 pm »
Thanks for all the answers.Finaly i will buy an arduino kit and i will try to program it in c instead of using his language "wiring".

Does anyone know how i can use c language instead of "wiring" in arduino?

Also my recommendation would be to get some AVR chips by themselves and some of those 3 pin 16mhz oscillators so you can program them and use them without having to use the whole arduino board.

My recommendation would be the Uno R3 Arduino because of the socketed chip. The Leonardo and Mega series have soldered chips, so you'd definitely need separate DIP chips.

I've been able to get several free samples from Atmel and if you want to go that route, try to get:

1. ATTiny 45 or 85 (4k or 8k) 8 pin dip
2. ATTiny 2313 or 4313 (2k or 8k) 20 pin dip
3. ATTiny 44 or 84 (4k or 8k) 14 pin dip
4. ATMega328P (same as on the Uno) 28 pin DIP
5. ATMega644/1284 (32/64/128k) 40 Pin DIP

Keep the following in mind:

1. The Tiny 45 and 85 are very good migration points from the Arduino if you don't need a lot of pins or memory and need the ability to read analog data. It has the ability to be configured with 4 ADC inputs. And they're pretty cheap.
2. The Tiny 2313 and 4313 have more pins but no analog channels, all inputs are digital only. (high or low)
3. Think of the 44/84 as higher pinned version of the 45 and 85. You get more I/o and more ADC pins.
4. The 328p is the same as on the arduino you could technically program the chip and pull it out with a 3 pin oscillator and power.
5. 644/1284 Similar to the 328p but has more of everything. More ram, more ADCs and more pins.

Get the datasheets for all of them, the pinouts are different.

Here's some general info: http://avrprogrammers.com/devices/index

The larger the government, the smaller the citizen.
 

Offline geraldjhg

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Re: Microcontroller for begginer
« Reply #21 on: October 14, 2013, 03:59:35 pm »
hi
nice IDE (interactive development enviroment) in
bascomavr from www.mcselec.com
forum from      www.avrfreaks.net
simple programmer
get things gonig real fast

G E R A L D
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Microcontroller for begginer
« Reply #22 on: October 15, 2013, 12:32:51 am »
hi
nice IDE (interactive development enviroment) in
bascomavr from www.mcselec.com
forum from      www.avrfreaks.net
simple programmer
get things gonig real fast

You certainly like that program.
The larger the government, the smaller the citizen.
 

Offline silent

  • Contributor
  • Posts: 31
  • Country: pl
    • Silent's Homepage
Re: Microcontroller for begginer
« Reply #23 on: October 15, 2013, 01:01:05 am »
I you will pick an AVR, I would suggest a "bigger" one, like ATMega, not ATTiny - it has much more peripherials and you will get bored quicker with Tiny.

From my point of view it is better to choose a platform with better support / higher community and number of open projects for learning. If you will learn how to use one MCU, you will be able to use any other one.
 

Offline idolstar

  • Newbie
  • Posts: 8
Re: Microcontroller for begginer
« Reply #24 on: October 23, 2013, 04:35:57 pm »
I'm a hobbyist and I started with the Arduino and have recently been using some PICs. One thing that I found really useful is that in my area there was an Arduino meet-up group where people got together to show off projects and share tips. This was useful, inspiring, and gave me a lot of ideas.

Especially in a non-professional context the Arduino community groups can be a great resource when starting out.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf