OCCRA
Go to Post Well, it worked in inventor . . . - Chris Fultz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-03-2003, 08:24 PM
Adam Collet
 
Posts: n/a
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   Spotlight this post!  
Unread 10-03-2003, 11:13 PM
rwaliany's Avatar
rwaliany rwaliany is offline
R
None #0691 (HartBurn)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 2000
Location: http://www.hartrobot.com
Posts: 137
rwaliany will become famous soon enough
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...
__________________
R
  #3   Spotlight this post!  
Unread 10-03-2003, 11:35 PM
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
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.
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos

Last edited by FotoPlasma : 10-04-2003 at 01:48 AM.
  #4   Spotlight this post!  
Unread 10-04-2003, 02:40 PM
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
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.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill
  #5   Spotlight this post!  
Unread 10-04-2003, 06:32 PM
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
Quote:
Originally posted by Adam Y.
There are a lot of books on the pic microcontroller.... the other book is actually a rather large book about almost every pic in existance.
I have one of those in my room. I find it's easier to look up data sheets on Microchip's website, though.
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos
  #6   Spotlight this post!  
Unread 10-04-2003, 06:42 PM
vladg12 vladg12 is offline
Registered User
#0117
 
Join Date: Sep 2003
Location: Pittsburgh
Posts: 7
vladg12 is an unknown quantity at this point
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   Spotlight this post!  
Unread 10-04-2003, 06:56 PM
djcapelis's Avatar
djcapelis djcapelis is offline
Fried Manic Custard
None #0675 (Geeks with Power Tools)
Team Role: Programmer
 
Join Date: May 2003
Rookie Year: 2001
Location: Rohnert Park, CA
Posts: 129
djcapelis will become famous soon enoughdjcapelis will become famous soon enough
Send a message via ICQ to djcapelis Send a message via AIM to djcapelis Send a message via Yahoo to djcapelis
Hmmm, seems kinda laggy, whatcha hosting it on?
__________________
"I have more friends than enemies, I'm working to resolve the issue."
  #8   Spotlight this post!  
Unread 10-06-2003, 11:18 AM
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
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...
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #9   Spotlight this post!  
Unread 10-06-2003, 01:45 PM
Adam Y.'s Avatar
Adam Y. Adam Y. is offline
Adam Y.
no team (?????)
 
Join Date: Mar 2002
Location: Long Island
Posts: 1,979
Adam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to beholdAdam Y. is a splendid one to behold
Send a message via AIM to Adam Y.
Quote:
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.
There is but they don't support that certain chip.
__________________
If either a public officer or any one else saw a person attempting to cross a bridge which had been ascertained to be unsafe, and there were no time to warn him of his danger, they might seize him and turn him back without any real infringement of his liberty; for liberty consists in doing what one desires, and he does not desire to fall into the river. -Mill
  #10   Spotlight this post!  
Unread 10-07-2003, 05:36 AM
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
Quote:
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...
My suggestion: Keep it simple!

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.
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...

Last edited by Mike Betts : 10-07-2003 at 05:47 AM.
  #11   Spotlight this post!  
Unread 10-07-2003, 02:04 PM
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
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...)
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #12   Spotlight this post!  
Unread 10-13-2003, 02:49 PM
Neal Probert's Avatar
Neal Probert Neal Probert is offline
Registered User
#1015 (Pi High Samurai)
 
Join Date: Jan 2002
Location: Ann Arbor, MI
Posts: 48
Neal Probert is on a distinguished road
Send a message via ICQ to Neal Probert Send a message via AIM to Neal Probert Send a message via Yahoo to Neal Probert
Post Linux PIC'ing in C

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?
__________________
Ypsilanti-Ann Arbor Area Robotics Club
YAAARC! The sound you make as your robot rolls off the workbench...
http://www.yaaarc.org/
------------------------------
Software Engineer (20+ years experience)
ProbeStar Technical Systems, LLC.
http://www.probestar.com/
  #13   Spotlight this post!  
Unread 10-14-2003, 12:54 PM
Skabana159's Avatar
Skabana159 Skabana159 is offline
Robotics and Field Hockey
AKA: Jesse C. Owens
#0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2000
Location: Ft. Collins, CO
Posts: 92
Skabana159 is on a distinguished road
Send a message via AIM to Skabana159
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?
__________________
"What most people do not understand is that the Buddha, the Godhead, resides just as comfortably in gears and circuits as in hills and trees. To believe otherwise is to dilute the Godhead."
-Robert Pirsig, Zen and the Art of Motorcycle Maintenance
  #14   Spotlight this post!  
Unread 10-14-2003, 10:00 PM
djcapelis's Avatar
djcapelis djcapelis is offline
Fried Manic Custard
None #0675 (Geeks with Power Tools)
Team Role: Programmer
 
Join Date: May 2003
Rookie Year: 2001
Location: Rohnert Park, CA
Posts: 129
djcapelis will become famous soon enoughdjcapelis will become famous soon enough
Send a message via ICQ to djcapelis Send a message via AIM to djcapelis Send a message via Yahoo to djcapelis
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.
__________________
"I have more friends than enemies, I'm working to resolve the issue."
  #15   Spotlight this post!  
Unread 10-15-2003, 10:08 PM
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
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 :-)
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux and new microcontollers. djcapelis Programming 48 01-29-2005 12:26 AM
TCP/IP on a PIC Venkatesh Electrical 1 11-18-2003 09:00 PM
pic: Another pic of Team 930 CD47-Bot Robot Showcase 7 02-25-2003 09:07 PM
Robots and the Learning Channel.... archiver General Forum 0 06-24-2002 12:16 AM


All times are GMT -5. The time now is 11:08 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi