TAQOZ - Tachyon Forth for the P2 BOOT ROM

1272829303133»

Comments

  • no! no distraction! no, no, no! Not in those times ;-)
  • Hello @Peter Jakacki ,

    first of all many thanks for your work on TAQOZ - taking profit of the current forced 'holydays' I finally had time to dig into Forth and to carry on a project of mine waiting for five or six years now.
    Playing with the P2Eval is really joyful, waiting for your P2D2 to be shipped to ErNa. The project reads 4x serials, logs all the data to a uSD, make some calculations and spits out numbers via serial through radio and BT. Next step is to add more sensors via I2C and as soon as I have the P2D2 to take profit of the RTC as well. And, of course, a display is likely to be added, too :)

    I had been trapped in a nasty 'bug' due to the fact TaqOz is using a shared register amongst COGs for the SWITCH statement. It happened that one COG was changing the SWITCH value and therefore they went havoc, sometime one, sometime the other - not something immediate for me to trace! It took a while to discover it out, and when I realized what was happening I finally dug into your code. In order to avoid the trap, I finally changed TaqOz source code as follows:
    Original:
    *** declaration
    uswitch         res 4           ' target parameter used in CASE structures
    *** hubexec code
    ' SWITCH ( val -- )
    _SWITCH word    rg+uswitch,STOREX+ex
    
    ' SWITCH@ ( -- val )
    SWFETCH word    rg+uswitch,FETCHX+ex
    
    Patched:
    *** declaration
    cswitch     long    0   
    *** COG code
    _SWITCH     mov     cswitch,a
                jmp     #DROP
                
    SWFETCH     mov     X, cswitch
                jmp     #PUSHX
    

    This is of course a quick'n dirty one, but I think it's good to point it out so to avoid others to fall into the same trap. If you have better solutions, they will of course be very welcome. And thank you again for letting me into Forth - that's really something absolutely powerful to be used with micros!!!
  • FYI I am compiling TaqOZ from source with FlexGui on Windows after some mods to labels and the like. BTW, I also modified the TaqOZ I2C driver to support clock stretching since I had a device that needed that.
    ORIGINAL:
    I2C.CLOCK	waitx	i2cdly
    		drvh	sclpin
    		waitx	i2cdly
    		testp	sdapin wc
    		waitx	i2cdly
    		drvl	sclpin
    	_ret_	waitx	i2cdly
    
    MODIFIED
    I2C_CLOCK	waitx	i2cdly
    		flth	sclpin
    	        waitx	i2cdly
    .strtch         testp   sclpin wc
            if_nc   jmp     #.strtch
    		testp	sdapin wc
    		waitx	i2cdly
    		drvl	sclpin
    	_ret_	waitx	i2cdly
    
    I don't know if that's entirely correct, but works for me. The label cannot contain dot(s) because it is not accepted by flexgui due to SPIN2 specs.
  • Peter JakackiPeter Jakacki Posts: 9,350
    edited 2020-05-08 - 06:04:57
    jurop wrote: »
    Hello @Peter Jakacki ,

    first of all many thanks for your work on TAQOZ - taking profit of the current forced 'holydays' I finally had time to dig into Forth and to carry on a project of mine waiting for five or six years now.
    Playing with the P2Eval is really joyful, waiting for your P2D2 to be shipped to ErNa. The project reads 4x serials, logs all the data to a uSD, make some calculations and spits out numbers via serial through radio and BT. Next step is to add more sensors via I2C and as soon as I have the P2D2 to take profit of the RTC as well. And, of course, a display is likely to be added, too :)

    I had been trapped in a nasty 'bug' due to the fact TaqOz is using a shared register amongst COGs for the SWITCH statement. It happened that one COG was changing the SWITCH value and therefore they went havoc, sometime one, sometime the other - not something immediate for me to trace! It took a while to discover it out, and when I realized what was happening I finally dug into your code. In order to avoid the trap, I finally changed TaqOz source code as follows:
    Original:
    *** declaration
    uswitch         res 4           ' target parameter used in CASE structures
    *** hubexec code
    ' SWITCH ( val -- )
    _SWITCH word    rg+uswitch,STOREX+ex
    
    ' SWITCH@ ( -- val )
    SWFETCH word    rg+uswitch,FETCHX+ex
    
    Patched:
    *** declaration
    cswitch     long    0   
    *** COG code
    _SWITCH     mov     cswitch,a
                jmp     #DROP
                
    SWFETCH     mov     X, cswitch
                jmp     #PUSHX
    

    This is of course a quick'n dirty one, but I think it's good to point it out so to avoid others to fall into the same trap. If you have better solutions, they will of course be very welcome. And thank you again for letting me into Forth - that's really something absolutely powerful to be used with micros!!!

    I haven't had a good look at your post but since rg+switch is actually a cog dependent hub register, it depends upon whether a cog has setup it's own register area in hub. The default is at $200 but $300 is free and you could probably put another set at $380 since it is only the console task that needs more room. Otherwise just allocate some data memory and then assign it like this in the cog's startup code.
    128 bytes myregs
    
    pub SETUP_COG
    $200 myregs 128 CMOVE --- maybe make a copy of the main cog's current calues.
    myregs 1 COG! --- setup this cog to use myregs for local registers
    
  • Peter JakackiPeter Jakacki Posts: 9,350
    edited 2020-05-08 - 06:06:13
    TAQOZ 2v5 as it currently is with everything including the kitchen sink loaded onto this binary. If you run RECLAIM you can reclaim around 4k from the dictionary although anything in EXTEND has already been reclaimed but 4k is neither here nor there at present.

    btw, I have had a chance to compare TAQOZ to Mecrisp Forth on the ARM and while Matthias has done a wonderful job (and kudos to the guy) of maintaining this on all the different platforms, and there are a lot, I find that there are so many features built into TAQOZ that I've been spoilt. Even just being able to send or paste source code at high speed without any kind of delays is a luxury I now appreciate even more. On my little ARM chip I have to paste code with 1ms character delays and 100ms line delays and it is painfully slow and it is hard to see errors. Yes, I will write buffered interrupt drivers for it but you have to decide if it is "compiletoflash" worthy beforehand whereas TAQOZ just loads to RAM (See, no Flash, no problems). Besides, TAQOZ is really compact without any problems with speed, especially on the P2.

    TAQOZ can now have code that exceeds the 64k 16-bit address limit and the memory map has been remangled to suit so that there is no adjustment needed when the first 64k "page" is full. I just need help filling it now.

    Console boot report:
    KERNEL            Parallax P2  *TAQOZ* Extensible Firmware  V2.5 'CHIP' 300MHz 200504-1430
    MODULES:
      *SPLAT*       SPLAT - Serial Propeller Logic Analyzer Terminal  200417-0000 
      *SIM*         A SIMULATOR FOR THE 65C02 - 200217.0000 
      *PLEXLED*     CharliePlexing LED device driver 190714.0000
      *PS2*         PS/2 KEYBOARD 
      *MORSE*       Morse code keyer 200126-0000 
      *CLKGEN*      Si5351 Clock generator 190800-0000
      *C2*          C2 Debug Interface for Silabs Microcontrollers - 200424.0000 
      *EASYNET*     WIZnet NETWORK SERVERS 160707.1500 
      *W5500*       WIZNET W5500 driver for TAQOZ V1.0 191007 
      *LIFE*        Conway's Game of Life for TAQOZ in the P2 ROM V1.0 190226.0000 
      *MANDELBROT*  MANDELBROT VGA DEMO 190800-0000 
      *TEXT*        VGA BMP TEXT 190800-0000
      *BMV*         BMV VIDEO PLAYER 190800-0000
      *WAVE*        WAVE AUDIO FILE PLAYER 190800-0000
      *BMP*         BMP FILE VIEWER 190800-0000
      *TIM*         TAQOZ INTERACTIVE MEDIA - AUDIO, TEXT, IMAGE & VIDEO DRIVERS 200403-1200 
      *TIA*         TAQOZ INTERACTIVE ASSEMBLER for the PARALLAX P2 - 200327-2300
      *SPIRAM*      LY68L6400 8MB SPI RAM ACCESS 191020-0000
      *DECOMPILER*  A decompiler for TAQOZ 190825-0000
      *RTC*         RV-3028 RTC DATE and TIME 190800-0000
      *DISK*        SD DISK REPORTING & FORMATTING TOOLS 190800-0000
      *EASYFILE*    SD CARD and FAT32 with VIRTUAL MEMORY  190800-0000
      *SMARTPINS*   SMARTPIN FUNCTIONS and drive modes 190800-0000
      *P2CLOCK*     P2 CLOCK CONTROL 190800-0000
      *ANSI*        ANSI TERMINAL SUPPORT 200410-0000
      *EXTEND*      Primary kernel extensions 200426-1000
      *SPIFLASH*
    MEMORY MAP
      CODE:         0D87A  55,418 bytes
      WORDS:        1AFCC  20,366 bytes
      DATA:         7E26D  621 bytes
      ROOM:                55,122 bytes
    HARDWARE
      PCB           P2      (P2D2)
      CLOCK IN      20MHZ
    DEVICES
      SD CARD       63 GB  SANDISK   SD SC64G REV$80 #35190404 DATE:2018 /10
      SPI FLASH     16MB WINBOND $EF40_1800 #4837448895114529879
    I2C DEVICES
      $A4           RV-3028 RTC
      $C4           Si5351A CLOCK GEN
                    2020/05/08 FRI 15:47:47
    -------------------------------------------------------------------------------
    TAQOZ#
    


  • kubakuba Posts: 46
    edited 2020-06-23 - 18:36:59
    Is there a way to extend the built-in Forth to the "full" V2 using the serial terminal without the SD card? That is, is there a file that could be dumped into the terminal to extend TAQOZ from 1.1 to 2.0, without booting from SD?

    If this was mentioned somewhere - I apologize. I vaguely recall I may have read about such an online update. But a problem I have is that the "documentation" is spread far and thin and it's almost impossible to find anything the 2nd time. There's stuff on forums, Dropbox, SourceForge, and Google docs... Can't it be all put into a GitHub project? Their UX is much better than the ad-laden sad pile of excrement SourceForge has (sadly) become...

    It is my understanding that you've moved your authoritative location to SourceForge. In that case may I suggesting removing Dropbox files and putting a short readme in the root folder just pointing people to SF? It is extremely confusing as it is (unless I mixed some obvious blurb on Dropbox).

    Another problem I see is that the development is not done using any version control, SF is basically used as a file repository with a UI worse than DropBox.
  • You can use the python loader that is packaged with the zip file to load the file serially.
    python3 loadp2.py _BOOT_P2.BIX
    
    I haven't checked this with other loaders but this works and is the method I use.

    Dropbox is convenient for me and I share the whole kit n caboodle so while it is a bit of a mess, it's also a treasure trove. The SourceForge pages are just the files that are necessary so that there is no confusion, plus the wiki pages etc. This suits me and while it is an extra workload, I'm happy to do it. Any extra is an extra on top of the mountain that I already have.

    Bob Edward's documentation is coming along nicely and along with material that others have submitted both for Tachyon and TAQOZ has helped and no doubt we can release an early version soon. This doc mainly focuses on TAQOZ ROM since it is fixed and simple.
  • bob_g4bbybob_g4bby Posts: 34
    edited 2020-07-02 - 07:42:52
    Just to say more - I'm the Bob Edwards mentioned, retired EE in the UK. I'd like to use P2 / TAQOZ for ham radio - I currently build PIC / Flashforth things, I don't have any P2 hardware yet - recently bought P1s, but not used yet.

    As a way of learning, I suggested to Peter I write a beginner's introduction. He very kindly set up a Google Docs entry for it and has contributed quite a lot too. It's 37 pages, very basic stuff aimed to pull in the curious and promote TAQOZ professionally. It's not original - just material from the www + Peter's help (thank you).

    For the same reason, I'm compiling a glossary of TAQOZ ROM words to print out on as few pages as possible and keep by the terminal. That's about 1/3rd complete helped by the Tachyon glossary, Peter's TAQOZ ROM web site and the ROM listing. There's a few new words that aren't obvious, but that's OK.

    Any other past or potential Tachyon 'technical authors' out there?
  • Peter JakackiPeter Jakacki Posts: 9,350
    edited 2020-07-02 - 08:41:22
    You've done well Bob. There's a certain amount of oomph required to start and then to keep it rolling to completion, and you have certainly done that mate.

    I've been motivated to chip in with my bit and at the moment I just need to finish off some missing sections, and some of the formatting. It's setup in landscape format so it is easy to view online but also paginated with a view to printing and allowing for what I think would make a great top spiral bind. Come to think of it, I must allow for that at the top of odd pages and at the bottom of even pages to allow for double-sided printing. I checked online with Officeworks here and they would print and bind that with a heavy cover page for just a few dollars. However I'd be inclined to reduce the print scale to booklet size and increase the gsm etc.

    I will try and finish up this weekend in-between hardware testing and pcbs and check with Bob because it's one of those things that you want to get right before you release it.

    This book was originally entitled along the lines of " The Hitchhikers Guide...." but we changed that to "The Bit Bashers Guide to the Parallax P2 ~ Using TAQOZ ROM Forth" to reflect the hardware etc.

    Please feel free to contribute material which if you do it in Google docs you can treat it as a work-in-progress and we can co-edit before incorporating in new documents.Don't be afraid to contribute actual content or feedback on content is helpful too. I think I have a million emails from comments advising me to add a space or a tab here and there. Content and wording first and then formatting is important for actual printing later. The glossary though will be a big one because each word should be checked and it would be good to have a usage example too. Then we can take material from there and produce a quick reference sheet too, much like we used to have for Spin and PASM.

    1688 x 1190 - 72K
  • MJBMJB Posts: 1,167
    bob_g4bby wrote: »
    Just to say more - I'm the Bob Edwards mentioned, retired EE in the UK. I'd like to use P2 / TAQOZ for ham radio - I currently build PIC / Flashforth things, I don't have any P2 hardware yet - recently bought P1s, but not used yet.

    As a way of learning, I suggested to Peter I write a beginner's introduction. He very kindly set up a Google Docs entry for it and has contributed quite a lot too. It's 37 pages, very basic stuff aimed to pull in the curious and promote TAQOZ professionally. It's not original - just material from the www + Peter's help (thank you).

    For the same reason, I'm compiling a glossary of TAQOZ ROM words to print out on as few pages as possible and keep by the terminal. That's about 1/3rd complete helped by the Tachyon glossary, Peter's TAQOZ ROM web site and the ROM listing. There's a few new words that aren't obvious, but that's OK.

    Any other past or potential Tachyon 'technical authors' out there?

    I started with commenting EXTEND in one of the very early Tachyon versions, when Peter had them online as Google-Docs.
    But is was a very dynamic moving target - now Tachyon 5.x looks pretty stable -
    but I guess only because Peter has a new playground with TaqOz and the P2.

    Then I got distracted and still have no P2 (waiting for the P2D2+extensions).
    Follow the two links in my signature.

    Actually there is SOOOO much in all the Tachyon and now Taqoz threads here in the forums,
    some of it outdated or a bit dusted but a lot still valid in general.
    Just needs to be dug out ... tested and updated, then nicely put in a living document.

    For a lot of things we do not even need the P2,
    P1+Tachyon or IoT5500+P8 (Peter's mini module) with SD/Ethernet/Webserver/Telnet/FTP ... all in Tachyon ...
    still have room for applicatios free ...
  • Hi Ken, If I have all my P2D2 hardware back and tested, I'd like to do another presentation just on the hardware features and how we can use these boards. But rather than putting this down beside a firm date, I have just added another table there in the same format with a tentative but grayed out date of Aug 5th. I'd do it earlier if I can and if a slot is available, or later if I have to.

    Hi Peter, do I interpret correctly: You will ship P2D2 (and companion) early August? In this case I can take European Orders up to end of July to tell you how many boards I'll order. For own purposes I'll need 10. Anyway I will order some evaluation boards from Parallax in the meantime to brigde a gap. To whom it may concern: please PM me your needs.
  • Probably not the best thread for hardware itself, but...

    @ErNa - yes, but until I actually have the boards full assembled and working, I'm holding off accepting more orders which considering the troubles Parallax has just had with Rev C boards, and the troubles I've already had, is not unwarranted. However even though I haven't yet accepted any payment for your order, I still consider it an order that is to be allowed for and filled.

    Everyone who has ordered and prepaid will get some kind of bonus and while I feel pretty bad about it and apologize for these unexpected delays which have been due mainly to the USB chip software and assembly, I think that the final final product is so much better now. I will publish details of all the new stuff early next week and I'd like to do a zoom presentation on it in early August, even covering aspects of pcb layout and design in general.
  • bob_g4bbybob_g4bby Posts: 34
    edited 2020-08-06 - 18:38:39
    If you're new to both Propeller 2 and it's ROM resident language TAQOZ like I was, then this paper is a gentle intro. There are plenty of links at the back to take you further. The other essential item for using TAQOZ is a word glossary. All the words are there, some descriptions are not, but it's still useful as is. Feel free to contribute.
  • Thanks Bob and Peter, very helpful document!

    C.W.
  • I've put the links in a link page that's linked on SourceForge :)

    Here is the link page - I'm still adding to it too.

    Well done Bob!
  • Nice one, Peter, the 'Dawn' document is new to me and looks useful.
  • MJBMJB Posts: 1,167
    great job @bob_g4bby

Sign In or Register to comment.