Show Posts
Pages: [1]
1  Development / Other Software Development / Re: Yet Another Forth For Arduino on: January 07, 2013, 10:04:20 pm
I've updated the code on github. I consolidated the separate memory regions for name, code and data space, into a unified area. I also did some more testing of DO, LOOP, +LOOP, CREATE, DOES>, and RECURSE.
2  General Category / General Discussion / Re: Yet Another Forth for Arduino on: January 03, 2013, 01:12:28 pm
Thanks, I've started a thread over in "Other Software Development" http://arduino.cc/forum/index.php/topic,140305.0.html
3  Development / Other Software Development / Re: Yet Another Forth For Arduino on: January 03, 2013, 01:09:35 pm
Can you explain some of the details that are typically relevant in a Forth implementation:

0) is this a full interactive Forth, or some sort of cross compiler?
1) Implementing Forth in a HLL like C++ seems counter-intuitive.  How's performance, and what other tradeoffs and benefits are there (I see a bunch of "throw()" calls.  Does that mean it has real error-trapping capabilities?)
2) Does it have non-volatile storage of any kind for new words?  Support for some sort of filesystem?  If new words are stored in RAM, how much space is available?
3) What's the one (core standard) word you didn't implement?
4) What arduino-specific words have been implemented?
5) Are you going to write any documentation (covering the previous questions)?

0) This is an interactive Forth.
1) Implementing Forth in a HLL is slower than assembly, but it greatly improves portability, and I wanted something the was native to the Arduino IDE. As I learn more about the how Forth is suppose to work, I intend to try and improve performance were ever I can. There is limited error trapping. As I learn more, I will improve it. Detected errors cause an end to execution, compilation, or interpretation and the stacks are purged.
2) Currently there is no non-volatile storage. I want to add the ability to store words into the EEPROM and to retrieve them.
3) The last word I have not figured out is ">NUMBER". I can't find any good examples of its use.
4) I've implemented wrappers for pinRead, pinWrite, pinMode, eeRead, eeWrite, analogRead, ananlogWrite.
5) Eventually I will write documentation covering the above and the implementation choices I've made.

I'm welcome to anyone who may want to help. Right know I'm looking into unifying the "Forth Space" in RAM, write now there are seperate memory locations for Name, Code, and Data space. which breaks up the storage of an new word into the multiple areas. The intent is to unify the three areas and make each new word definition occupy a single continuous block of memory.
4  Development / Other Software Development / Yet Another Forth For Arduino on: January 02, 2013, 10:45:21 am
Hi All,

I just posted my Forth environment for the Arduino. It is based on the ANSI Forth draft standard DPANS94, and I've implemented all but one of the core words, plus some others for manipulating the I/O. I would appreciate some feed back from people who are familiar with Forth. It can be found here https://github.com/sdwood68/YAFFA
5  General Category / General Discussion / Re: Yet Another Forth for Arduino on: January 01, 2013, 09:10:48 pm
Here is my initial release https://github.com/sdwood68/YAFFA. I would love comments and suggestions on how to improve this. I am working on improving/fixing the ram based dictionary.
6  Development / Other Software Development / Re: Forth programming language? on: December 31, 2012, 10:52:43 pm
I've been working on a Forth environment for the Arduino, and just a posted a call for help here http://arduino.cc/forum/index.php/topic,140050.0.html. I still need to find a place to post the code that. Any suggestions?
7  General Category / General Discussion / Re: Yet Another Forth for Arduino on: December 31, 2012, 07:39:28 pm
What hosting you choose will depend on your comfort level with the version-control software they're using, and what sort of capabilities you think you'll want.

I would want something pretty light and and easy, since I honestly don't think there would a huge amount of interest and therefor not a lot of people who would contribute. Easy access for people who want to try it out and a way to give me feedback on improvements and implementation mistakes.

