PIC/Smalltalk Release

Jon Hylands Jon at huv.com
Sat Jul 1 06:19:18 UTC 2000


Okay, I've done the port, it works, it's out there.

You can grab it at http://www.huv.com/squeak/PICSmalltalk.cs or
http://www.huv.com/squeak/PICSmalltalk.zip

The change set doesn't file in completely correctly for some reason -- the
pool dictionaries in PicObject and its subclasses are getting messed up
somehow. If someone can have a look at that and let me know what is wrong,
I'll fix it and update them.

There's an example of interfacing to a servo included.

To open a browser, evaluate:

	PicSmalltalkBrowser openBrowser

in a Morphic project. This gives you a regular class browser with a new
sub-menu in the class and message list views. The 'Program Chip' menu item
doesn't launch the programmer, since I didn't bother to figure out how to
launch a DOS executable from Squeak yet. I suspect a lot of you aren't
using Windows anyway, so you'll need to fix that method to do the right
thing depending on your OS and PIC programmer.

This thing is designed to work with PIC 16F84 chips. It may work for
others, but I haven't tried.

It includes a full-blown Smalltalk parser, since the version of Smalltalk I
wrote it in originally doesn't include one.

If you have problems, for now I guess report them to the Squeak list. If it
becomes a problem there, we can start a new egroups group or something for
it.

I haven't extensively tested this in Squeak yet, so user beware. I did just
port it a couple months ago from Visual Smalltalk to Dolphin, so I worked
out most of the porting issues when I did that.

There are no real classes or instances in this system. instance variables
are global, so name them as such. The linker does a full closure on the
methods called from the reset method and the isr method, so you can include
lots of other support code that you don't use, and it doesn't end up
costing space in the end assembler code.

I don't guarantee that the assembler produced from the included macros is
100% correct -- check the assembler output yourself carefully. If you don't
know PIC assembler, you shouldn't be programming PICs, or you should buy a
commercial C compiler.

If you look at macro methods in PicObject, you'll see that they basically
just define a block. The code in those blocks is (of course) real Smalltalk
code that is evaluated by the code generator (and thus the Squeak Compiler)
when the PIC/Smalltalk code gets generated. You can take that as far as you
need it in terms of optimization of code, or doing weird stuff.

Anyway, comments are welcome, preferrably to the list. I really wasn't
planning on releasing this to the public, but you asked for it, so now you
get it.

If you really like it, feel free to send me nice stuff, or job offers :-)

Later,
Jon

--------------------------------------------------------------
   Jon Hylands      Jon at huv.com      http://www.huv.com/jon

  Project: Micro Seeker (Micro Autonomous Underwater Vehicle)
           http://www.huv.com





More information about the Squeak-dev mailing list