[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Newb Question
From: Keith Vance ####@####.#### Date: 29 Jan 2011 16:29:19 -0000 Message-Id: <692B4B2A-7169-4728-A6DA-B803C59DB334@take88.com> I'm a little bit lost and need some help. I'm not understanding how all of the pieces of the puzzle fit together. So I use gpasm to compile my application that will run on the PIC? How do I get the application on the PIC? And then what do I use gplink for? 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). If someone has or knows of a Web site they can link me to, that's probably what I need. Thanks, Keith | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Newb Question
From: Peter Stuge ####@####.#### Date: 29 Jan 2011 18:19:06 -0000 Message-Id: <20110129181903.29869.qmail@stuge.se> Keith Vance wrote: > So I use gpasm to compile my application that will run on the PIC? Not compile, assemble (translate to machine code), into one object file for each source file. > How do I get the application on the PIC? For Mac OS I believe pk2cmd will work with the PICKit2. pk2cmd is a simple command line tool to program a hex file. > And then what do I use gplink for? It's used to link several objects into one final binary. However, a common file format is actually hex as mentioned above, which is a text file that describes the bits that should be written into the program memory in the PIC. //Peter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Newb Question
From: "Haley Clark" ####@####.#### Date: 30 Jan 2011 20:44:23 -0000 Message-Id: <20110130134420.11886fjcod1sek4c@webmail.ualberta.ca> If it is any help I have put my 'tinkering' notes in a PDF with some pictures to help me remember how I get everything to work. Maybe it will help give you a feel for the flow of programming PICs. http://nonsen.es/PIC16F887_H.pdf -haley Quoting "Byron Jeff" ####@####.#### > 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 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ####@####.#### > For additional commands, e-mail: ####@####.#### > > | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |