Programming PIC cips in ASM

Thread Starter

CVMichael

Joined Aug 3, 2007
419
I'm trying to learn ASM for PIC programming, but I cannot find good sources.
Most of the things I find is just an explanation on how PIC chip works, but not on the ASM itself...

Here is a link I found that is pretty good, but still now good enough, because it's just an introduction:
http://www.mikroe.com/en/books/picbook/0_Uvod.htm

I need something more extensive, with sample code too
 

Dave

Joined Nov 17, 2003
6,969
I'm trying to learn ASM for PIC programming, but I cannot find good sources.
Most of the things I find is just an explanation on how PIC chip works, but not on the ASM itself...

Here is a link I found that is pretty good, but still now good enough, because it's just an introduction:
http://www.mikroe.com/en/books/picbook/0_Uvod.htm

I need something more extensive, with sample code too
Without you specifying your m/c of choice, your IDE, or your application I would suggest you look at the User Guides section at microchip.com.

Dave
 

Thread Starter

CVMichael

Joined Aug 3, 2007
419
Thanks for the link

I did not specify because I thought that there is a general one that explains ASM programming for any PIC chip.

The chip I have is PIC16F877, and I program it using a Velleman KIT K8048
This KIT came with MPASM compiler and it's own programmer software "Progpic2"
 

spar59

Joined Aug 4, 2007
64
The site you mention looks pretty good at a first glance - it seems to cover most issues.

There are quite a few text books out there related to PIC programming -unfortunately in common with most technical literature they are not cheap.

I bought one about 3 years ago "Programming and customizing PICmicro Microcontrollers" by Myke Predko, ISBN 0-07-136172-3.

I found it invaluable and I have certainly had my money's worth despite its high price of £30+, it obviously does not cover the latest devices but I still refer to it on a regular basis since the principles remain good and when I eventually tire of it I can use it as a door stop since it runs to nearly 1200 pages.

Bear in mind that much of the PIC range is a few years old and still being manufactured, hence a slightly out-of-date book is still going to be rather useful so it could be time to try a search on e-bay or similar!

However Microchip's own website has huge amounts of technical info and application examples - and it is all free!

The PIC being a RISC processor has a very small instruction set and hence the assembler coding is fairly straightforward - the instruction set summary in the datasheet for the appropriate device lists what instructions are available and what they do. I found that getting used to MPLab IDE (which contains MPASM) was the most difficult bit rather than understanding the PIC instructions.

If you download a few example programs (.asm files) and load them into MPLab IDE it is amazing how much you can learn by examining the code - examples from Microchip which are also available in text format for bedtime reading have lots of comment text to explain what is going on.

Text books are most valuable in suggesting neater, more efficient ways of doing things that you may have never considered on your own.

PICs are great fun - it is worth persevering.

Steve.
 
Top