gnupic@linuxhacker.org

gnupic@linuxhacker.org


Subject: Re: PICmicro programming & Mac OS X
From: David Kelly
Date: Tue, 20 May 2003 21:42:47 -0500

On Sunday 18 May 2003 09:38 pm, Michael P. Rogers wrote:
> >I can tell you what tools I use with my OS/X machines while working
> > on PIC related projects.

MPLAB under VirtualPC/Win95.

> Terrific, thanks very much for the encouraging reply.  This gives me
> a platform to work on during the summer as I develop the course.
> Unfortunately, I can't ask my students to buy a PICstart Plus (which
> as I understand it is around $300).

If you are going to teach a class I would suggest doing better research. 
$199 full MSRP from DigiKey or others, 
http://www.digikey.com/scripts/us/dksus.dll?Criteria?Ref=77642&Cat=32048067

But what I think you would rather have is an ICD for $159. A PICStart is 
only a low end programmer. The ICD is an In-Circuit Debugger, which can 
also program the part it is debugging. PICStart handles more chips than 
an ICD.

The ICD2 has a USB interface and works with the PIC18Fxxx family. The 
original ICD is serial only and works with 16F87x parts. My brother 
informs me the MPLAB USB tools run well under Virtual PC. The serial 
ISD is flaky thru a Macintosh serial port due to lack of all the 
handshake lines. I couldn't get it to work to my satisfaction but my 
brother can on his Mac. Probably a different story with a USB-to-RS232 
adapter.

> Dontronics sells a programmer for $20, that would accommodate the
> Windows users -- any idea if your set up will work with any other,
> cheaper programmer?
>
> One other question:  can you (or anybody else reading this) recommend
> a C (or other high-level language) that will run on Mac OS X?  Or is
> everybody just programming in assembler?

Target PIC, or target Mac? For Mac, download Apple's free compilers and 
development tools, they are way-cool. MPW is now free for download, and 
useful for pre-MacOS X. Exactly the stuff you need to start playing 
with Linux and GNU code on the Macintosh.

Am not sure what you are trying to teach. Am a bit concerned you are 
trying to teach "production line" skills rather than "learn to 
program". Concerned much the same as how "computer literacy" is defined 
as, "can type a letter with Microsoft Word, build 1234582809."

You are not a chef if all you can do is mix recipes from a cookbook. You 
are not a programmer or engineer if you haven't learned how to solve 
problems that were not in your textbooks.

As for a C compiler on microcontroller, you are not going to teach very 
much about PIC if you hide it under a C compiler. I've not studied the 
latest 18 series of PIC closely. Have done several projects using 16 
series parts in assembly language. Its my opinion that the project will 
run in C on a 16 series part then you are using a far more expensive 16 
than was necessary.

I did a fairly large project on a 16F876 in under 0xf00 words of 
assembly. I needed RAM and other resources worse than code space.

Replaced a PC with a 16C505 in a production line test rig. Was less than 
0x80 words of assembly, including a bit-banged UART.

PIC assembly is a form of insanity. Sometimes a little insanity is 
enlightening.

-- 
David Kelly N4HHE, dkelly@hiwaay.net
=====================================================================
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

gnupic@linuxhacker.org