On Thu, 18 Apr 2002 11:01:55 -0400, M. Adam Davis wrote: >So the gap you are running into is taking these small >instructions and forming them into a larger more complex >program. ..snip... >This gap will be difficult for you to cross without a good >understanding of binary logic and program flow. The >instructions perform such little changes that it's much like >building a castle from legos - it takes only three dozen >different types of pieces, but how they are attached to each >other (and the fact that you use hundreds of them) make the >castle. > >There is, for instance, no multiply or divide. These are formed >by a series of additions or subtractions, respectively, which >the chip can do. > >If you are impatient, you can likely go to your local bookstore >and get books on the pic. One which may be useful to you is >"Programming and Customizing the PICMicro Microcontrollers" by >Myke Predko - I found one in my local B&N. All very good ideas. But here's actually a great application for one of the inexpensive C compilers for the PIC like CCS PCM, which can be had for a very reasonable price of less than $100. Once the "newbie to PIC" programmer has the usual array of Microchip reference materials for his chip (datasheet and midrange reference guide) and maybe some PIC specific tutorials like Myke Predko's mentioned above, then the user can sit down and code some basic functions in C and study the resulting list file and code generated. The CCS compiler also has an extensive library for peripheral funtions, including software UARTS. That gives you lots of "pre-built" functions you can study and dissect in assembler. It's a great technique for understanding how, for instance, you make a multiply or divide function out of adds, subtracts, shifts, etc. By studying the code and PIC references, one can see how higher level constructs are formed from very simple instructions. Another often overlooked aspect of C compiler use (especially for low end chips like the PIC) is that you can always include as much or as little assembler code as you like. With most C compilers you can even code your entire application in assembler, if that suits you. Once a basic understanding of how the C compiler makes working code from all the PIC "bits and pieces", you can confidently program some large and complex tasks even on a chip as humble as the 16F84. Of course, I'd always suggest that any user work at fully understanding the chip at the assembler level. Being intimately familiar with all of the hardware registers and functions is a requirement for fully understanding your design. It's always a blend of hardware and software, one can't work correctly without good design practices in the other. Matt Pobursky Maximum Performance Systems -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics