gnupic: Newb Question


Previous by date: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Peter Stuge
Next by date: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Haley Clark
Previous in thread: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Peter Stuge
Next in thread: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Haley Clark

Subject: Re: Newb Question
From: Byron Jeff ####@####.####
Date: 29 Jan 2011 18:48:31 -0000
Message-Id: <20110129190857.GA8723@mail.clayton.edu>

On Sat, Jan 29, 2011 at 11:29:17AM -0500, Keith Vance wrote:
> I'm a little bit lost and need some help.
> 
> I'm not understanding how all of the pieces of the puzzle fit together.

OK. Shoot.

> So I use gpasm to compile my application that will run on the PIC?

Assemble is the name of the process, but yes.

> 
> How do I get the application on the PIC?

You need to program the PIC. Traditionally this is done with a programmer.
If you have a PIC that is self programmable, then you can load a program
that can load other programs into it. This is called a bootloader.

> 
> And then what do I use gplink for?

gplink is used to stitch separate program modules together into a single
program. Traditionally programs are assembled in absolute mode, where each
and every address of every item is specified in the actual program. A
different mode called relative mode instead separates elements of the
program (code, data, variables, etc.) into different sections and generates
addresses for each relative from the beginning of the section. The linker
(gplink) can then take multiple modules and put all the like elements
together and fix all the addresses so that everything runs cleanly.

> 
> I read through the gputils 48-page manual, but I'm still not getting it.
> 
> I've got the gputils compiled on my Mac and I have PicKit 2 with a demo board and couple of different microcontrollers (e.g. PIC16F690). 

OK. So you have the tools, and you have a programmer. So that's progress.

> 
> If someone has or knows of a Web site they can link me to, that's probably what I need.

Actually I'm going to put another thought into your head. Unless you are
trying to generate a very high performance application, you may not want to
spend much time working in assembly. There are quite a few high level
languages available for the PIC, with JAL arguably being the best of the
bunch. You can find the current version 2 of JAL here:

http://www.casadeyork.com/jalv2

And since it is open source, it shouldn't be too difficult to compile up on
your Mac. There is a tutorial reference here:

http://www.casadeyork.com/jalv2/jalv2/index.html

JAL also has a very extensive library of routines for controlling most of
the features of the PIC. A tutorial for the library is here:

http://code.google.com/p/jallib/downloads/detail?name=Tutorial_Book_0.3.pdf

Now back to the original point. My suggestion to you is to work your way
backwards in the process since this is your first time. Development has a
long toolchain:

source -> compiler -> [optional linker] -> programmer -> chip -> target -> testing

If something doesn't work you don't know in the chain where it is broken
when you're trying to do everything together. So work backwards by taking a
known program such as the set of Blinky LED programs that Wouter has
generated here:

http://www.voti.nl/blink/index.html

Take the hex file and use pk2cmd to program a part and test. Once you are
sure then work your way backwards until you can write your own source and
run it through the entire chain.

Hope this helps,

BAJ

> 
> Thanks,
> Keith
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 

-- 
Byron A. Jeff
Department Chair: IT/CS/CNET
College of Information and Mathematical Sciences
Clayton State University
http://cims.clayton.edu/bjeff

Previous by date: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Peter Stuge
Next by date: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Haley Clark
Previous in thread: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Peter Stuge
Next in thread: 29 Jan 2011 18:48:31 -0000 Re: Newb Question, Haley Clark


Powered by ezmlm-browse 0.20.