Cliff Hacks Things.

Thursday, December 27, 2007

PropellerForth stirrings

A few weeks ago, I was poking around on the Silicon Valley Forth Interest Group webpage. I was surprised to see this in their minutes:
There has been no success in contacting the author of Propeller Forth - written locally by Cliff L. Biffle

As of about February 2007, my email got so clogged with spam that I simply stopped checking it. (Apologies to anyone who's been trying to contact me.) So, I had no idea that the SVFIG was interested in PropellerForth. I've had isolated inquiries from a couple people, but all in all, my original posts (here and on the Parallax forums) were met with general disinterest.

So, I've resurrected the project. Not much progress yet -- mostly, I'm cleaning up the sources so I can release them without sullying my good name. :-) People poking around the PropellerForth site on might notice some documentation appearing in preparation for the source release.

Ever since I moved out of my folks' house, I've gone back and spent a few nights there for Christmas. Since my sleep schedule is rather different from theirs, I wind up having a lot of free time -- and since I'm away from work and distraction, it's traditionally been a great opportunity to hack. (Projects that got their start or reached significant milestones over Christmas include Mongoose, Cesta, PropellerForth -- and, 15 years earlier, WebElite.)

This year I learned the NTSC spec, the US analog television standard. The existing NTSC drivers for the Propeller are cryptic and don't build with propasm, so I wrote a very simple one with more lines of comment than code. It generates a 40x16 B&W text display, uses the ROM font to save space (compressing it on the fly to 8x16 pixels), and requires 336 bytes of code space and 640 bytes of framebuffer. As an experiment, I've tied it into PropellerForth.

It probably won't be part of the base image I release -- it bloats the image beyond my 8KiB target -- but between it and my PS/2 driver from Christmas 2006, I've nearly got a standalone console working.

(NTSC, incidentally, is a pain compared to VGA -- but most of the complexity, as my dad pointed out, is a result of sending all the data amplitude-modulated on a single channel, instead of VGA's five. It's kind of impressive that they got this to work in the 30s.)

So, if anyone following my blog is interested in PropellerForth, let this at least indicate that your interest may not be in vain.

Labels: ,


  • Glad to see you are once again hacking the prop. I forgot my demoboard at school :(, and the current emulators are frustratingly slow. I look forward to a solid C compiler so I can use a fast simulator (by compiling on a PC using replacement headers tied into SDL for simulated I/O).

    Do you think that it would be possible to do something similar with PropellerForth?

    By Blogger navaburo, at 10:57 AM  

  • A C compiler would be nice for a lot of things -- I love my AVRs mostly because they work with gcc -- but for embedded work, there's nothing like developing from inside the machine itself!

    While I was writing my NTSC driver, for example, I started PropellerForth and used the serial console to tweak the VSCL/VCFG/FRQA/CTRA values while I watched the output with a frequency counter. My math worked on paper, but being able to test it in real-time was invaluable.

    Today I wrote an I2C EEPROM driver right on the Propeller, allowing me to incrementally test each piece (and, of course, rewrite them because I did it wrong). I'll post the source shortly.

    As for the simulator, I'm not sure what you're referring to, so I can't comment on whether PropellerForth is right for the job. It certainly won't let you use C. :-) An instruction-level simulator for the Propeller would be incredibly useful, and I've toyed with the idea of writing one. I think I'm familiar enough with the hardware (and the places where the docs are wrong) that I could do it...but it'd be quite a time commitment.

    By Blogger Cliff L. Biffle, at 10:03 PM  

  • Wow, I didn't realize that anyone actually developed right on the embeded system... I thought that functionality was just a novelty.

    As for the simulator, what I meant is that I have (with great success) simulated PIC-based projects by compiling directly on my PC, for the PC, using only functions from stdlib and a custom header I included. I only needed to implement the functions in this header on the PIC and then again on the PC. On the PIC, for example, the SetPixel() function talks to the parallel LCD screen, but on the PC it talks to OpenGL.

    This kind of simulation isn't 100% accurate, and the "simulator" you write is project-dependant, but it is a rather small time-commitment in many cases and well worth the effort imho.]

    Thanks again for your work on PropellerForth. I am now toying with the idea of writing a Scheme interpreter!

    Happy holidays.

    By Blogger navaburo, at 8:35 AM  

  • I'm not a huge Scheme person, but it'd likely work well. I briefly thought about it myself.

    The Propeller has an architectural quirk shared with the early LISP machines: its addresses are half the size of its data words. (In this case, 16-bit address, 32-bit words.) Thus, you can easily fit a CONS cell in a single long as you can tolerate 16-bit ints/atoms or find a clever way to stuff them.

    By Blogger Cliff L. Biffle, at 1:42 AM  

  • Very useful. I bookmarked for reference. This blog is like a book. Very Delightful. Thanks for sharing.

    Mesothelioma claims

    By Blogger Lauraine, at 3:31 AM  

  • By Blogger poh, at 11:49 PM  

  • Thanks I am amazed by your article. Indeed coupons is very useful specially to online consumers.I have to say I am amazed by your article. Indeed coupons is very useful speciallymeet thai women

    By Blogger chinese girl, at 10:28 PM  

Post a Comment

<< Home