Microcontroller for begginer - Page 1
Forum section: electronics / general

author: jimkon
author_rank: Newbie
timestamp: October 09, 2013, 01:09:46 pm
content: 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 arduinokithttp://www.amazon.com/Arduino-Ultimate-Starter-Includes-Instruction/dp/B00BT0NDB8/ref=sr_1_6?ie=UTF8&qid=1381323857&sr=8-6&keywords=arduinoand 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.

author: filip_cro
author_rank: Regular Contributor
timestamp: October 09, 2013, 02:03:05 pm
content: 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.

author: RjSa
author_rank: Contributor
timestamp: October 09, 2013, 02:46:53 pm
content: 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 can4. It has a programmer, I dont know if it has a debugger.

author: jimkon
author_rank: Newbie
timestamp: October 09, 2013, 03:50:47 pm
content: 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?

author: RjSa
author_rank: Contributor
timestamp: October 09, 2013, 04:51:07 pm
content: 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.

author: Alana
author_rank: Frequent Contributor
timestamp: October 09, 2013, 04:54:23 pm
content: 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.

author: tszaboo
author_rank: Super Contributor
timestamp: October 09, 2013, 05:47:39 pm
content: 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.

author: mariush
author_rank: Super Contributor
timestamp: October 09, 2013, 06:17:04 pm
content: 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.

author: klox
author_rank: Newbie
timestamp: October 09, 2013, 09:53:57 pm
content: 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.

author: dannyf
author_rank: Super Contributor
timestamp: October 09, 2013, 10:30:49 pm
content: 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?

author: nctnico
author_rank: Super Contributor
timestamp: October 10, 2013, 12:37:35 am
content: 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.

author: rverm
author_rank: Newbie
timestamp: October 10, 2013, 01:22:44 am
content: 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.

author: Stonent
author_rank: Super Contributor
timestamp: October 10, 2013, 12:10:54 pm
content: 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.

author: Warhawk
author_rank: Frequent Contributor
timestamp: October 10, 2013, 02:58:32 pm
content: 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 inbuiltLet 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 acorrectanswer. (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?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 newbiesPIC (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 IDEAVR+ cheap+ different packages (but not as good as Microchip)+ easy to start+ opensource toolchain supported in AVR studio- not sure about open source debuggingMSP430+ 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.regardsJiri

author: jimkon
author_rank: Newbie
timestamp: October 10, 2013, 04:33:12 pm
content: 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.

author: filip_cro
author_rank: Regular Contributor
timestamp: October 10, 2013, 05:18:14 pm
content: 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)programmer (Pickit 3 or AVR Dragon or ...)power supply (battery and linear regulators will work)LEDs and resistors for thembuttonsAfter 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/

author: jimkon
author_rank: Newbie
timestamp: October 11, 2013, 08:53:00 am
content: 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?

author: dannyf
author_rank: Super Contributor
timestamp: October 11, 2013, 10:58:39 am
content: QuoteJust 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.

author: Kremmen
author_rank: Super Contributor
timestamp: October 11, 2013, 02:07:34 pm
content: 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.

author: geraldjhg
author_rank: Regular Contributor
timestamp: October 11, 2013, 11:05:20 pm
content: hiif you want something very usefull and you can get things working real fast isBASCOMAVR and atmel avr chips-i would choose avr mega88 to start withyou 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 sizesaludos from far away

author: Stonent
author_rank: Super Contributor
timestamp: October 11, 2013, 11:30:44 pm
content: Quote from: jimkon on October 11, 2013, 08:53:00 amAlso 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 dip2. ATTiny 2313 or 4313 (2k or 8k) 20 pin dip3. ATTiny 44 or 84 (4k or 8k) 14 pin dip4. ATMega328P (same as on the Uno) 28 pin DIP5. ATMega644/1284 (32/64/128k) 40 Pin DIPKeep 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

author: geraldjhg
author_rank: Regular Contributor
timestamp: October 14, 2013, 03:59:35 pm
content: hinice IDE (interactive development enviroment) inbascomavr fromwww.mcselec.comforum fromwww.avrfreaks.netsimple programmerget things gonig real fast

author: Stonent
author_rank: Super Contributor
timestamp: October 15, 2013, 12:32:51 am
content: Quote from: geraldjhg on October 14, 2013, 03:59:35 pmYou certainly like that program.

author: silent
author_rank: Contributor
timestamp: October 15, 2013, 01:01:05 am
content: 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.

author: idolstar
author_rank: Newbie
timestamp: October 23, 2013, 04:35:57 pm
content: 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.