Shop OBEX P1 Docs P2 Docs Learn Events
My Tachyon Forth, new experience - Page 2 — Parallax Forums

My Tachyon Forth, new experience

2»

Comments

  • Yesterday I got a little bit frustrated dealing with the power issues. I was able to preload the two FIiP modules with the kernel, and this morning I just started them up with power from the USB cable.

    The FLiP modules seem to be operating as expected. I tried some of the words that were not cooperating, and everything seems to be fine. The BIG lesson, beware of possible power issues. With that in mind, I might have to add the WiFi module back, and just have the unit powered externally. I guess then, if and when I decide to add other modules, I will be less concerned with the power limitations.

    This morning I also tried the COLD word, is there a word, maybe something like MEM that would display the current memory available. Their is mention of things like EXTEND, EASYFILE, and what else? Is there a document that lists what EXTEND has to offer.

    Ray
  • Ah yes, the sdcard can be fitted to almost any P pins you like. That explains P26.

    If I wanted to reload the tools module from source, where would I find that, please? Is it closed source?

    I suppose if it became necessary, one could dynamically forget sections of code and reload others from SD card during an application like my old Z80 system used to do. Modules dependent on other modules could conditionally load the depencencies first before running too. But I guess that a 'compile just in time' overlay behaviour is rarely if ever necessary, most applications would simply load entirely from eeprom and run.
  • bob_g4bbybob_g4bby Posts: 401
    edited 2020-08-29 13:19
    Ray,

    Documentation is not great, Peter has written a lot, but it is a very big subject. Here are some useful links. The Tachyon word glossary is a little out of date, but the best summary to the word set there is. I've been thinking about updating it as a way of learning tachyon, helped by the source code and experimentation on the hardware. Tachyon is likely to change much less quickly now that Taqoz is the main focus of interest, so an upissued glossary might stay current longer. I've already done a lot of work on the Taqoz glossary, despite not having a P2 to play with.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-29 13:00
    If you want to go to the source, it's all there. Click "The LOT" link in my sig and that brings up the total Tachyon folder. Go into P1 and then Forth for Forth source code or kernel for the PASM and semi-compiled Forth (mostly assembler and word directives, no actual Spin).

    TOOLS are actually part of the whole EXTEND.fth file so if for some reason you needed to replace just that then you would have to copy&paste from that section onwards.
  • bob_g4bbybob_g4bby Posts: 401
    edited 2020-08-29 13:18
    To display the current memory available, press keys CTRL and ?

    More ctrl key tips are described in 'Introduction to Tachyon Forth'. One not listed, to see all variables and constants in memory, press CTRL and v

    Some times I want to know if a word exists or not. You can list all using WORDS, but the word you're looking for is hard to spot in that big list. So I use HELP U/MOD ( for example ). If the word exists, it will be disassembled to the screen. You have to press enter to stop the display carrying on to show more words. If the word doesn't exist, you'll just get the Tachyon prompt.
  • bob_g4bbybob_g4bby Posts: 401
    edited 2020-08-29 13:58
    EXTEND.FTH, EASFILE.FTH are just text files containing forth source code. They can be found in the P1 section of the Tachyon dropbox in folder FORTH. So you can read the contents with your favourite text editor. EXTEND.FTH is made up of a number of sections, with comment headings which describe what each section might do. Have a look.

    You can write your own Tachyon programs as source files and load them into the Tachyon system using the terminal 'send file' function. I use Tera Term, so simply dragging and dropping the file onto the Tera Term window sends the file for me. Tachyon swiftly compiles each new word as the file is sent. I had to set 13ms end-of-line delay in Teraterm, to give Tachyon time to compile reliably. I'm currently writing a driver for an si5351 chip. So my si5131.fth file grows a bit every day as I add new words to it.

    You can also copy and paste bits of source code between terminal and text editor, which speeds things up. If a new word, created usimg the terminal seems to be working, then scrolling back, that word definition can be copied into the text editor to be saved for next time.

  • I just reconnected the WiFi module and was successful logging in with Tera Term, using Telnet.

    I also just tried the 'CTRL and ?'. There was no response via the Telnet connection. Not sure if there is a setting in Tera Term that turns on 'CTRL' usage. I think I need a "smart" terminal program. I have to see if Tera Term can make a connection to the COM port via an IP address, something like what a proploader does.

    When I say a "smart" terminal program, I am not talking about minicom, although I think that is only available for Linux. I am thinking a GUI window with a small window that acts like the terminal, another little window that is like an editor, you can type in your new words and then copy/paste into the terminal window. Basically you would have one window open instead of another program like notepad open.

    Ray
  • Mm, that might be my mistake - try ctrl and / together. That should display the required memory information :-
    TF5>
    CODE:$3C94 = 14996 bytes
    NAME:$5A4E = 6578 bytes
    DATA:$7601 = 241 bytes
    FREE:      = 7610 bytes
     Data Stack (0)
    TF5>
    

    Also ctrl and v together shows variables and constants in memory:-
    7600 ncol        75FC fnumB      75F8 fnumA      75F4 result     75F0 f32cmd     3F00 romsz
    75B0 servos      75AC pwmpins    75AA pwmfreq    75A8 pwmtbl     75A4 brg        7594 dt
    7590 htsav       758C htref      758A htck       756A undef$     7568 _job       0007 SUN
    0006 SAT         0005 FRI        0004 THU        0003 WED        0002 TUE        0001 MON
    755E rtc         755C day        7558 date       7554 time       7550 runtime    7540 wdt
    753C tid         753B eeflg      753A eedev      7539 i2cflg     000A @SPISCK    000F @SCL
    0005 @CNT        0004 @CE        0003 @MISO      0002 @MOSI      0001 @SCK       0004 NEG
    0000 POS         7538 _ctr       7534 _ansi      0007 white      0006 cyan       0005 magenta
    0004 blue        0003 yellow     0002 green      0001 red        0000 black      7531 pbase
    7530 pflg        752C seed       01FF VSCL       01FE VCFG       01FD PHSB       01FC PHSA
    01FB FRQB        01FA FRQA       01F9 CTRB       01F8 CTRA       01F7 DIRB       01F6 DIRA
    01F5 OUTB        01F4 OUTA       01F3 INB        01F2 INA        01F1 CNT        01F0 PAR
    01F0 SPR         7528 NULL$      7524 ~c         7520 boot       751C @3         7518 @2
    7514 @1          0000 FALSE      7510 ulong      0050 CLKMHZ     7510 vars       00B8 @org
    009A names       0028 VER        7800 BUFFERS    0000 OFF        00A8 errors     00A0 uhere
    00A2 uthere      00B0 flags      008C prompt     00A6 uauto      00B2 keypoll    00C4 lastkey
    0092 rx          157C id         1834 keytable
    TF5>
    

    ctrl and x toegther repeats the last line typed in, which is often useful.

    Tera Term doesn't need to be set up, it should just pass the ctrl key combination on to Tachyon. I've not tried a wifi link yet with Tachyon , though. Maybe it's best to keep it as simple as possible for these first steps?

  • Keep in mind, from this point on, I will be using a WiFi connection, and accessing it with Tera Term, in the Telnet mode. I tried a couple of other CTRL commands, and in Telnet mode there was no response.

    I have my FLiP module setup on my Create robot, and I have a connection to the robot via p0 and p1. Now as I was looking through the Tachyon glossary I did not see any words or commands for creating a serial connection. Did I overlook it, or will that have to be developed. With the things that are involved, like BAUD and pin direction this looks like a very complicated procedure. I guess this is where Forth is supposed to shine, I guess.

    Anybody have a starting point for creating word for making a serial connection?

    Ray
  • After a little digging, I found the EXTEND.txt file. In the docs I also found Simple Serial.

    Simple Serial:
    pub SERBAUD
    pub SEROUT
    pub SERIN
    pub ISEROUT , not sure what this does.
    with some associated support pub units. I guess 'pub SERBAUD' creates the word SERBAUD. I also guess it would go something like this:
    115200 SERBAUD 100 SEROUT(0) - setup for 115200 BAUD, send 100 as byte via p0.
    Not sure how you would handle a serin.
    115200 SERBAUD xxxx SERIN(1) - the 'xxxx' would be a variable to capture the incoming byte?
    I guess it would be a very fancy word if you wanted to create FullDuplexSerial.

    Now I have think about setting up an experiment to see if this strategy works as expected.

    Ray
  • Simple serial will work up to 250kB. The stack usage and description is in the source:

    Setup the default baud you want to use. Once set there is no need to call it again unless you are changing the baud.
    pub SERBAUD ( baud -- )
    
    Usage: 115200 SERBAUD

    Send a single byte out the serial port.
    pub SEROUT ( data pin -- )
    
    Usage: '?' 5 SEROUT

    Divert output to the pin as simple serial using the current baud setting.
    pub SERIAL ( pin -- )	' ~S C! EMIT: ~S ;
    
    Usage: 5 SERIAL PRINT" Hello World" 1234 1000 * PRINT


    --- receive 8 bit serial data from pin at rate set with SERBAUD, blocks until character received
    pub SERIN ( pin -- data  )
    
    Usage: 4 SERIN 5 SEROUT
    This will echo a character from P4 to P5

    There are ROMs too for all kinds of high-speed buffered serial.



Sign In or Register to comment.