|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Learning PIC C
With the exciting release of all the information for our new RC, as the head programmer for my team, I will soon be teaching all the new (and old, though I don't think they will really need teaching) team programmers in the art of PIC C (which I can mostly do), the use of Microchip IDE (which I am learning), and maybe even the delicate art of ASM (which I am decent at). The only problem is, I'm not the best teacher in the world. I can do stuff, but I can't really explain it all-to-well. So, my request is this: does anyone know of where I can find any good (read free) tutorials for any or all of the above?
|
|
#2
|
|||||
|
|||||
|
Does anyone know where I could get a free editor for that matter for PIC C. And does anyone know how indepth C it supports. Like do you use malloc/calloc with pointers etc...
|
|
#3
|
||||
|
||||
|
The three first PDFs listed on Microchip's C18 product page are pretty good, comprehensive documents about the C18 compiler, which is a non-free addon to MPLAB. Being as MPLAB is listed as the programming environment which we're going to use, I suspect that we'll be using it in conjunction with C18, to program the controller. The User's Guide contains a lot of the language specifics, while Getting Started provides a nice little introduction, including a couple code examples (though there are enough of those in the User's Guide, as well). The third document is an overview of general libraries from Microchip, in order to take advantage of certain capabilities of the processors.
I'm going to be in the teaching position, again, for this year, too. I'm going to stick with the same strategy I had last year, though. Throw the manual at them, and answer any questions they ask me. If they do anything that looks like it'll damage anything, I'll try to let them know before they run it. ![]() Last edited by FotoPlasma : 04-10-2003 at 01:48. |
|
#4
|
||||
|
||||
|
There are a lot of books on the pic microcontroller. I have bought too of them but I really have not had the time to learn them with school. One book is on learning how to program using pic-lite and the other book is actually a rather large book about almost every pic in existance.
|
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
|||
|
|||
|
Learning PIC C
On my team's website http://www.steeldragonrobots.com
there is a programming forum where we will post links to online tutorials and resources, as well as quickly answer any individual questions. Check it out. |
|
#7
|
||||
|
||||
|
Hmmm, seems kinda laggy, whatcha hosting it on?
|
|
#8
|
|||||
|
|||||
|
Linux?
Well, I suppose here's the question that is nagging everyone's mind: (well, some one's mind, probably)
Is there a Linux IDE for the PIC microchip? I haven't looked very in depth for one yet, but I plan to begin to soon. If anyone knows of one off the top of their heads, it would be helpful. I wish FIRST would step back from proprietary software... |
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
||||
|
||||
|
Quote:
You have less than 2K of RAM to work with. Dynamic memory allocation is very tricky and it is very easy to get lost. There is no doubt that we will need to use pointers, but I plan to keep it to a minimum. Also, beware of recursive calls. Bottom line: You don't want to have your team on the sideline during a competition just because your programmer got "cute". 'nuff said. Last edited by Mike Betts : 07-10-2003 at 05:47. |
|
#11
|
|||||
|
|||||
|
I can hardly imagine a situation in which you will need to implement malloc/calloc . In fact, I'm starting to have difficulty imagining too many situations in which assembly would be needed (though convienently possible on the PIC...)
|
|
#12
|
||||
|
||||
|
I've been programming PIC 18F452 for almost a year and have a pretty good understanding of the chip now. The 18F8520 is so new, I haven't found any development/evaluation boards for it yet.
The MPLABS IDE is a simple IDE, but eventually I switched to Komodo as it works with CVS (concurrent versioning system). For programming, I've been using the Melabs EPIC programmer. Hi-Tech sells a C compiler for the PIC which will come with a Windows version and a Linux version, but is expensive. C2C is cheaper. The CCS compiler is a popular choice, but isn't fully 100% ANSI C. No SDCC or GCC port yet, but I'm still hoping this will change soon as the incentive is there. The 18F now has enough of a stack to make this possible now. Each compiler accesses the PIC hardware with different semantics, so changing compilers means you have to rewrite the code. As for an IDE, you have many choices besides VI (vim) and Emacs/Xemacs such as Eclipse, Kate, KDevelop, Komodo (ActiveState.com) and Kylix. I probably missed a few, but these are the ones I'm familiar with. Most of these can be extended to support the compiler and a download utility. For programming a PIC, there's PonyProg and PP06, neither of which I've tried yet as I haven't yet completed my Windows to Linux conversion on my last Windows box. Btw, check this out: http://www.penguicon.org Linux rocks! Windows sucks. Why pay the Microsoft tax on your computer? |
|
#13
|
|||||
|
|||||
|
Do you know the websites for Hi-Tech, C2C, and CCS?
I am a bit confused by what you mean, so let me say it as I understand it: Use any IDE to code... Use Hi-Tech, C2C or non-ANSI CCS to compile Use EPIC to program Is that the process that one goes through? BTW: I have been seriously considering making the programmers on my team use CVS or RCS... any suggestions on how to make them comply? |
|
#14
|
||||
|
||||
|
The BAS system. (Big $@#$@#$@# Stick... as in 2 by 4, not male organ) Hit them over the head with it if they don't check in and out with CVS.
|
|
#15
|
|||
|
|||
|
My guess is that you won't program the PIC with a multi-socketed external programmer, but with a system like last year's; you'll leave the SMD soldered onto the board inside the RC (so as not to void the waranty), and attach a COM port or Mac serial port to the supplied programming port on the outside of the RC.
The MPLAB IDE will probably have a driver for this method, so you just have to enable it via a pull-down menu, and blooey, it's blown into the RC's memory. The IDE works competently (at least versions previous to 6 did - I've put the required new firmware into the PICStart, using a ver 5.x, and downloaded the latest version of 6, but I haven't tried v6 for real). If the default program is anything like it has been for a number of years, now, there will be libraries and alias-renaming blocks, and "DO NOT CHANGE THIS" areas. There will be many examples, in the program and online. In short, not an insurmountable task. Have fun :-) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linux and new microcontollers. | djcapelis | Programming | 48 | 29-01-2005 00:26 |
| TCP/IP on a PIC | Venkatesh | Electrical | 1 | 18-11-2003 21:00 |
| pic: Another pic of Team 930 | CD47-Bot | Robot Showcase | 7 | 25-02-2003 21:07 |
| Robots and the Learning Channel.... | archiver | 2000 | 0 | 24-06-2002 00:16 |