Thanks
8  General Category / General Discussion / Re: Yet Another Forth for Arduino on: December 31, 2012, 02:10:33 pm
To clarify, It supports all but one word from the CORE word set.

Stuart
9  General Category / General Discussion / Yet Another Forth for Arduino on: December 31, 2012, 01:59:39 pm
Hello All,

I've written a Forth environment for the Arduino Uno in C. It currently support all but one word from the draft ANSI Forth specification, DPANS94. It is written completely in C in the Arduino IDE, so it should be able to be ported to other Arduinos. I could use some help in debugging it and improving its architecture, but it is still quite usable as is. I'm happy to release it to the wild under the GPL V2 if people are interested in it. I'm just not sure how to release it for people to find it.

Please let me know if there is any interest!

Thanks,

Stuart
10  Using Arduino / Programming Questions / Re: Error in Serial.available() on: July 17, 2011, 06:00:40 pm
Thank for the clarification on the serial monitor. That makes sense.  I'll switch to something else to test the code.
11  Using Arduino / Programming Questions / Re: Error in Serial.available() on: July 17, 2011, 03:10:38 pm
I've tried my solution and I'm back to thinking that Serial.available() is not working right.
1) It does appear that it waits for the carriage return before reporting the available charters. i.e. type something into the serial monitor and don't press the carriage return and it will never report any characters available.
2) When polling Serial.available() it always returns 1 character and the the rest
3) Serial.read() never returns a carriage return or line feed. It seems to be stripping them out.

I will look into the the Serial object next to try and confirm these observations.

Any Thought?
12  Using Arduino / Programming Questions / Re: Error in Serial.available() on: July 15, 2011, 10:20:35 pm
OK, so my fundamental mistake was thinking the serial buffer updated after a carriage return. I think I like the option of looking for a carriage return then just delaying. Someone might be slow at typing. But I should have a timeout so it does not just sit waiting indefinitely.
Code:
  while (Serial.peek |= /n && Some Timeout Test) {
    newString += Serial.read();
  }

Thanks
13  Using Arduino / Programming Questions / Error in Serial.available() on: July 15, 2011, 11:33:22 am
I'm writing a routine to read the Serial Buffer into a String Object. It depends on getting a accurate value of characters entered before a return.
Here is the code
Code:
/*
  Get String Example
  Reads the Serial input into a string. Using a pointer to a String Object.
 
 This example code is in the public domain.
 */
/****************************************************************************/
/* Routine to store the contents of the serial buffer into a                */
/* String Object location passed to the function                            */
/****************************************************************************/
int getString(String& newString) {
  int stringLength = Serial.available();
  newString = "";                        // Clear the string for the new data
  while (Serial.available()) {
    newString += (char) Serial.read();   // Concatinate each charageter onto
                                         // the String Object
  }
  Serial.print("getString: ");           // DEBUG print out the string length
  Serial.print(stringLength, DEC);       // and the string object
  Serial.print(":");   
  Serial.println(newString);
  return stringLength;
}

void setup() {               
  // Open serial communications:
  Serial.begin(19200);

  // send an intro:
  Serial.println("Arduino Duemilanove");
  Serial.println("Get String Example");
  Serial.println();
}

void loop() {
  int count = 0;
  String myString = "";
  if (Serial.available() > 0) {
    count = getString(myString);
    Serial.print("myString: ");    // Show what was read
    Serial.print(count, DEC);
    Serial.print(":");
    Serial.println(myString);
//    count = parseString(myString, ' ');
//    Serial.println("No. of Sub Strings is: " + count);
  }
}

Here is the result after typing in HELLO followed by a return
Code:
Arduino Duemilanove
Get String Example

getString: 1:H
myString: 1:H
getString: 4:ELLO
myString: 4:ELLO

I expect a to get HELLO once and not split up like it is.
What am I doing wrong? Isn't Serial.available() suppose to return the number of characters entered?

Thanks
Pages: [1]