Brian Riley 2010 Dec 17 @ 2030 EST *-------------------------------------------------------------------- Setting Up PropForth v4.0 Load the Basic Prop Forth Kernal The first part of the setup will be quite familiar to Prop people. Using your favorite IDE, Parallax's Propeller Tool (Windows only) or Brad Chamber's BST (Windows, Mac OSX, and Linux) you will load the file "PropForth.spin." And that's it for Spin. Until a new version of the kernal comes out you never need to use an IDE again for this board. A quick sanity check is in order. Bring up a terminal program (suggested TeraTerm for Windows, ZTerm for Mac OSX, ????? for Linux) Set up the program for 57600 baud. 8n1 (8 bits no parity, 1 stop bit) Now either reset your board or power cycle it and in your terminal window you should see ... *----- RESET Prop0 Cog6 ok *----- Entering code into PropForth Our window into the PropForth v4.0 (for brevity's sake this will be called PF4 for the remainder of the document) is a modestly fast serial line and a terminal program. Using this you can type in code and run it ... this gets old really fast! There are two ways to get a file of forth code into PF4. The first is "copy and paste" into the terminal window and the second is "send paced text." Without getting bogged down extraneous details let me say simply "copy/paste" works and "send paced text" is unreliable. It may have occurred to you to wonder about how PF4 handles comments. Basically there are two kinds of comments in Forth, inline and block *----- 1 2 3 . . . \ this is an inline comment 4 5 6 drop . . \ it only goes to the end of the line { This is a block comment and goes on as long as you want. } *----- - inline comments - as soon as PF4 sees the backslash it ignores everything until the CR at the end of the line. PF4 resumes processing Forth with the next line. - block comment - is similar. PF4 upon encountering a left curly brace reads and ignores whole lines testing only for a right curly brace. PF4 resumes processing Forth with the next line. - an LF is treated like a CR and usually produces an empty PF4 prompt. It is harmless. - No RAM or EEPROM space is wasted on comments. - You will see the PF4 responses between lines of code. - lines of code with inline comments will have finite pauses while PF4 strips the comment. - some of the core code written for PF4 has huge segments of block comments including huge chunks of assembler code. These can take MINUTEs for PF4 to process and giving no visible indication of progress. IT WORKS!!! Honest! If you must, LEARN HOW TO SIT ON YOUR HANDS and away from the KB and mouse! Let it finish! EEPROM File System Now, even the "copy/paste" drill gets old after awhile. But PF4 has an answer to that. A major part of PropForth v4.0 is based upon the target board having, at least one 24LC512 (64 KB) EEPROM ... 32K for program and 32K unallocated. The file system will start at the 32K boundry of EEPROM0 and extend up as high as the top of EEPROM7, giving 32KB plus 7 times 64KB potential code storage. As of this writing, configurations of 1 (32KB), 2 (96KB), and 3 (160KB) EEPROMs have actually been tested. Most boards have a single 64KB EEPROM and nothing needs to be done to the code to configure it. If your board has more than one EEPROM you need top open file "fs.f" in a plain text editor. Line 94 defines a constant called "fstop." Its value for 1 EEPROM is 10000, for 2 it's 20000, 3 is 30000, and so on. (this number is hexadecimal) >--- from file "fs.f" --- \ \ CONFIG PARAMETERS BEGIN \ 8000 constant fsbot \ the start adress in eeprom for the file system 10000 constant fstop \ the end address in the eeprom for th file system 40 wconstant fsps \ a page size which works with 32kx8 & 64kx8 eeproms \ and should work with larger as well. \ \ CONFIG PARAMETERS END \ >------------------------ Load EEPROM File System If you haven't already, from the prior step. find and open file "fs.f" in a plain text editor. do a "select all" and "copy." Now go to your terminal program and hit "ENTER" and see that you get another PF4 prompt. Next we are going to "paste" the contents of the file into the terminal input buffer. Now the "copy/paste" routine will be your primary method for entering Forth code (usually from files with names ending in ".f")