Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

Possible Duplicate:
Books about pic18f?

I'm looking for good book for a beginner that would explain basic things about PIC microcontrollers, MPLAB IDE and MPLAB C compiler and programming in C.

I have decent, but basic knowledge of digital electronics. I already know how to write programs in C, so I just need some kind of fast transition to C language for embedded systems. It would be great if book includes examples.

share|improve this question
1  
Book recommendation requests are not suitable questions for this site, as discussed here on our Meta. They're subjective and have many potentially correct answers. They are, however, a great topic to discuss in Electrical Engineering Chat! –  Kevin Vermeer May 10 '12 at 16:54
add comment

closed as not a real question by Kevin Vermeer May 10 '12 at 16:50

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 2 down vote accepted

You are going about this the wrong way. Unlike programming large machines with operating system, on microcontrollers you have to know how things work down to the hardware. That means now a compiler gets in the way by obscuring things, as apposed to dealing with all that machine stuff you don't have to care about on a large system. Writing in a HLL on a microcontroller can still be useful, but only if you understand the underlying hardware.

Blindly using a compiler and calling library routines to manage the hardware may sound like the easy way to go, but it's not good for learning, and since you're really not learning what is going on at the low levels, stuff will happen and you won't understand what is going on.

So to really answer you question, the best book for learning a PIC 18 is the datasheet for that PIC 18. If you are looking for something generic to start with, try the 18F2520. That's a easy to handle 28 pin part, and comes with a good mix of general peripherals. It also has plenty of RAM and program memory to do lots of useful projects.

When you first read the datasheet, you need to look carefully at the parts that talk about the general architecture, like the memory model, instruction set, stack, pointer registers, etc. That will be the same for all PIC 18. Different PIC 18 models vary in the amount of memory and mix of peripherals. Once you can write basic code using the core, you can try out peripherals one at a time and learn them individually.

As for MPLAB, that is a separate document. Actually MPLAB isn't a big deal to learn. What takes more is the assembler, the linker, possibly the librarian, and how they interact and how to use them. Once you get all that, you can throw in a compiler, but now you'll understand what it's actually doing and therefore what the various gotchas and restrictions are that you just don't see on big systems.

share|improve this answer
    
Thanks ! I've started reading the datasheet and also a book called "Advanced PIC Microcontroller - Projects in C From USB to RTOS with the PIC18F Series". I'm reading simultaneously and they are pretty much the same, except some things in book are skipped over, and some are easier to understand. Thanks again for your detailed answer :) –  xx77aBs May 12 '12 at 19:07
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.