View Full Version : suggest a good read on microcontrollers?
n8huntsman
01-02-2011, 03:19 AM
Sure, I can click the "write" button in the pickit 2 programmer but I'd really like to be able to actually comprhend the stuff in the asm file and understand how the pic works. I'm trying to go through the pickit tutorials but they seem to be geared towards people who have experience with microcontrollers. Can someone suggest a book or some other media that can get me started? Amazon has these (http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=pic+microchip#/ref=sr_st?keywords=pic+microchip&qid=1293956326&rh=n%3A283155%2Ck%3Apic+microchip&sort=reviewrank_authority); but there are too many to choose from.
David_AVD
01-02-2011, 04:43 AM
Mike Predko's book is a popular one I believe:
http://www.amazon.com/Programming-Customizing-PIC-Microcontroller-Electronics/dp/0071472878/ref=sr_1_24?s=books&ie=UTF8&qid=1293961378&sr=1-24
Skunberg
01-02-2011, 09:22 AM
I'd maybe ask Phil Short for a suggestion. PM him.
P. Short
01-02-2011, 10:56 AM
Right now I don't have any suggestions. My knowledge about the micro-controllers is based on hanging out at Borders a while back and reading the books there (which would be quite dated by now) and reading datasheets on-line.
Edit - I'd go with the Predko book that David lists above. It is a good starting place, although it will only take you part of the way.
DynamoBen
01-02-2011, 09:02 PM
Are you sure you want to start with ASM? While ASM has only a handful of commands it can be a challenge writing code when you get beyond the basics. I've found that writing with ASM is an art and requires a lot of patience.
Have you considered starting with a higher level language (C or BASIC)? The Predko book covers both. Personally I started with PicBASIC up until recently when I switched to the Parallax SX then to the Propeller (which I love).
P. Short
01-02-2011, 10:30 PM
Ben brings up a good point. Where are you intending to go with this? Just better understand what is out there, or develop something new? While I have a tendency to go with assembly language, that is certainly not the best choice for most people.
n8huntsman
01-03-2011, 01:44 AM
I really don't know. I guess I'd just like to understand how it all works so the language doesnt matter too much. Whatever is the most common I guess. I've been thinking about learning this stuff for a few years and coincindentaly, I've also been thinking about building a blinky flashy show for a while. I talked to Tweist and he referred me on to this site so I decided this would be a perfect first project.
I guess my goal is this: I have a Jandy Aqualink control panel on my pool. It has control panel in the house that uses RS-485 to the main panel. I'd like to be able to interface that with my server so I can have web and mobile access to all the controls. I'd also like to interface it with my RS-232 home automation base station. They sell an RS-232 to Jandy RS-485 adapter (http://www.jandy-downloads.com/pdfs/AquaLink_RS_Serial_manual.pdf) but it's $350. They also have a USB to RS-485 (http://www.jandy.com/pdfs/7271revE.pdf)adapter for $200. I have no idea of how to tell if it's anything special or if a generic one would work. Maybe I can get some info on where to start on this project too? Maybe I just need to sniff the data off the remote panel somehow? All the commands and responses are given in that manual so I don't think it would be too hard.
Entropy
01-03-2011, 10:16 AM
In my case, my first exposure to microcontrollers was a microcontrollers class in college. We used AVRs instead of PICs, and I've basically been an AVR guy since then. (Although I'm starting to move to ARM this year.)
In my case, I have a general rule - if it can't be targeted by GCC, I'm far less likely to touch it, which is why I haven't ever worked with PICs.
The Arduino environment is a good way to get a basic start in microcontrollers, although I haven't found any good references as to how to make the leap from the Arduino dev environment to AVR-GCC. (Same hardware, but more efficient/slightly more difficult software).
Another option is to find some good example code for the microcontroller you want. The avr-libc page has some fairly well commented C source code.
I would not recommend ASM for someone new to microcontrollers.
DynamoBen
01-03-2011, 07:52 PM
If you are brand new to microcontrollers, you don't plan to do this for a living, and you want to get off the ground quickly take a look at the Parallax stuff.
For entry level learning the BasicStamp is a good choice. It has been around for years and has lots of great documentation (everything from the basics of electronics, to more advanced topics). While not the fastest processor in the world its very easy to use and is a good way to learn (btw its a PIC at its core). I use Stamps at work to quickly setup test gigs and monitor equipment. However if you are like me you will quickly out grow it. (BasicStamp kits can be purchased at Radio Shack or at the Parallax site)
If you plan on doing more advanced stuff or you want more speed and power then the Propeller might be a good choice. It's an 8 core processor (no need to learn interrupts), the IDE is free, and there is a fair amount of documentation and code. All of my recent work uses the Propeller largely because its hobbyist friendly, approachable, and very powerful (you can do video with a prop).
Ducking before the PIC, AVR, and Ardunio folks kill me. ;)
Entropy
01-04-2011, 10:09 AM
I don't like the Basic Stamp as they offer basically no growth/migration path to anything else.
I'm also avoiding the Propeller for the same reason - they only offer different packages of the same chip currently, there is no way to "downscale" a project that doesn't need all of the resources offered, and there is no way to "upscale" to a larger controller.
Also, 4 clocks per instruction in this day and age, combined with the fact that the Prop uses a weird bytecode-interpreted language (There are ways to do native, but they cost money and are apparently quite difficult) really cripples the chip despite running at something like 80 MHz and having 8 cores. If you want something "beefy", go ARM - It also has a learning curve, but a different one. (No need to deal with thread synchronization...)
However I would not recommend ARM for someone starting - AVR (including possibly starting with basic Arduino) is a nice clean architecture with a VERY robust free C toolchain (GCC-based), and plenty of "up/down-migration" choices.
Lots of good resources at Cornell's ECE476 (now 4760) page - http://courses.cit.cornell.edu/ee476/ - This course is where I first learned my microcontroller skills and many of the materials are published on the course site.
"Not having to deal with interrupts" is a horrible reason to choose a microcontroller - polling I/O is awfully inefficient, and learning how to work with interrupts is not hard at all - it's included in the "blinky" tutorials for nearly any microcontroller.
DynamoBen
01-04-2011, 11:14 AM
I'm not trying to start a debate but I thought responding to these points was important.
I don't like the Basic Stamp as they offer basically no growth/migration path to anything else.
Any compiler that supports BASIC is a growth path. I have been developing on the PIC for years using PICBasic, works great.
I'm also avoiding the Propeller for the same reason - they only offer different packages of the same chip currently, there is no way to "downscale" a project that doesn't need all of the resources offered, and there is no way to "upscale" to a larger controller.
You are correct in that you can't go down, but the Prop II is coming out this year so you will be able to go up. With that said if I need an inexpensive or smaller package processor I either use the SX or a small Pic.
Also, 4 clocks per instruction in this day and age, combined with the fact that the Prop uses a weird bytecode-interpreted language (There are ways to do native, but they cost money and are apparently quite difficult) really cripples the chip despite running at something like 80 MHz and having 8 cores.
The Prop development environment is object oriented and the weird byte-code language not only saves on space but is very similar to python. You have 4 choices of languages for the Prop
Spin (byte code) - takes up very little space, but is a touch slow
ASM - Very fast, but uses more space
BASIC - Compiles code from BASIC to ASM
C - There are both free and commercial compilers
"Not having to deal with interrupts" is a horrible reason to choose a microcontroller - polling I/O is awfully inefficient, and learning how to work with interrupts is not hard at all - it's included in the "blinky" tutorials for nearly any microcontroller.
Interrupts is one reason (of many) that hobbyists enjoy the prop. With that said, another way to put this is I have 8 processors in one while interrupts do work well I don't miss them, I launch my code into a new processor and I'm done.
Don't get me wrong I don't dislike other micros, and I have used Pics for years, I just find using the Prop enjoyable and flexible. When I started with the Prop initially I missed the onboard hardware (UART, EEProm, I2C) of the PIC line but I got used to it. Now, if I need a UART or A/D converter on a pin I just load some code and done. If you want to check out a project that uses the power of the Prop check out my PropController (http://doityourselfchristmas.com/forums/showthread.php?t=12334).
And above all else remember, opinions are like belly buttons everyone has one. ;)
kychristmas
01-04-2011, 01:05 PM
I was with you. I'm now starting to understand it. After you do some basic reading and want to take it a step further, look at some of the source code for the Renard debug firmware. I had been working creating standalone wireframe controllers. I didn't implement anything yet, but I now have standalone 8 channel controllers customized for two of my future wireframes. These use basic, but custom code.
Also, there was some code provided for a different PIC to control 12 Output Falling Snow LED lights. I have that and while I was waiting for the PICs to come from Mouser, I modified the code to work with 8 outputs on the 16f688's I had on-hand.
In short, just get some code and play around with a Breadboard or a Renard controller. I have been having a lot of fun. Of course, you don't have to be in a hurry. For the first year, I was just a button pusher. As a result of the Falling Snow stuff, I decided I wanted to understand more.
My goal for this year is to understand how to manage incoming and outgoing data to the PIC.
Good Luck!
Edit: Sorry, I have no business replying to this thread. I read your first post and responded. Clearly the experts have chimed in. I assumed you were talking just learning PIC stuff. I'm hush up now!
David_AVD
01-04-2011, 04:51 PM
Even if you choose to program in a HLL like C, learning the basics of assembler is a good thing in the micro-controller world.
DynamoBen
01-04-2011, 04:55 PM
Even if you choose to program in a HLL like C, learning the basics of assembler is a good thing in the micro-controller world.
True, you are bound to use it at some point.
ppohlman
01-04-2011, 09:09 PM
I'm a little late to this conversation, but THIS (http://www.amazon.com/PIC-Microcontrollers-Know-All-Newnes/dp/0750686154/ref=sr_1_1?s=books&ie=UTF8&qid=1294193283&sr=1-1) book is one that I picked up and have really liked.
I actually found it on overstock.com back in the day for a really good price.
n8huntsman
01-05-2011, 05:05 PM
Thanks for all the info on my options. I'm sure some day I'll experiment with each of those. For now, I'm gonna stick with the PIC just for the reason that I already have the PICKIT2. I'm happy to say I was able to manipulate the "Hello World" code to light up RC1 instead of RC0... LMAO. That's the extent of my progress. I still don't quite understand the code. The W register and the moving, copying, etc... all the variables are confusing. I'm sure it will click though. I ordered "Programming and Customizing the PIC Microcontroller" by Myke Predko. It should arrive in a couple days. Hopefully it will get into assembly language as well because it sounds like that will be beneficial to learn.
David_AVD
01-05-2011, 10:19 PM
I think you'll do fine with the PicKit2 and that book. The best way to start learning is to modify known working examples in small ways to see the effects. Don't try to rework more than one thing at a time.
glaforce
01-06-2011, 08:09 AM
Has anyone used this book it was called Easy Pic N and is now called Easy_Microcontroln. It looks like it maybe a good starting point. I to have been looking for a good beginners starting book.
http://www.amazon.com/Easy-microcontroln-beginners-microcontrollers-square/dp/B0006S5LVY
budude
01-06-2011, 03:01 PM
Thanks for the tip on the book David_AVD - I just got mine from Amazon - had to put that gift card to use somehow! Looks like a pretty thorough book.
n8huntsman
01-07-2011, 02:02 AM
That was quick. How'd you get yours already? I ordered mine from Amazon too, and it wont be here till Monday!
Thanks for the tip on the book David_AVD - I just got mine from Amazon - had to put that gift card to use somehow! Looks like a pretty thorough book.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.