PDA

View Full Version : [Question(s)] How to start off in microcontrollers?



Jheckman1986
05-28-2012, 03:42 PM
First of all i wanted to say hello and introduce myself to the forum!

Hello!


1. I have no experience whatsoever in programming!
2. I have basic understanding of electronics!
3. I am OK with soldering.


On to my needs....

I want to get into robotics as a hobby but i dislike the idea of using arduino simply because it does not seem to be as hands on like i want, my intention is to purchase the PICkit 3 system and program PIC micro controllers myself.

I want to start off by building a coffee can sized robot that moves around and detects obstacles and learns from them(I suppose that is a bit much), eventually i want to build up to robotic arms and stuff like that eventually to full sized arms and limbs.

Can anyone recommend any good books on starting off with programming a micro controller and secondly are there any good books that can dumb down the pin layout of a micro controller so i can understand how to hook it into a design?

I have another post on another website that may help to fill in any gaps, but it seems every one on that website wants me to use commercial equipment which is unacceptable to me since i feel it will cheapen the learning experience.
http://www.electronicspoint.com/start-off-microcontrollers-t248467.html#post1468756
What would you suggest?

jwatte
05-29-2012, 01:05 AM
"learning" from moving around is known as SLAM -- Simultaneous Localization And Mapping. It's pretty advanced stuff, because you have to build a geometric representation of where the robot (sensor) is, and remember it. Neither a PIC nor a AVR/Arduino will have enough RAM to actually store such a map, nor enough CPU to process anything more than the most basic geometry.
I would recommend you get one board for controlling the motors and doing sensing -- this can be PIC or AVR or whatever -- and another board for CPU/processing/memory. That second board could be a Raspberry Pi, or a BeagleBone, or something like that.
Note that you can't really "dumb down" the pin layouts of CPUs. They are made with certain requirements, and won't work if you don't fulfill those requirements. Similarly, if you don't use a pre-made board for the CPU, then you will also have to learn how to program all the peripherals for the CPU (things like analog and digital input and output signals, serial ports, USB, etc) from scratch, by reading the data sheet. If you're a seasoned systems programmer, then you can learn a new chip in a few weeks. If you're a newbie -- well, I wouldn't recommend that approach :-)

What I would do is start out with an Arduino Uno, ready-made board, just to get my feet wet. Once I know how to program that board and make it do things, I could build my own version of the Arduino using a DIP Atmega 328p CPU (about $5) on a perfboard or breadboard of some sort. You don't even need a crystal for this chip -- by default, it comes up with an 8 MHz internal RC oscillator. Just add a 1 uF ceramic decoupling capacitor, and +5V and ground, and you're ready to go!

Trying to learn programming, and circuit board layout, and the particulars of some embedded CPU, all at the same time, is like trying to learn math, by reading a textbook written in Latin, in invisible ink. You won't get anywhere. Tackle one thing at a time!

Fanatic
05-29-2012, 01:08 AM
Pics are inexpensive(1$-4$) = noob friendly(I have fried my share of pics learning), and very hands on. All of them on microchip.com, some on ebay and other sites.
The programmer is the most expensive(I bought a 20$ pickit2 clone)

To start:
Pick your programming language(see how many sample code of that language for pics can you find, the more the easier it will be to learn)
You might also have to download some software:
"Hi-Tech" pic drivers and mplab compiler(write code, links code with libraries/headers, loads code into pic, etc.)....least that's what I use.

Learn to read pic datasheets (try it, download one ie. pic18F4321 datasheet, then go to pin diagrams)
-Pin diagrams will tell you the names of the pins. (get familiar with)
-Every pic command in sample codes can be found in the pic's datasheets.
-(if you want to reprogram your pic without removing it from your circuit every time) Find the pic pins needed to directly hook up your programmer from PC to PIC. (MCLR, PDAT, PCLK, VDD,VSS) vdd and vss is + & -.
-Understand and set up the input/output pins (PORTA,PORTB,etc.)
-Once you're ready for robotic limbs, check out pic timers.

Hell just try one of the beginner sample codes like flashing an led, that's how I started to learn what does what on the pics.
Pick any pic to start out since you won't understand all the stats to compare. (I recommend multiple cheap ones in case you fry them)

Doesn't matter what uController or language you start out with, once you learn one.....

jstarne1
05-21-2013, 01:20 PM
@jheckman if your looking for an inexpensive learning platform a EZB uses a Atmega 128 with 40mhz clock. It has a wireless Bluetooth connection to be controlled by a PC. You can learn scripting , navigation and such that way but lots of the hard work is done for you. Its software called EZ builder. Its from EZ-robot.com if you want to check it out and see if its something you want to start with.