Re: Newb Question

"Haley Clark" <[email protected]> Sun, 30 Jan 2011 13:44:20 -0700
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
If it is any help I have put my 'tinkering' notes in a PDF with some =20
pictures to help me remember how I get everything to work. Maybe it =20
will help give you a feel for the flow of programming PICs.

http://nonsen.es/PIC16F887_H.pdf

-haley







Quoting "Byron Jeff" <[email protected]>:

> 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 generate=
s
> 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 =20
>> 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 =20
>> 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 t=
o
> 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 o=
n
> 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=3DTutorial_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 -> =20
> 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: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> --
> Byron A. Jeff
> Department Chair: IT/CS/CNET
> College of Information and Mathematical Sciences
> Clayton State University
> http://cims.clayton.edu/bjeff
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>