Searching \ for ' thesis programming help' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/microchip/devprogs.htm?key=programming
Search entire site for: 'thesis programming help'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] thesis programming help'
2002\04\18@101112 by jcoe

picon face
I'm having trouble learning how to program this chip (PIC16F84 form
microchip). It's for a simple application, digital pulse train input, 4Mhz
clock, used to determine speed of incoming signal. Programmer is
assembled...circuitry for device and sensor is fairly simple and almost
complete. The only problem here is that I'm course 2 and I have no idea how
to program at such a low level? where's "multiply?" where's "divide?" I've
read enough to understand the architechure of the chip, the memory
registers, and how data flows within it, but I can't for the life of me,
decipher what these "btwscf" commands actually accomplish regarding my end
goal!

any suggestions? perhaps some similar sample programs with nicely detailed
comments? i'd really appreciate it. thanks!

Jonathan

***************************************
Jonathan A. Coe
Mechanical Engineering - Class of 2002
Massachusetts Institute of Technology
532 Beacon St.
Boston, MA 02215
spam_OUTjcoeTakeThisOuTspammit.edu
***************************************

--
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


2002\04\18@110054 by M. Adam Davis

flavicon
face
So the gap you are running into is taking these small instructions and
forming them into a larger more complex program.

There are a few good PIC tutorials on the internet, one of which is
found here:
www.mstracey.btinternet.co.uk/pictutorial/picmain.htm
(found using Google - there are others, you can check http://piclist.com
for aid in finding them)

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.

Another resource you have at your fingertips is MIT itself.  There are
many people there who use or have used PICs, and as the PIC matures
there'll be more.  I imagine you can do a homepage search on MIT servers
and find some students there who could give you some first hand help.

If you give us a good idea of what exactly you are trying to accomplish
with your program, we can point you to projects which are similar.
There are frequency counters, for instance, and engine tachometers
which may suit your needs with only a little modification.

-Adam

Jonathan A. Coe wrote:

{Quote hidden}

--
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


2002\04\18@120529 by Matt Pobursky

flavicon
face
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...
{Quote hidden}

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


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...