Shop OBEX P1 Docs P2 Docs Learn Events
Forth+FLiP+WX WiFi module — Parallax Forums

Forth+FLiP+WX WiFi module

I watched the video of the first zoom presentation of TAQOZ in the P2 rom. It was quite interesting and informative, which got me to thinking about using Forth for my robot project.

Since Forth is an interactive experience that uses words, I am thinking of words as subroutines, I wonder if I could get it to work with the WX WiFi module and access the FLiP(Forth) remotely. When I use the word Forth, I am referring to the version that Peter created.

For my robot project I was considering creating an interactive IO using the C language, but if Forth has that already, this might save a few steps.

I am still not sure about a lot of the capabilities of Forth, things like multitasking, interaction with other devices using serial interface, and such.

So, what would it take, using Forth, to setup a remote session via WX WiFi module and Forth?

Ray

Comments

  • JonnyMacJonnyMac Posts: 8,923
    edited 2020-06-22 18:05
    Forth was designed for real-time control, and Peter created Tachyon for the P1 and TAQOZ for the P2 for the work that he does for clients. Anything that can be done with the Propeller in C or Spin can be done in Forth -- it's just another programming language, with the up-side of being interactive. If you can get past the stack-based style and unusual syntax, it seems like a great tool. I've been interested in Forth for a long time, I've just never mastered it. The tricky thing about Tachyon and TAQOZ is the lack of full-blown documentation; Peter seems to be working to fix that.
    So, what would it take, using Forth, to setup a remote session via WX WiFi module and Forth?
    I don't know, but I'll bet that Peter could sort that out quickly given he has Ethernet connectivity with Tachyon.
  • From what I can see in the firmware guide, you can put the module into transparent mode, even from a webpage, so you can just communicate serially as usual, console fashion. Make that happen first and then interactively develop your code starting first with the little things that control motors and read sensors etc. Then you can incrementally build more from there while getting a better idea of how to do things along the way.

  • I was trying to get a download of Tachyon Forth, but at the "Tachyon Forth on Sourceforge" , when you do a download, it just downloads TAQOZ. Can TAQOZ be used as a lite version of Tachyon.

    Now, as for the WX WiFi SIP module, I need some explanation as to how the module should be wired to the FLiP, when you want to use the transparent mode, of the WiFi module. I think the different wiring schemes should have been covered in the WX WiFi SIP manual.

    Ray
  • The TAQOZ version that gets downloaded is for Prop 2 and contains a lot of extensions and sample modules including SD card I/O and Ethernet I/O, but no source code. I'm not sure what's going on with SourceForge. I can't download other files either.
  • JonnyMacJonnyMac Posts: 8,923
    edited 2020-06-23 00:08
    I downloaded the source from here. Note that Peter has it setup for BST compile options. I commented those out and used standard P1 settings (5MHz crystal with 16x PLL). By removing the clocks speed options I was able to compile/download with Propeller Tool.

    https://sourceforge.net/projects/tachyon-forth/files/Tachyon/kernel/
  • I downloaded tachyon5v7.binanry. If I recall correctly, using the Propeller tool, I can open the bin file and have it loaded to the EEPROM, I think that is the procedure that I remember.

    I am still trying to figure out this transparent mode. So, I guess I will load tachyon, start up FLiP, and then use Tera Term to see what happens. I wish Parallax had more complete documentation for the WX WiFi SIP module.

    Ray
  • JonnyMacJonnyMac Posts: 8,923
    edited 2020-06-22 20:25
    I did at first, too, but couldn't get anything with gibberish in my terminal. I think it may have been compiled for 96MHz (6MHz crystal).
  • I just did the binary file load exercise, and all I was getting is gibberish, at any BAUD. I downloaded the .spin version, but I am not familiar with spin enough to figure out what has to be changed to make it work on the FLiP module. I am using the Propeller tool for this, it is the handiest, at the moment.

    This is getting to be a complicated session for trying out tachyon. I remember many years back, the last time I tried tachyon, it did not seem to be as complicated, I think it was way more straight forward.

    Ray
  • I do not know what I am doing, but today must be my lucky day. What ever I commented out in the tachyon spin file, the Propeller tool was able to run and load it to the EEPROM.

    A note of concern, when the WX WiFi SIP is on, tachyon does not respond to a keypress in the Tera Term terminal mode. When I turn off the WiFi, then tachyon responds, to a key press, in the terminal mode. Not sure what to make of that.

    When I use Tera Term to make a connection via the WiFi, it opens up a terminal mode, but I get a connection that is refused. Not sure what to make of that either. This might take a lot of hacking to figure what will work.

    Ray
  • Maybe I will update a standard Tachyon binary and integrate that into the default download zip file, the one that's linked to the big download button. It wouldn't hurt.
    The Tachyon .spin file is preprocessed from include files so I could make it totally Prop tool compatible.
    I'll update this post once I've done that.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-06-23 01:42
    I've updated the Tachyon binary and it defaults to 80MHz 115200 baud. It includes TOOLS and EASYFILE.
    To make it Tachyon and TAQOZ easier to download from SourceForge I have put both binaries together in the one small zip file with the readme and made that the default file for the DOWNLOAD button.

    btw, even though the binary is 64k, the Prop tool only uses the first 32k. The upper EEPROM can be loaded with ROMS with simple copy&pastes from the ROMs folder.
  • I went ahead and tried the new Tachyon zip file(6/23/20). The Propeller tool opened and then loaded the EEPROM, without any problems. Below is what you see on an initial startup, I guess it is checking for some things that maybe available on the P1(FLiP) module.

    There is a line - INTERCOM: &05.78.32.55 @3,990, what the heck is that. From the memory that is left, 1366 bytes, it looks like everything got loaded.

    I tried keying in 'help', but that comes up with '???', maybe a help that displays some very basic forth words that a beginner can use to explore the system, would be helpful, just my two cents.

    Now comes the hard part, how to get the WiFi SIP module to work with Tachyon. So far the wiring between the FLiP and WX WiFi is not working with Tachyon. Anybody have any wiring suggestions?

    Ray
    Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
    *** MODULES *** Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
    3C94: EASYFILE SDHC card + FAT32 Virtual Memory File System V1.2 171024-0000
    300E: TOOLS DEV TOOLS
    1AC0: EXTEND Primary extensions to TACHYON V5 kernel - 200514-0100


    FREQ = 80.00MHZ
    *** INITS ***
    MOUNT 42DA
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    I/O = 31 :UHUU 27 :DD~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~~~~ 3 :~~~~
    INTERCOM: &05.78.32.55 @3,990

    CODE:$4D86 = 19334 bytes
    NAME:$52DC = 8484 bytes
    DATA:$7849 = 825 bytes
    FREE: = 1366 bytes
    Data Stack (0)
    Mon, 01 Jan 2001 00:00:00 UTC *Card Error*
    TF5>
  • Tachyon is rather case sensitive so try HELP instead. There are so many things built into Tachyon that you are probably the first to ask "what the heck is that" about INTERCOM. It's actually a very useful way of having multiple Props all connected together on a single multidrop line yet being able to talk to any one of them from any Prop as if you were connected directly with full-duplex terminal. But I don't think you will be needing that.
    BTW, Tachyon is not looking for something specific about the Flip since it doesn't even have microSD or RTCs etc. It is only detecting that EEPROM exists at $A0 and that's about all.

    The ROMs are binary images that are stored in upper EEPROM in a file-like manner so that they can be loaded into cogs at runtime without taking up any of the precious 32k of RAM. These ROMs include UARTS (FDS and high-speed autoplex etc) as well as VGA and SIDCOG and F32 Floating point etc. They exist in the ROMs folder as a hex file with a header so all you have to do is copy&paste and when you do they load up automatically into upper EEPROM. Next time you boot it will report the ROMs that it detects.

    If you run RECLAIM it will free up another few k as well.

    As for testing the WiFi, I would just connect it up to the Prop's serial pins but I will have to check the schematics because Parallax have a habit of assuming that USB will be the only method of communications which won't make it easy to connect to P30,31 if that was the case. But I will check.
  • I just tried 'HELP' instead of 'help', what I see is the cursor just sits on the same line, even after I have done CR. I have to do another CR to get a new line and cursor. I am using Tera Term serial terminal, I will try using another terminal program to see if I get different results.

    [QUOTE}
    As for testing the WiFi, I would just connect it up to the Prop's serial pins...
    [/QUOTE]

    That is the way that is connected right now. The other wire is connecting the RESET on the FLiP and DI on the WiFi SIP module.

    Ray
  • I just tried 'HELP' with another terminal program, same results. I also tried 'RECLAIM', that seemed to work. Now I guess I need a small list of some of the basic words, and what they do.

    Before I move on to debugging the WiFi problem, I want to make sure that the Tachyon that is installed is bug free, so I know that if their is a problem it is with the WiFi and not Tachyon.

    Ray
  • OK, so I think I found a solution, using Tera Term. You have to select Telnet and then find the selection for 'local echo'. So far so good. Making some progress.

    I tried the 'HELP', with this new setup, and HELP still does not display any information. Not sure if it is because I loaded the bin version of Tachyon, or maybe something else.

    Now to find a list of some basic Tachyon words, so I can do some more testing.

    Ray



  • Ray,
    here is what I have for the tachyon glossery.
    jim
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-06-23 16:14
    HELP <word> is basically the decompiler but I was intending to expand it for general and specific help. If you need general help it's best to read the general Starting Forth book and the Intro to Tachyon Forth etc. Also the Tachyon Encyclopedia too

    Treat it the same as SEE <word> and don't expect it to somehow be able to have reams of information on the little 32k P1. This would be possible in SD or a larger EEPROM and one day when I or someone else has some time, we might have those help files available.
    TF5> HELP PING
    5D06 301E 0 PING
    ADDR: DATA  NAME
    301E: 1F64  WAIT!
    3020: 0095  DUP
    3022: 010F  HIGH
    3024: 800A  10
    3026: 1E52  us
    3028: 010C  LOW
    302A: 0119  WAITHI
    302C: 011C  WAITLO
    302E: 8001  1
    3030: 018F  COG@
    3032: 8002  2
    3034: 018F  COG@
    3036: 7D09  -
    3038: 00A1  ABS
    303A: 8050  $0050  80 
    303C: 084D  U/
    303E: 301E  PING
    3040: 0035  0035
    3042: 0002  0002
    3044: 98A1  $18A1  6305 
    3046: 1E68  1M
    3048: 086B  */
    304A: 0119  WAITHI
    304C: 8001  1
    304E: 018F  COG@
    3050: 011C  WAITLO
    3052: 8001  1
    3054: 018F  COG@
    3056: 0098  SWAP
    3058: 7D09  -
    305A: 005A  EXIT
    
    305C: 8000  0
    305E: 8008  8
    3060: 0156  FOR
    3062: 00A5  2*
    3064: 304A  DHTBIT
    3066: F58C  $758C  30092 
    3068: 00C8  W@
    306A: 00BD  >
    306C: 00A9  >b
    306E: 7CD1  OR
    3070: 0166  NEXT
    3072: 0095  DUP
    3074: F58A  $758A  30090 
    3076: 00CE  C+!
    3078: 005A  EXIT
    

  • First off, thanks RS_Jim for that excellent pdf file, looks like you put a lot of time and effort into it. It will take me awhile to get a handle on how to use it correctly.

    A general observation of Tachyon. As to the way it is used with the Propeller, you could say it was an OS, loosely worded, with words, that could be used as batch or short hand script files. You have to get a good grasp of how to use that "short hand" to create the word. Once you get the hang of creating the useful "words", it looks like a very powerful system. I would shy away from calling it programming, in the way maybe C would be used.

    For my purpose, it could be useful, once I figure out how to create a serial connection to the robot with the FLiP, and then sending and receiving commands from the robot. Using C that was almost painless to grasp, but with Tachyon, it looks like it might take some effort to get the correct syntax and series of words, to get the job done.

    I will see how it goes with using the RS_Jim pdf file, and then how it goes with some preliminary uses with Tachyon.

    Ray

  • You may want to load EXTEND.FTH as it seems much of the documentation and many examples count on word contained it it. I loaded Tachyon and the EXTEND. FTH file into a spare HC-8+ for experimenting. I have a couple client designs in process that I'm going to use Tachyon for hardware wring-out and testing.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-06-25 01:10
    @Rsadeika - interesting but faulty observation I would think.

    By definition an O/S is:
    An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.
    and in the case of embedded use
    are very compact and extremely efficient by design, and are able to operate with a limited amount of resources

    Furthermore, if I can write complete embedded applications in batch or short hand script files then I must be some kind of wizard. Most of the magic though is Forth and Tachyon itself which btw is not a compiler that resides on the PC drawing on its vast resources, but instead has the compiler, runtime library, debugger and O/S services residing on the Prop itself.

    In the case of the 32k P1 especially, yes, it must be magic.

    P.S. The fact that you can run "scripts" as well is a bonus, not the limitation.
  • RS_JimRS_Jim Posts: 1,753
    edited 2020-06-25 15:25
    Ray,
    as much as I would like to take credit for that excelent file, I cannot. I found it among the other gems in the tachyon neon thread.
    Jim
    ps, peter just posted to that thread, so it should be easy to find. iirc mjb gets the credit for the dictionary.
Sign In or Register to comment.