Shop Learn
My Tachyon Forth, new experience — Parallax Forums

My Tachyon Forth, new experience

I have to take a break from C, FlexBasic, FlexC, so on and so forth. I decided to give Tachyon Forth a 10th chance, or there about.

So far so good, I think I am getting a grasp on the way the stack is used and how to do arithmetic, the fourth way. I have tachyon5v7 installed, I guess that is the latest.

Before I go any further, one big question, as you make or create the new words, how do you save them? Or do they have to b e recreated every time the processor gets re-started? The other question, where is a listing of the built in Tachyon words? I guess that should do it for now.

Ray
«1

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-26 17:14
    Goodonya Ray, if you want to backup everything into EEPROM then just type BACKUP and give it a second or two while it spins the cursor. If you ever want to wipe out your words and start fresh you can FORGET <1st word>.

    For all the latest documentation and howto and links etc, just go to the SourceForge site in my signature.
    Here is a quick link to a link page.

  • Rsadeika wrote: »

    Before I go any further, one big question, as you make or create the new words, how do you save them?

    Ray

    Ray,
    I use TerraTerm as my editor for TAQOZ. After I write and debug my definition using the editor, I copy & paste it into windows notepad as a text file and save it.

    I will put collections of words used to do specific things or to build more complex definitions into the same file. For example, a group of general words/aliases that I usually use is in file "general.fth" (I am not very creative when it comes to naming things.)

    Then when I want to use a specific group of words I just open the file in notepad and copy and paste to TerraTerm and it loads into TAQOZ.

    The P2 version can load words saved to the SD card. I'm not experienced enough with the P1 version to know how to do that on the P1.

    Tom
  • I guess I should add that I am using the FLiP module for my experimentation.

    Something weird is going on, when I type in 'HIGH 26', the LED is not turning on. When I type in 'HIGH 27', then 26 turns on. Before using HIGH, do you have to do an OUTPUTS of the pin that you want to turn on? If that is the case how would create a WORD that does the OUTPUTS of the pin you want to use. I guess, something like 15 highpin? I am thinking some how the word gets the pin number that will need OUTPUTS. I think that I am still thinking C and trying to translate to Forth.

    Ray

    TF5>

    Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
    Cold start - no user code - setting defaults

    TF5> HIGH 26 --- ok
    TF5> HIGH 27 --- ok
    TF5>
  • Try "26 HIGH" and "27 HIGH". That's the typical Forth way of doing things. With Forth you have to put the data on the stack first, and then execute the word that uses the data.
  • So, that is another one of those got ya things.

    I am looking at the 'TACHYON Forth GLOSSARY', for example:
    NAME STACK TY DESCRIPTION
    DUP ( a -- a a ) C Duplicate top item on stack (push)
    the way you would use that is - '15 DUP', assuming you have 'a' on the stack, it would print out 'a' fifteen times.

    In the Starting Forth, it shows examples that use 'REPEAT', I take it that Tachyon uses DUP instead. In a nutshell, using a Tachyon word, you always put what is going on the stack first, then the word.

    Ray
  • DUP (a -- a a) means duplicate the top value on the stack. "15 DUP" will leave two 15's on the stack. If you already have "a" on the stack, then "15 dup" will leave "a 15 15" on the stack.
  • If you want to put the letter "a" on the stack you need to use "CHAR a". If you do it within a word definition I believe you have to use [CHAR] instead of CHAR. EMIT will print the character at the top of the stack. REPEAT is used with the BEGIN/WHILE loop. This is all based on standard Forth. However, Tachyon is not standard Forth, so it may do things differently.
  • To make it easier for people that are using 'Starting FORTH' there is no 'REPEAT' word that is being used. I guess I am starting to see things that are not there. Somehow I got messed up with '15 SPACES'.

    Is their any special reason why Tachyon is all upper case words, you would think that upper/lower case could be used. Does that mean that you could have two words like 'spaces' and SPACES'.

    Ray


  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-26 23:42
    Tachyon is case sensitive but remember to read before write. That is, read how Forth in general operates before you write anything and then you will get it right. DUP for instance is an instruction, not a shell command. So just like a mov y,x instruction in assembler knows nothing about consoles or commands nor anything else, it just knows how to move, the same too with most Forth words. Treat them like assembly instructions. So DUP uses the stack for source and the stack for the destination. Although you may type 1234 DUP there is no special parser, just a fairly simple loop which builds up each string until it encounters a space or cr, checks to see if it is a number and pushes it onto the stack if it is, or else scans the dictionary to find an exact match. In fact, DUP will execute even if the stack is empty, it is totally ignorant about what happens elsewhere, it just does what it does.

    If you read from left to right word by word and number by number without skipping ahead and "process" each word as it comes then you will get the sense of what the "parser" does..... almost nothing :)

    What happens here?
    TF5> 1234 ---  ok
    
    The value 1234 is pushed onto the stack.

    PRINT (or the dot symbol) prints the number on top of the stack (and drops or pops it)
    TF5> PRINT --- 1234 ok
    

    Try putting a couple of numbers on the stack.
    TF5> 1234 1000 ---  ok
    

    Those two numbers are just sitting on the stack waiting to be used (not really, but they are there). So let's multiply them together and print the result.
    TF5> * PRINT --- 1234000 ok
    

    Are you starting to get the idea? It is not trying to figure out the line of text, it just figures out each word as you type, and compiles that word as soon as you hit the space bar. By the end of the line it has already compiled all those words and is ready to run them.

    btw, REPEAT is not the same as repeat in Spin. Use it in a loop that begins with BEGIN and includes a conditional WHILE.
    TF5> 0 BEGIN CR DUP .  DUP 10 < WHILE 1+ REPEAT --- 
    0 
    1 
    2 
    3 
    4 
    5 
    6 
    7 
    8 
    9 
    10  ok
    TF5>
    

  • Having a bit of trouble with using a pause of some sort with Tachyon.

    I thought I would try the old turn an LED on wait a few seconds and then turn it off. I tried:
    : onoff 26 HIGH 2000 ms 26 LOW ;
    Would not get past the ms. Tried ms both in upper and lower case, did not make a difference. I am thinking put the value on the stack and then the command, in this case ms.

    I am starting to think in terms of the "stack", is where everything happens.

    Ray
  • As stated I installed tachyon5v7.spin, using the Propeller Tool.

    I had to make some modification to the Spin file to have it start up in 80MHz mode. I also had it loaded to the EEPROM, for a known method of reboot.

    Now it seems like Tachyon is starting to get flaky after awhile. I am not sure if it is the FLiP that is protesting, or maybe something else is occurring.

    I have three different terminal programs that I can use, just in case it is a terminal problem, but it seems the same problem occurs, on all of the terminals. And by flaky I mean when I type in something like FORGET sometimes it works and then it starts show that the command does not exist.

    Anybody have a lead on where I can get the binary that will run on the FLiP. I thought I downloaded the correct binary, but that did not run.

    Ray
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-28 00:17
    I loaded the Tachyon/P1/V5/TACHYON.binary dated 2020/06/23 onto an old Prop board. Then I fired up minicom terminal at 115200 and got this:
    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 :U~~~ 23 :~~UD 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> 
    

    I have an LED connected on P28 so I type this:
    TF5> 28 HIGH 2000 ms 28 LOW ---  ok
    
    For 2 seconds the LED turned off and then back on (wired active low)
    BTW, there is no need to put this in a definition (such as onoff), it will run just fine from the command line which is useful for testing etc.

    For the source you can go to Tachyon/P1/V5/kernel/tachyon5v7.spin but because this is the output of a script that builds the kernel you will have to manually enable the 80MHz section but commenting out (or removing) the #ifdef and #endif for this setting.
    #ifdef 80MHZ
    _clkmode        = xtal1 + pll8x
    _xinfreq        = 10_000_000            ' <--- AUTOMATIC 5 or 10MHz operation change at boot
    sysfreq         = 80_000_000
    #endif
    

    Tachyon automatically works out if it is a 5MHz or 10MHz crystal, so there is no need to change this setting.
  • The zip file contains the tachyon5v7.spin file that I am loading to my FLiP module. I reloaded it this morning, and still seeing the same problems. Not sure what I can do to the file to make it run as expected.

    Ray
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-28 12:35
    Hi Ray, it's a mystery. Did you try the binary? I will attach it nonetheless. (It already is preloaded with EXTEND and EASYFILE)
    BTW - which Prop tool are you using to load the Propeller?

    Maybe if you just force it to stay on 5MHz like this:
    LINE 11: _clkmode        = xtal1 + pll16x
    LINE 12: _xinfreq        = 5_000_000
    
    LINE 2599: 'word  _0,FETCH,w+10000,@UDIVIDE+s,w+8000,EQ,_IF+03
    LINE 2600: 'SETPLL  word  w+@_setpll+s,@aLOADMOD+s,RUNMOD
    
    The last two lines are just when it decides whether to call the setpll routine which we just comment out.

    The setpll routine was something that PhiPi wrote years ago and it shoudn't matter if it is an oscillator rather than a crystal either since this routine runs fine on my boards.
  • NO SUCCESS!

    I did the binary first, loaded it with Propeller Tool, and nothing was happening. I noticed that the binary file size is 64K, what happens when you load it to a FLiP which is 32K?

    I also made the recommended changes to the .spin file, loaded it, and was still getting the same flaky results.

    I guess I have a copy of Tachyon that runs, but it does not run as expected. So, it looks like it might be time to move on, again. I was hoping to get a little bit more distance out of this run with Tachyon.

    Now I have to sit back and rethink what the next step will be. Maybe I am using the wrong processor for the stuff that I am doing. At one point it is a shortage of program memory, at another point it is the lack of availability of some well documented software. Forums are great, but well written software documentation is even better. I know everything is free and open, so make do.

    Ray
  • Like I said, it is a mystery. Could it be the obvious that there is a hardware problem with your board? Are you using the correct USB cable to power it? Using a cable that is not rated for the current will result in voltage drops and erratic behavior.

    Have you tried loading on other software onto the Flip recently to check that it works?

    ANYONE WITH A FLIP? CAN YOU PLEASE TRY LOADING THIS BINARY TO MAKE SURE IT WORKS.
    Serial terminal at 115200. The binary is 64k but the loader will only ever load the first 32k anyway.

  • Ray I can't load your mytachyon.zip. 'propeller-load' that I use for programming from the 'simpleide' software won't accept your .binary file. I can load TACHYON.binary Peter recommends from the dropbox which boots like it should:-
    Propeller .:.:--TACHYON--:.:. Forth V5r6 NEON 560190915.1000
      *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r6 NEON 560190915.1000
    3BE8: EASYFILE         SDHC card + FAT32 Virtual Memory File System V1.2 171024-0000
    2F78: TOOLS            DEV TOOLS
    1A40: EXTEND           Primary extensions to TACHYON V5 kernel  - 190916-0730
    
    
    FREQ = 80.00MHZ
    *** INITS ***
    MOUNT 4228
    NO ROMS
    *** I2C ***
    $A0 EE/RTC
    $C0 unknown
    I/O =  31 :UHUU 27 :~~~~ 23 :~~~~ 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~~~~ 3 :UU~U
    INTERCOM: &15.55.55.55 @2,000,000
    
    CODE:$4CD4 = 19156 bytes
    NAME:$52F0 = 8464 bytes
    DATA:$7849 = 825 bytes
    FREE:      = 1564 bytes
     Data Stack (0)
    Mon, 01 Jan 2001 00:00:00 UTC *Card Error*
    --------------------------------------------------------------------------------
    ...
    

    I use 'propeller-load' for programming because I haven't got a proper PROP PLUG, only an FTDI module which I've modified to output RTS to reset the P1 for programming.

    My Propeller board is diy with a 5MHz crystal, with 64k eeprom on ports P28 and P29. The terminal is connected to P30 and P31. An SDcard is connected to P0 to P3. Peter's TACHYON.binary is set up for the SDcard on other pins. To get the SDcard to work I input on the terminal : &03.00.02.01 SDPINS . Then the SDcard is recognised and tachyon remembers the new pins.

    1. How are you powering your board? Check the supply voltages on the FLiP are within spec.

    2. How are you programming your FLiP?

    3. If it does program ok and you get a boot up message, what happens when you run this simple soak test by entering on the terminal:

    BEGIN WORDS KEY UNTIL

    It should repeatedly output the word list to the screen until you press any key, then you should get the tachyon prompt waiting for more input from you.

    Cheers, Bob G4BBY

  • I took Peter's advice and ran the 64K binary file on another FLiP, and it looks like it is working as expected.

    So, what is wrong with the FLiP that I was using. This is the worst case scenario, it gets a program loaded and it runs, but it does not work as expected. I used the same USB cable for both units. The reason that I switched the FLiP modules is because the other one was running weird with a SimpleIDE C program that I created. Now I have a FLiP that runs as expected, using Tachyon, but it runs flaky with the very short SimpleIDE C test program.

    Scratching my head, do I now have two flaky FLiP modules, that still run programs, in a flaky manner. I thought the FLiP was supposed to be a highly reliable unit.

    Has anyone created a diagnostic program for checking out the FLiP module. What would have to be checked, the RAM or the processor itself, or something else.

    I guess if the FLiP cost a dollar, I could buy them by the dozen, and just toss them as they start to work flaky.

    Ray
  • bob_g4bbybob_g4bby Posts: 247
    edited 2020-08-28 14:53
    Be methodical, only change one thing at a time and draw conclusions based on what you see.

    1. Please follow my advice above
    2. If you can run the Tachyon soak test for 1/2 hr or more, then the EEPROM, crystal, USB link and quite a lot of the CPU are OK.
    3. Try that on both modules
    4. Have you ever reliably run the SimpleIDE C test program? If not, it isn't a useful test of the hardware - and it may have a bug in it that causes a crash after some time. Try simple SPIN programs and see if they soak test OK.
    5. If you are getting power from the USB port of a PC, are you sure the PC is capable of giving enough? Some USB ports have limited output. Some USB ports require a command to raise the output power. If your P1 gets starved of power momentarily that could lead to unreliability
  • Use a shorter or heavier USB cable and avoid USB hubs for the moment. A lot of cables are no up to the task and are only good for data only perhaps.

    One of the problems with the USB spec right from the beginning was this reliance on 5V power over a long cable and still expect to get 5V. It would have been a much simpler matter to supply say 12V and switch down at the load. That way the current and thereby the voltage drop would be much less, but even so, there is plenty of headroom in 12V nonetheless.
  • It looks like a power issue. I tested both FLiP modules with external power attached to the 6-9V pin. Now it seems to be working as expected. Before I did this I tested all of my USB cables, and none of them resolved the issue.

    The only issue now is, when you load up the Tachyon 64K version, and it starts up, it turns on the p26 LED on the FLiP. It occurs on both FLiP modules, so it seems to be a software issue.

    More test to be done.

    Ray
  • bob_g4bbybob_g4bby Posts: 247
    edited 2020-08-28 21:19
    That's good news, Ray, nice one. If you're puzzled by any part of forth I'd be only too happy to try and help. I expect the LED question will have a simple answer, given a bit of thought from us all. Tomorrow I'll have a look see if it also happens on my P1 board too.

    If none of your USB cables fixed the power issue, it's more likely the computer USB power source is current limited slightly below that required by the P1. The P1 will draw more current, the more instructions per second it has to perform. Maybe your C test program drew that little bit more current than tachyon and so crashed the cpu after a random time.
  • Not sure if this is an issue, when I do the 27 HIGH/LOW separately, it works as expected. But, when I created the onoff word, the LED does not turn on.
    TF5> 27 HIGH ---  ok
    TF5> 27 LOW ---  ok
    TF5> : onoff 27 HIGH 2000 us 27 LOW ;
    TF5> onoff ---  ok
    

    Below is what I see on boot up, man that is a lot of stuff, I think. What are the implications of:
    FREE: = 1366 bytes
    how many words can be developed from this.

    Ray
    Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300[5n
    *** 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>
  • In your onoff word the LED is high for only 2 milli-seconds. It's doubtful that you would see this. Try a longer time.
  • bob_g4bbybob_g4bby Posts: 247
    edited 2020-08-28 22:39
    Yes there is a lot of boot up information and I don't understand it all yet either.

    2000 us is only 2 thousandths of a second, so too quick to notice. Try 2000000 us ( 2 s ), your led switching should be slow enough to see then.

    1366 bytes is (I think) the free space available for new words. Most calls to a forth word will take 2 bytes. This doesn't sound much, but you will be surprised how much forth you can write into that space.

    I wouldn't be surprised if you want more space ( and you are not using an SDcard ), type FORGET EASYFILE <enter>. Check the extra space then available using the shortcut key combination <ctrl> ?

    Remember that FORGET <forth word> will forget that word and all words defined after that word. Very useful when you want to start over.

    This gain in space is not permanent; if you power off and on, it is lost. The new space can be permanent if you save the tachyon image to EEPROM before switching off; just type BACKUP and wait for the 'spinning' symbol to stop.

    The word RESTORE loads tachyon into the P1. The word REBOOT is just like switching the P1 board on, a total restart

    Tachyon is a bit of an elephant inside a P1, it does occupy a lot of space. Nevertheless, quite complicated programs are possible. With TAQOZ in the P2, you have a very large memory space available for user programs and data. I'm looking forward to experimenting with that, but after some time getting used to Tachyon.

    It surprises me how little the Propeller community uses Tachyon or Taqoz. If they really got behind it, helped flesh out the missing documentation, and discovered how powerful it was..... Peter Jakacki has achieved so much with it, partly because he's very inventive and enthusiastic, but partly because forth makes for a very efficient programming language when you know it well. It all depends how much effort you are willing to put into learning the language and giving yourself enough time to play with it to find out what works. That doesn't happen overnight! I recommend reading the 'Starting Forth' and 'Thinking Forth' books in Peters' dropbox. They explain a great deal, and simply.
  • ErNaErNa Posts: 1,665
    Yes, Peter has done a great job with Tachyon. It's just a pity that we are forced to follow the mainstream and find so little time to just do it better. Since the days of the HP45 I know there is something behind the mirror I should investigate and use. Only now I find the time and finally will make use of what I have around for so long. With a working application and the migration to the P2 I see better times to come. We all have seen what you can reach with a language structured so simple, using the same words over and over, and that things become real nobody could imagine. Augmented reality in perfection without even knowing a computer language. That gives hope, if only we make use of reasoning. It's just true: everybody catches an idea equally fast, but to some you have to explain it more often. If you only remember the Autobahn to be good, it was very bad!
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-29 00:27
    I prefer to leave all the junk in the trunk including all the tools and filing cabinet. It's easy enough to RECLAIM redundant private words but there is still more than enough memory to play with and even for small applications. Remember, this has the full FAT32 and various sensors and timers etc. If I listed them here it would probably be a very very long post. Tachyon is not just "a language", it is a complete development and runtime library and environment.

    BTW, When I need even more memory I start with the kernel, add EXTEND, FORGET TOOLS, add EASYFILE, then RECLAIM unused private dictionary words. With that I have enough free memory to add EASYNET with FTP and HTTP servers yet still have enough memory left over for an application too.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-29 01:49
    BTW, it was mentioned that the startup message was a bit cryptic, so I thought I would describe each message. I will try to put this information somewhere in the documentation and on SF.

    STARTUP MESSAGES:
    (line number for reference)
     1    Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
     2    *** MODULES ***  Propeller .:.:--TACHYON--:.:. Forth V5r7 NEON 570190926.2300
     3  3C94: EASYFILE         SDHC card + FAT32 Virtual Memory File System V1.2 171024-0000 
     4  300E: TOOLS            DEV TOOLS 
     5  1AC0: EXTEND           Primary extensions to TACHYON V5 kernel  - 200514-0100 
     6  FREQ = 80.00MHZ
     7  *** INITS ***
     8  MOUNT 42DA
     9  NO ROMS
    10  *** I2C ***
    11  $A0 EE/RTC
    12  I/O =  31 :UHUU 27 :U~~U 23 :~~UD 19 :~~~~ 15 :~~~~ 11 :~~~~ 7 :~~~~ 3 :~~~~
    13  INTERCOM: &05.78.32.55 @3,990
    
    14  CODE:$4D86 = 19334 bytes 
    15  NAME:$52DC = 8484 bytes 
    16  DATA:$7849 = 825 bytes 
    17  FREE:      = 1366 bytes 
    18   Data Stack (0)
    19  Mon, 01 Jan 2001 00:00:00 UTC 
    20  CARD: SL08G SD03.80 #050D.A260 2016/2 !C0FF.80AF 1,866us
    21  FAT: #2545.ADF1 MSWIN4.1 TAQOZ       FAT32   7,944,011,776 bytes (32kB clusters)
    
    22  --------------------------------------------------------------------------------
    23  TF5>
    

    DESCRIPTION:
    1   Kernel version and build timestamp with first 2 digits same as the version.
    2   EXTEND is running and firstly it lists the main extend modules that it finds (version is reprinted)
    3   Code address of module and name plus a description
    6   Reported frequency (uses a backup of the value stored at address 0, since this location gets "clobbered" easily)
    7   Lists the INITS that are executed by the autostart routine BOOT
    8   First init is MOUNT at code address $42DA
    9   Search for ROMS in upper EEPROM (needs a *** to delineate it perhaps)
    10  I2C bus scan and possible identificaton
    11  First I2C device at $A0 (or alt 7-bit notation $50) is always EEPROM but some chips include RTC
    12  List I/O pin states - U for pulled up, D for pulled dowm, H for high output, L for low output, ~ for floating input
    13  INTERCOM is the built-in console networking but does not default to any particular values (could make it)
        Settings are group:id:txrx pin:tx en pin(RS485) and baud (normally 2000000)
        Pins >31 are invalid and unused so txrx>31 means INTERCOM is disabled
    14  Current code pointer and size
    15  Current name pointer and size (builds down towards code)
    16  Current data pointer - this area is separate from code and names for variables and buffers
    17  FREE memory between end of code and dictionary not including data area and buffers.
        The dictionary is packed and points to code, so it can be stripped of private or unwanted headers and compacted
        Code memory can be released through FORGET <name> which resets code back to there and forgets all names up to there inclusive.
    18  Stack list (should always be empty at 0 items) (Note: this is probably redundant)
    19  Timers and time and date and maintained in the background although they are reloaded at boot from hardware if present.
    20  Init SD CARD and display CID, serial number, mfg date, OCR with msb set as a flag, then average random sector timing test result
    21  Mount FAT32 and report 
    22  Normal escape key DISCARD and cancel any input response is also a useful delineator
    23  Standard prompt - this can be changed by the user (i.e. NULL$ ID!)
    

  • bob_g4bbybob_g4bby Posts: 247
    edited 2020-08-29 10:28
    So P26 goes high on switch on or REBOOT on my card also with that version of tachyon. Earlier versions, it does not. I notice if I set it low it stays low until a reset. I've been looking in the source code EXTEND.FTH from the dropbox but can't see where it is set.

    My guess is that Peter just uses it to drive an LED on to show that Tachyon (and any user application ) has successfully started when there is no computer terminal connected

    So I notice that three extensions to the kernel language are loaded EXTEND, TOOLS and EASYFILE.

    If FORGET EXTEND is typed in, the free space for a user program jumps up to around 20 kbytes. However, the BACKUP word is lost because it was defined in EXTEND.FTH
    If the EXTEND.FTH file is reloaded via the terminal, the free space is then around 7.6 kbytes. I notice that EXTEND.FTH contains a lot of non-essential extensions for driving certain chips and so on. So EXTEND.FTH can be reduced in size quite a bit to regain more user program space, remembering to keep the BACKUP facility so the system can be saved off to eeprom. A useful exercise would be to see how small an EXTEND.FTH can be made and still do BACKUP ;-)

    I've been looking for the source code for the TOOLS module, but haven't found it - can anyone point me to it please? Perhaps I'm having a 'senior moment'
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-08-29 11:08
    I checked the binary and remember that it is all precompiled and configured for at least one board, the one I compiled it on. The binary includes EASYFILE and the SDPINS are setup for a pcb that has the SD chip enable on P26. When it tries to mount it then P26 is left high, that's all. If you are not using an SD card then you can disable this by typing &99.99.99.99 SDPINS which sets each SD pin to an invalid pin and automatically saves these settings to EEPROM.

    If you want to start over by forgetting EXTEND you should really do a COLD start, or hit ^Z^Z shortcut. This leaves the kernel ready to take EXTEND again, but normally that would be unnecessary. What you might want to do at a later stage but not while you are learning, is to FORGET TOOLS which will forget EASYFILE and many of the tools and leave 11.5k free. BUT, DON'T DO IT as there is no need to and it will only hamper you.

    BTW, COLD itself does not wipe the EEPROM since that would require EXTEND. If you reset after a COLD it will fire up normally with EXTEND.
Sign In or Register to comment.