"Forth of the Forth" Challenge (in December)
Peter Jakacki
Posts: 10,193
NEW LINK! Forth of the Forth Challenge page
As mentioned in mindrobots thread "Forthers-Thanksgiving-Challenge-it-s-all-about-the-projects-baby!!!" I am upping the ante by also including my own challenge which anyone can enter (except myself) and I am offering not only a 1st prize but also a 2nd and a 3rd ...... and of course we have to have a 4th prize.
Since this is the inaugural challenge the deadline for entries will be the 4th of December instead of April as I am hoping to do this again next year (with P2 hopefully). As long as the entry is in before the "4th" is over everywhere in the world (I think that's Honolulu time). The conditions for the inaugural challenge will be kept simple and so as not to add anything or take anything away from what I previously stated in the Thanksgiving Challenge thread I am copying the conditions here:
1st Prize is a P1145 "SongBox" board with a "Puppy Prop" module, QVGA Touch screen, USB and Bluetooth modules, matched enclosure and 4GB microSD and 4GB SD cards. The board includes stereo jacks for audio in (Sigma Delta) and audio out as well as RS-485 and USB style PS/2 connector. Power is either via the USB module or a micro USB socket.
Details of the 2nd, 3rd, and 4th prizes will be appended to this post shortly but they will all be Propeller products of some kind.
BTW, even if you have already submitted your project to the Thanksgiving Challenge, feel free to enter it in the "Forth of the Forth" challenge.
As mentioned in mindrobots thread "Forthers-Thanksgiving-Challenge-it-s-all-about-the-projects-baby!!!" I am upping the ante by also including my own challenge which anyone can enter (except myself) and I am offering not only a 1st prize but also a 2nd and a 3rd ...... and of course we have to have a 4th prize.
Since this is the inaugural challenge the deadline for entries will be the 4th of December instead of April as I am hoping to do this again next year (with P2 hopefully). As long as the entry is in before the "4th" is over everywhere in the world (I think that's Honolulu time). The conditions for the inaugural challenge will be kept simple and so as not to add anything or take anything away from what I previously stated in the Thanksgiving Challenge thread I am copying the conditions here:
Conditions are that this is based around a Propeller chip of course and that you use any Forth for the application code with assembler kept to an absolute minimum (remember, we are showcasing Forth). The application should be stand-alone and ready to run from power-up. Points given for readability so factor out those functions into smaller words and choose a name that describes it well and fits in well with how it is used. Additional points for keeping extraneous hardware to a minimum.
The time frame until Thanksgiving is probably a little short for this particular challenge so how about we set it for the 'Forth" of December 2012? Now if we had another one for the "Forth of the Forth" then that would be a very easy date to remember. We will see how we go with this one first.
Since time is short I won't impose any more conditions, just get to it and may the Forth be with you!
1st Prize is a P1145 "SongBox" board with a "Puppy Prop" module, QVGA Touch screen, USB and Bluetooth modules, matched enclosure and 4GB microSD and 4GB SD cards. The board includes stereo jacks for audio in (Sigma Delta) and audio out as well as RS-485 and USB style PS/2 connector. Power is either via the USB module or a micro USB socket.
Details of the 2nd, 3rd, and 4th prizes will be appended to this post shortly but they will all be Propeller products of some kind.
BTW, even if you have already submitted your project to the Thanksgiving Challenge, feel free to enter it in the "Forth of the Forth" challenge.
Comments
Great prizes! Hey, that looks almost like a commercial project :0) is there any way the losers would be able to buy one of the sweet Song Boxes???
Two Forth contests, folks! That should be enough to bring the Forth Faithful ut of the woods and maybe also draw some non-Forthers into the pool!!
BTW, have you noticed that the top 6 posts in this forum are all about Forth!
But fear not, I am pretty sure that I can come up with something interesting. I might even finish the project this time.
I wanted a project that would fit the seen by the majority of the Forumistas....not a serious tool meant for not very serious projects...or something that is mostly a figment of the imagination and as useful as most figments.
So, with a PPDB and Tachyon, I've come up with the Single Digit Clock!!! Yes, to prove the economy of Forth code, I'm making a clock with a single digit! It was going to be a QuickStart with a single large digit but delivery circumstance and Radio Shack's complete lack of LED displays have caused me to embrace my PPDB.
I've got the display working and just need to either get the DS1302 RTC on the PPDB working under Tachyon or else just let the Propeller keep time....I mean really, how much accuracy do you need with only one digit??
Video as soon as possible.
Come on, folks, time is running out, it's almost the FORTH of December!!!!!! The deadline approaches!!!!
Don't fear though, if you miss this Forth challenge, there's another just around the corner (maybe even prizes if I find a sponsor).....I promise it will be TIMELY!!
Is this one of those ones where you have to move your head from side to side or walk past to see it out the corner of your eye!!? Or is it in fact a count-down timer for the 21st? That would be timely!
Now, now, we mustn't ruin the surprise!!!
By the way, I finally have my Tachyon environment squared away and it's brilliant!! The LOOKUP word is near genius!!
Hopefully, my project write up will be a good tutorials in application development in Forth....or not.
Yes, timely indeed!! :0)
This is NOT going to be a continuation of the chopstick printer. And it will be in PropForth. And I hope it to be useful and informative to new PropForth users.
Anyway, we need more contestants or I will win a prize just by the default of too few entires. At this point, even if I enter, there will be two prizes that go unclaimed.
Forth is fast, fun, and furious. Or maybe I am just furious and Forth is fast and fun.
Come Forth you undeclared.
Working hard to pull this off. It is a lot of testing and writing.
Midway is an hour earlier (GMT-11) than Honolulu even so it might be one of the the last places where it would still be the 4th of December when every other place is the 5th. The point is, just submit your entry by the 4th while it is still the 4th somewhere in the world. For instance you are in Taiwan which is GMT+8 so therefore you have another 19 hours after the the 4th in Taiwan to submit an entry (I think that's right). If your project is near completion but not quite finished then submit it anyway, you will be allowed a little bit of extra time to complete it. This isn't a rigid regulated by law competition but a Forth for fun competition, remember, Forth is fun. Try to polish the code to increase your chances. That is besides being functional it should have form, and a certain "elegance" either in it's simplicity and clarity or in it's innovate approach to the task for instance.
I suffered a few rather interesting and unexpected setbacks and sorted out some rather gnarly problems. In the end, there may not be much to show for it, but the competitions are working their magic as learning experiences.
Of course everyone now knows that Parallax is running yet another contest with even more prizes that has deadline near Christmas , Dec 20th.
http://forums.parallax.com/showthread.php?144156-CONTEST-Hack-The-Halls!
I just finally got the last of the PropForth code to behave in actual testing.
So it seems, that I just have to type up a few corrections and this is ready to go. I just may make that 6am deadline and comply with 12 Midnight Honolulu time.
But now that I think of it, the guys in the USA have an advantage over me, it is still only December 3rd.
So be it. At least it is nice to finish something.
We need staggered start times!
Until Forth becomes very famous there is no "Forth of December" on the 4th day.
It probably doesn't matter much since there are 4 prizes, and up until now there have only been 3 responders to this thread. So you and I can battle it out for 4th place.
So, if you enter you win, assuming no one else pops up. I'll let you take the honors for our non-participation:)
@Dave: that's a lot of code just to toggle a pin!! This is how we blink an LED in another cog in Tachyon:
: BLINKY BEGIN #12 PINSET 100d ms #12 PINCLR 100d ms AGAIN ;
' BLINKY 4 RUN
My display words are working fine, I can decompose and compose number (pack and unpack) but for some reason my DS1302 just isn't working.
I'm sure it's something silly or something I don't understand about Tachyon, yet.
If anyone cares to look and/or is familiar with the DS1302, any suggestions would be appreciated.
Even with a single digit clock, I can tell time is running out!!
You have to stop thinking in PropForth when you code in Tachyon. Tachyon is much cleaner and simpler if you just use the Forth.
Firstly:
Use constants for the I/O and define as masks in the first place
#P17 |< CONSTANT CE
#P18 |< CONSTANT I/O
#P19 |< CONSTANT CLK
Second:
: DS1302! ( data -- )
I/O OUTPUTS \ set I/O PIN to OUTPUT (normally redundant but needed for SHROUT)
I/O SWAP \ set up the I/O pin on DS1302 (pinmask data -- )
CLK OUTCLR \ force CLK lo
8 FOR SHROUT
CLK OUTSET
NOP
CLK OUTCLR
NEXT
2DROP
;
Thirdly:
: DS1302@ ( -- data )
I/O DUP INPUTS \ set I/O PIN to INPUT
0 ( mask data -- )
8 FOR SHRINP
CLK OUTSET
NOP
CLK OUTCLR
NEXT
NIP
;
Forth'ly:
Where are you using the chip enable? BTW, Don't bother defining words for these when they are very simple operations. Either say:
CE OUTCLR or CE OUTSET
Now, I'll leave the rest up to you...
BTW:
My second entry is a joint entry of Nick Lordi and myself. We started back in October. Nick presented me with a basic design for a breakout board for Propeller Platform for microMega's 64 bit Floating Point Co-process a small toolbox 2 dozen words to manipulate it.''
Our project is the completion of the breakout board, containing the FPU64, a Digilent PmodSF2 16 megabyte high speed serial flash, and a Parallax uSD card slot.
That done, the rest of the project is I have the FPU and the uSD running and about a third of the FPU's vast power evaluated .
I have become something of a Tachyon Forth Evangelista with this project. Even the 30% of the chip I have explored would have taken 2-3 times longer on any other Forth. Being able to build and run loops on the fly saves enormous time.
Below is the loadmap and all the files are in the zip
It as so easy to do things with TF that I made a shout out for "the other forth'
My newest Propeller Platform Through Hole board, you may remember, has two Atmel megabit EEPROMs giving a total of 256KB, or in other words slots for 8 boot images. Now slot 0 ($0000) is the default boot. Slot 1 ($8000) is used by Peter''s BACKUP/RESTORE commands ( the short story is, if you do a backup and TF detects you have at least a 64K EEPROM, it, first, copies the boot image in slot 0 to slot 1, then writes the new boot image from RAM to slot 0. The RESTORE command will restore the last image from slot 1 to slot 0 and reboot.
Now, the PropPlat TH has six(6) more slots, 2 thru 7 ($10000 through $38000) and TF has a copy EEPROM command ... EECOPY ( src dest bytes -- ) . Now both of these projects involved multiple files and changing one file from late in the load can be a real drag. RESTORE lets you back up one step. BUt judicious use of EECOPY gives you the power to step back to any of six milestones for the price of two dozen seconds of EECOPY time.
This also saved me much time in copy/pasting that didn't have to be done.
Hopefully, the added practical information will make more users interested in trying PropForth.
Peter tries to claim that Tachyon is easier to use, but I am not yet sure. It just might be that PropForth is just struggling to make their documents something other than 'dry as a bone' technical presentations.
In sum, it has gotta be fun and Tachyon does seem to be ahead in making it so.
Lots of time re-reading and re-typing. All the code has been tested with real hardware.
The bottom-line is still that I like to use my Propeller intereactively.... learning is more interesting.
Operations that change the depth of the stack require all of the stack locations to be shuffled. An operation such as ADD will leave one less item on the stack, so all of the other stack locations must be copied toward the TOS. Operations such as DUP and OVER will leave one more item on the stack, and the rest of the stack items have to be copied to the next stack location.
The version of Tachyon that I looked at uses 12 locations for the data stack, 18 for the return stack and 8 for a loop stack.
As I said before, the toggle code is intended to demonstrate the functionality of starting a Forth cog. It allows for quite a bit of flexibility, and would be even more complex if the programmer wanted to pre-load the Forth cog stack with parameters and provide an exit routine that automatically stops the cog. I'll probably write a program that demonstrates that capability. I'll also provide a few more words that hard-code stack sizes to make it simpler to start a Forth cog.
Hmmm... I know nothing about Forth programming but I would think it would involve a lot of pushing and popping so shuffling the stack every time seems like it might be cumbersome. I guess if it's done at COG speeds it's pretty fast though.