Shop OBEX P1 Docs P2 Docs Learn Events
TACHYON O/S V3.0 JUNO - Furiously Fast Forth, FAT32+LAN+VGA+RS485+OBEX ROMS+FP+LMM+++ - Page 31 — Parallax Forums

TACHYON O/S V3.0 JUNO - Furiously Fast Forth, FAT32+LAN+VGA+RS485+OBEX ROMS+FP+LMM+++

12829313334109

Comments

  • RickInTexasRickInTexas Posts: 124
    edited 2013-11-19 17:11
    MJB wrote: »
    I had no problem running it in GEAR, so maybe you have a bad download.
    Did you check your crystal settings match those of the binary 10MHz PLL8x?
    My system has 5MHz Pll16x so I did compile the .spin in BST and PropTool myself after changing those settings - all fine

    All my boards are 5MHz Pll16x, so I will have to compile with BST. Still, I should be able to open the Dropbox binary in the Prop Tool, no?

    EDIT: I re-downloaded the binary and now it does open in the Prop Tool, and shows as 10MHz PLL8x.

    Thanks,

    Rick
  • RickInTexasRickInTexas Posts: 124
    edited 2013-11-19 17:42
    OK, success with BST. "WORDS" and "QWORDS" don't work, must I still apply "EXTEND.FTH"? What's the best way to do this, I have not had good luck uploading code via serial, e.g. Teraterm.

    Oh yeah "DEBUG" works and the stack works correctly.

    Rick.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-19 20:05
    OK, success with BST. "WORDS" and "QWORDS" don't work, must I still apply "EXTEND.FTH"? What's the best way to do this, I have not had good luck uploading code via serial, e.g. Teraterm.

    Oh yeah "DEBUG" works and the stack works correctly.

    Rick.

    Although EXTEND.FTH has lots of stuff in it and some may consider it optional to the "kernel" that is not really the case. Really the kernel should just be the basic words needed to allow it to compile further Forth words itself. It is far easier to code Forth in Forth than Forth in Spin syntax. So always load EXTEND.fth and consider it part of the kernel, even if it is a little podgy.

    Teraterm should work fine if you use the safe setting of 20ms line delay, 0 seconds character delay, and no handshaking. Just make sure you are using the SourceForge version of TeraTerm and not some old 90's version. Just copy the source code and paste it always works fine.
    DEBUG can also be called by hitting ^D (control D).
  • MJBMJB Posts: 1,235
    edited 2013-11-20 11:36
    Hi Peter,
    while reading Extend.fth I encountered several pri definitions that I would assume should be around
    to be used in other modules as well.
    So while at the moment it doesn't matter, just for my understanding ... I think those should be pub
    pri IMMEDIATE        e.g. used in MultiFAT.fth
    pri ok ;    
    pri Published
    pri ... ;
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-20 14:41
    MJB wrote: »
    Hi Peter,
    while reading Extend.fth I encountered several pri definitions that I would assume should be around
    to be used in other modules as well.
    So while at the moment it doesn't matter, just for my understanding ... I think those should be pub
    pri IMMEDIATE        e.g. used in MultiFAT.fth
    pri ok ;    
    pri Published
    pri ... ;
    

    Well, how'd that happen? I've also been thinking about variables and constants as to how to define them as "pri" so that they can also be targeted for dictionary removal. I could have a directive that switches the pri and pub modes I guess and then all definitions could follow that unless specifically overridden, maybe "PRIVATE" and "PUBLIC" would do.
  • MJBMJB Posts: 1,235
    edited 2013-11-20 15:57
    since we have no explicit namespaces in TF it is important to use pri for everything that is not really needed globaly.
    Otherwise all good and short names will be gone very fast,
    And writing modular SW is difficult, if you have unexpected name clashes.
    So while pub/pri is not a complete solution it at least reduces the probability.

    and yes - this applies for variables, tables and constants as well.

    within a module the default could be private and only carefully selected symbols get explicitly and consciously exported.
  • MJBMJB Posts: 1,235
    edited 2013-11-20 16:59
    if pub lines get a good inline doc it is easy to extract a manual from it
    like here with notepad++ find applied to EXTEND.fth
    Maybe some convention on { pub --- comments ---- } cold give some additional documentation lines to help group by topic
    Search "pub" (224 hits in 1 file)
      F:\Tachyon 2013-11-19 V23\EXTEND.FTH (224 hits)
    { pub --------------------------- TEXT & IO words ------------------------------------------------ }
        Line 119: pub <CR>    $0D EMIT ;
        Line 120: pub TAB    9 EMIT ;
        Line 122: pub UPPER
        Line 125: pub ECHO ( on/off -- )        1 flags ROT BIT! ;
        Line 126: pub NOOP ;
        Line 127: pub OK ( on/off -- )        IF 0 ELSE ' NOOP THEN prompt 2+ W! ;
        Line 141: pub (             \ stack comment - store details in extra EEPROM if available 
        Line 157: pub HELP ( addr -- )
    { pub --------------------  Variable & Const declaration ---------------------------------------- 
    Create fixed variables by borrowing from assembler syntax using an origin and specify number of bytes for each variable
    This allows us to work from a fixed area in RAM and the variables end up being defined as constants.
    Usage: 
        $4000 ORG
        2    DS readptr        \ allocates 2 bytes for readptr at $4000
        2    DS writeptr        \ allocates 2 bytes for writeptr at $4002
        #64    DS mybuffer        \ allocates 64 bytes for mybuffer at $4004
    
    or
        TABLE myvars #64 6 * ALLOT    \ allocate long aligned memory for 6 sets of 64 bytes
        myvars ORG                \ work from the start of the table
        #12    DS name
        4    DS offset
        \ etc
    
    Test it out:
    myvars . 2E30 ok
    offset . 2E3C ok
    }
        Line 189: pub ORG ( addr -- )        org !    ;
        Line 192: pub DS+            org +! ;
        Line 194: pub DS ( bytes <name> -- )
        Line 206: pub ==                    [COMPILE] CONSTANT ;
    { pub ------------------------- Math words ----------------------------------------------- }
        Line 209: pub ABS ( val -- absval )        DUP 0< ?NEGATE ;
        Line 213: pub /ROUND ( val1 divisor -- val2 )
        Line 220: pub LBIT! ( mask addr state -- )
        Line 225: pub LONGFILL ( addr cnt longval -- ) 
        Line 235: pub MOD ( n1 mod -- rem )         
        Line 243: pub RND ( -- n)
        Line 251: pub COS ( angle -- cosine )
        Line 253: pub SIN ( angle -- sine )
        Line 262: pub ^2  DUP * ;
        Line 263: pub ^ ( n pwr -- n^pwr )
        Line 282: pub SQR ( value -- sqr )
        Line 296: pub HYPOT ( A B -- hypot )
        Line 302: pub QHYPOT ( A B -- hypot )
        Line 309: pub HDEMO ( addr -- )
        Line 324: pub ALIGN ( n align -- n1 )
        Line 330: pub U!    ( long addr -- )
        Line 333: pub U@    ( addr -- long )
        Line 338: pub |< ( bit -- mask )
        Line 342: pub >| ( mask -- bit )        
        Line 347: pub =>    ( n1 n2 -- flg )         1- > ;
        Line 348: pub <=    ( n1 n2 -- flg )        SWAP => ;
        Line 352: pub ++ ( addr -- )        1 SWAP +! ;
        Line 353: pub -- ( addr -- )        -1 SWAP +! ;
        Line 354: pub W++ ( addr -- )        1 SWAP W+! ;
        Line 355: pub W-- ( addr -- )        -1 SWAP W+! ;
        Line 356: pub C++ ( addr -- )        1 SWAP C+! ;
        Line 357: pub C-- ( addr -- )        -1 SWAP C+! ;
        Line 360: pub ~ ( addr -- )        0 SWAP ! ;
        Line 361: pub ~~ ( addr -- )        -1 SWAP ! ;
        Line 362: pub W~ ( addr -- )        0 SWAP W! ;
        Line 363: pub W~~ ( addr -- )        -1 SWAP W! ;
        Line 364: pub C~    ( addr -- )        0 SWAP C! ;
        Line 365: pub C~~ ( addr -- )        -1 SWAP C! ;
        Line 368: pub @.    ( addr -- )        @ U. ;
        Line 386: pub UNLOOP
        Line 390: pub ESC? ( -- flg \ true if an escape has been pressed )
    { pub ---------------------- FORMATTING --------------------------- }
        Line 395: pub TYPE ( str cnt -- )
        Line 400: pub EMITS ( ch cnt -- )         0 DO DUP EMIT LOOP DROP ;
        Line 401: pub SPACES ( cnt -- )         BL SWAP EMITS ;
        Line 405: pub .HEAD ( str -- )        DUP #100 < IF ' indent 1+ ! ELSE CR DUP .STR STRLEN indent SWAP - SPACES THEN ;
        Line 439: pub .NUM  ( sign+sep+digits;base -- ) 
        Line 460: pub .DECX                $400A .NUM ;
        Line 461: pub .INDEX                CR I .WORD ." : " ;
        Line 462: pub .ADDR ( addr -- )         CR $4810 .NUM ." : " ;
        Line 463: pub U.N ( data digits -- )
        Line 474: pub XY ( x y -- )            ";" SWAP VC "H" VP ;
        Line 476: pub HOME                "H"
        Line 478: pub ERLINE            "2" ESCB "K" EMIT ;
        Line 479: pub VCLS                HOME
        Line 480: pub ERSCN                "2" ESCB "J" EMIT ;
        Line 481: pub CURSOR ( on/off -- )        "?" ESCB ." 25" IF "h" ELSE "l" THEN EMIT ;
        Line 482: pub PLAIN                "0"
        Line 483: pub (VA) ( ch -- )        ESCB "m" EMIT ;
        Line 484: pub REVERSE            $37 (VA) ;
        Line 485: pub BOLD                $31 (VA) ;
        Line 501: pub RECT ( x1 y1 width height -- )
        Line 509: pub X1                locals @ ;
        Line 510: pub X2                1 @X @ ;
        Line 511: pub X3                2 @X @ ;
        Line 512: pub X4                3 @X @ ;
        Line 514: pub LOCAL ( n -- )             locals OVER @X 3RD 2* 2* $40 SWAP - <CMOVE 0 DO I @X ! LOOP ;
        Line 515: pub RELEASE ( n -- )        DUP @X locals ROT 2* 2* $40 SWAP - CMOVE ;
        Line 520: pub PFA>NFA ( pfa -- nfa )
        Line 531: pub CLKFREQ ( -- freq ) 
        Line 534: pub COGREG! ( dat ix -- )
        Line 537: pub COGREG@ ( ix -- dat )
        Line 548: pub MASK? ( n -- mask )
        Line 552: pub MODPINS ( ce-miso-mosi-clk -- )
        Line 562: pub WAITPNE ( mask -- )            3 COGREG! (WAITPNE) ;
        Line 563: pub WAITPEQ ( mask -- )            3 COGREG! (WAITPEQ) ;
        Line 569: pub COGINIT ( cog code par -- )
        Line 576: pub COGSTOP ( cog -- )
        Line 582: pub RESET        
        Line 584: pub CLKSET ( n -- )
        Line 588: pub RCFAST    0 CLKSET ;
        Line 589: pub RCSLOW    1 CLKSET ;
        Line 590: pub CLK ( multiple0..4 -- ) 3 + 4 C@ 7 ANDN OR CLKSET ;
    { ------------------------------ TASKS ---------------------------------------------------------------------------------------------- }
        Line 604: pub TASK? ( -- task | Find the next available cog that's free to run a task - ready and in IDLE )
        Line 608: pub RUN ( pfa cog -- | USAGE: ' MYTASK TASK? RUN )
        Line 620: pub ATN?    \ alias for newer command ATN@
        Line 621: pub ATN@ ( -- cmd \ read in a command from the tasks variable and return with it and also clear the tasks variable )        
        Line 626: pub ENQ! ( data -- )
        Line 631: pub ATN! ( cmd cog -- \ Send data to another task )
        Line 635: pub ENQ@ ( cog -- data )
        Line 641: pub TASKS
    { pub ----------------------  STRING ----------------------------------------------------------------------------------------------- }
        Line 678: pub STRING ( str max -- ) \ Specify max size of string else use 0 for string length
        Line 694: pub LEN$ ( str -- len )    STRLEN ;
        Line 695: pub TYPE$ ( str -- )    .STR ;
        Line 703: pub COPY$ ( str1 str2 -- )
        Line 711: pub APPEND$ ( str1 str2 -- )
        Line 719: pub +CHAR ( ch str2 -- )
        Line 722: pub MID$ ( str offset len -- str )
        Line 725: pub LEFT$ ( str len -- str )
        Line 728: pub RIGHT$ ( str len -- str )
        Line 732: pub ERASE$ ( str -- )
        Line 736: pub LOCATE$ ( ch str -- str )
        Line 742: pub COMPARE$ ( str1 str2 -- flg )
        Line 752: pub PRINT$        .STR ;
    
        Line 764: pub NORMALIZE ( data   bits low high -- result )
        Line 791: pub !ADC ( pins -- )            \ long encoded pin descriptor &ce.miso.mosi.sck (i.e. &00.01.02.03)
        Line 805: pub ADC@ ( ch -- data )
        Line 816: pub ADCBUF ( buffer -- )    \ Read all 8 ADC channels into specified word buffer
        Line 820: pub VOLTS@ ( ch -- volts.00 )    \ Read back the pin as a voltage scaled to 2 decimals
        Line 826: pub LSADC
    { pub -------------------- IO ----------------------------- }
        Line 842: pub PINSET ( pin -- )
        Line 845: pub PINCLR ( pin -- )
        Line 849: pub PININP ( pin -- )        
        Line 853: pub PINS@ ( pin for -- ) 
        Line 860: pub MASKS ( pin cnt -- mask )
    
        Line 867: pub second ( n1 - )
        Line 868: pub seconds ( n1 -- )
        Line 888: pub MATCH
        Line 898: pub ANY        KEY DUP EMIT any C! ;
        Line 920: pub MY
        Line 924: pub QWORDS
        Line 950: pub .ATRS 
        Line 958: pub WORDS
        Line 992: pub MODULES
        Line 1012: pub BOOTS
        Line 1021: pub MAP ( src cnt -- )
        Line 1030: pub RMAP     0 $8000 MAP ;
        Line 1033: pub BDUMP ( addr cnt buffer -- )
        Line 1050: pub LB ( cnt -- ) \ Dump the buffer
        Line 1054: pub DUMP ( addr cnt -- )     OVER BDUMP ;
        Line 1062: pub SERBAUD ( baud -- ) 
        Line 1070: pub SEROUT ( data pin -- ) 
        Line 1079: pub SERIN ( pin -- data )
        Line 1088: pub CON        
        Line 1093: pub NULLOUT        ' (NULLOUT) uemit W! ;
        Line 1096: pub .LAP        
        Line 1110: pub SPRS 
        Line 1121: pub PINLOAD? ( pin# -- flg )
        Line 1131: pub PINS            \ prefer to keep this the same as other similar words as a ? denotes a return flag
        Line 1132: \ pub PINS?
    { pub ----------------------------- COUNTERS --------------------------------------- }
        Line 1174: pub A        ctr C~ ;
        Line 1175: pub B         1 ctr C! ; 
        Line 1178: pub NCO     4 
        Line 1179: pub CTRMODE ( n -- | Writes to the CTRMODE field of the current CTR channel without disturbing the other bits of the counter )
        Line 1188: pub DUTY
        Line 1191: pub PLL
        Line 1194: pub PLLDIV ( n -- )
        Line 1203: pub APIN ( pin -- | Set the APIN of the current CTR )
        Line 1208: pub BPIN ( pin -- | Set the BPIN of the current CTR )
        Line 1214: pub FRQ ( n -- | Set the value of the current FRQ either A or B )
        Line 1219: pub DAC! ( byte pin -- )
        Line 1228: pub MHZ ( MHz -- )
        Line 1230: pub KHZ ( khz -- )
        Line 1232: pub HZ ( hz -- )
        Line 1235: pub MUTE
        Line 1285: pub .TIME
        Line 1287: pub .ASTIME ( hhmmss -- )
        Line 1290: pub .HHMMSS
        Line 1295: pub TIMER ( channel -- addr )
        Line 1298: pub TIMEOUT ( ms channel -- )
        Line 1301: pub TIMEOUT? ( channel -- flg )
        Line 1304: pub ALARM ( pfa channel -- ) 
        Line 1344: pub RUNTIMERS ( table cnt -- )
        Line 1390: pub RUNPWM ( pin channels table -- | Start up a task to run the multichannel PWM "object" )
        Line 1397: pub PWMFREQ ( hz --  )
        Line 1407: pub PWM! ( duty8 channel -- )
        Line 1419: pub PWM! ( duty8 channel -- )
        Line 1424: pub % ( %duty -- dutyval )
        Line 1441: pub EEPROM
        Line 1444: pub I2CPINS ( sda scl -- ) 
        Line 1451: pub I2CSTART
        Line 1459: pub I2CSTOP
        Line 1465: pub I2C!? ( data -- flg )         \ write a byte to the I2C bus and return with the ack (0=ack)    
        Line 1478: pub I2C! ( data --  )            \ write a byte to the I2C bus     
        Line 1489: pub ackI2C@
        Line 1492: pub I2C@    ( ack -- data )    
        Line 1502: pub SI2C!?     ( data -- )         \ write a byte to the I2C bus and return with the ack (0=ack)    
        Line 1512: pub SI2C!  SI2C!? DROP ;
        Line 1516: pub SI2C@    ( ack -- data )    
        Line 1525: pub I2CBUS
        Line 1565: pub EE! ( byte addr -- )
        Line 1569: pub EE@ ( addr -- byte ) 
        Line 1579: pub ESAVE ( ram eeprom cnt -- )
        Line 1592: pub ESAVEB ( ram eeprom cnt -- ) 
        Line 1598: pub ELOAD ( eeprom ram cnt -- )
        Line 1605: pub ECOPY ( eesrc eedst cnt -- )
        Line 1612: pub EFILL ( src cnt ch -- )
        Line 1621: pub EVERIFY ( ram cnt -- )
        Line 1631: pub 64K? ( -- flg )
        Line 1643: pub BURNROM
        Line 1647: pub BACKUP
        Line 1654: pub ?BACKUP    
        Line 1658: pub RESTORE
        Line 1663: pub EDUMP ( addr cnt -- )
        Line 1678: pub (LOAD)
        Line 1683: pub ALOAD ( addr -- )
        Line 1691: pub LOAD ( <name> -- )
        Line 1700: pub ASAVE ( dst -- )
        Line 1710: pub @EFREE ( -- addr )
        Line 1714: pub SAVE ( <name> -- )
        Line 1751: pub HEXLOAD ( dst -- \ Load an Intel Hex file into the dst area )
        Line 1770: pub IDUMP ( src cnt --- )
        Line 1793: pub FIXCKSUM ( src cnt -- )
        Line 1804: pub BINARYDUMP
        Line 1813: pub CONBAUD ( baud -- )    VER 8 + SWAP OVER !  4 ADO I C@ I EE! #10 ms LOOP ;
        Line 1816: pub INTERRUPT ( state index -- )
        Line 1819: pub INTVEC ( addr index -- )
        Line 1822: pub INTMASK ( mask -- )
        Line 1825: pub INH ( on/off -- )    9 COGREG@ #31 MASK ROT IF OR ELSE ANDN THEN 9 COGREG! ;
        Line 1831: pub .RUNTIME 
        Line 1835: pub .VECTORS
        Line 1839: pub END
        Line 1846: pub STATS
        Line 1867: pub INFO
        Line 1884: pub AUTOBAUD
        Line 1901: pub BOOT
        Line 1909: pub FORGET ( <name> -- )
        Line 1928: pub COLD
    
    
    If you like, Peter, I could do some commenting - as far as I understand it - so you can spend your time on new stuff.
    I helps me learn a lot.
  • D.PD.P Posts: 790
    edited 2013-11-20 21:49
    MJB wrote: »
    if pub lines get a good inline doc it is easy to extract a manual from it
    like here with notepad++ find applied to EXTEND.fth
    Maybe some convention on { pub --- comments ---- } cold give some additional documentation lines to help group by topic
    Search "pub" (224 hits in 1 file)
      F:\Tachyon 2013-11-19 V23\EXTEND.FTH (224 hits)
    { pub --------------------------- TEXT & IO words ------------------------------------------------ }
        Line 119: pub <CR>    $0D EMIT ;
        Line 120: pub TAB    9 EMIT ;
        Line 122: pub UPPER
        Line 125: pub ECHO ( on/off -- )        1 flags ROT BIT! ;
        Line 126: pub NOOP ;
        Line 127: pub OK ( on/off -- )        IF 0 ELSE ' NOOP THEN prompt 2+ W! ;
        Line 141: pub (             \ stack comment - store details in extra EEPROM if available 
        Line 157: pub HELP ( addr -- )
    { pub --------------------  Variable & Const declaration ---------------------------------------- 
    Create fixed variables by borrowing from assembler syntax using an origin and specify number of bytes for each variable
    This allows us to work from a fixed area in RAM and the variables end up being defined as constants.
    Usage: 
        $4000 ORG
        2    DS readptr        \ allocates 2 bytes for readptr at $4000
        2    DS writeptr        \ allocates 2 bytes for writeptr at $4002
        #64    DS mybuffer        \ allocates 64 bytes for mybuffer at $4004
    
    or
        TABLE myvars #64 6 * ALLOT    \ allocate long aligned memory for 6 sets of 64 bytes
        myvars ORG                \ work from the start of the table
        #12    DS name
        4    DS offset
        \ etc
    .
    .
    .
    
    
    If you like, Peter, I could do some commenting - as far as I understand it - so you can spend your time on new stuff.
    I helps me learn a lot.

    Well I would really like to see EXTEND.fth highly commented, I'm sure there are others. I will try to help. I agree Peter's efforts are best spent "adjusting" Tachyon.
  • MJBMJB Posts: 1,235
    edited 2013-11-21 05:09
    I just came across <CR> and TAB and was wondering why the <> in one case ...
    after some research I collected some character words vs. character output words

    character words push the character ASCII byte or number on the stack, but character output words send them to EMIT

    number words: 0 1 2 3 4 5 6 7 8 16
    character words: BL = 32 or $20
    character output words:
    CLS = $0C clear screen
    SPACE = BL outputs a $20
    BELL = $07
    TAB = $09

    wouldn't this
    CR = $0D0A = CrLf
    <CR> = $0D
    read more consistently as
    CR = $OD
    CRLF = $0D0A ??
    but never mind, now I know it ...
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-21 08:35
    MJB wrote: »
    I just came across <CR> and TAB and was wondering why the <> in one case ...
    after some research I collected some character words vs. character output words

    character words push the character ASCII byte or number on the stack, but character output words send them to EMIT

    number words: 0 1 2 3 4 5 6 7 8 16
    character words: BL = 32 or $20
    character output words:
    CLS = $0C clear screen
    SPACE = BL outputs a $20
    BELL = $07
    TAB = $09

    wouldn't this
    CR = $0D0A = CrLf
    <CR> = $0D
    read more consistently as
    CR = $OD
    CRLF = $0D0A ??
    but never mind, now I know it ...

    CR is one of those words that remain the same but may do different things on different systems, perhaps it's a CR or a CRLF or just an LF, but CR is synonymous with line endings. I do agree that CRLF and CR would be more sensible though. In other Forths the BELL etc are only constants so you still have to EMIT them but that never made any sense to me as that is all you would want to do with them, just like CR.

    The single digits 0 to 8 are fast single bytecode constants as are 16 and BL (or 32) although the larger constants are a fraction slower due to the accumulate method of creating a fast constant using just one instruction each.



    Now if anyone wants to comment EXTEND.fth then click this link and request edit access for the Google document.
  • MJBMJB Posts: 1,235
    edited 2013-11-22 02:58
    D.P wrote: »
    Well I would really like to see EXTEND.fth highly commented, I'm sure there are others. I will try to help.
    @DP I started commenting, have a look and check my comments for readability and correctness and put in a note where required.
    Everybody I think can add postit notes to the file in google docs.
    thanks MJB
    here the link again.
    https://docs.google.com/document/d/19t8NRAKQOdUNgcCKb6D3jGS3Y41l2IIxCUVjmWXqSCU/edit?usp=sharing

  • D.PD.P Posts: 790
    edited 2013-11-22 16:12
    MJB wrote: »
    @DP I started commenting, have a look and check my comments for readability and correctness and put in a note where required.
    Everybody I think can add postit notes to the file in google docs.
    thanks MJB
    here the link again.
    https://docs.google.com/document/d/19t8NRAKQOdUNgcCKb6D3jGS3Y41l2IIxCUVjmWXqSCU/edit?usp=sharing


    Nice, I'll review your comments.
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-23 17:23
    MJB wrote: »
    @DP I started commenting, have a look and check my comments for readability and correctness and put in a note where required.
    Everybody I think can add postit notes to the file in google docs.
    thanks MJB
    here the link again.
    https://docs.google.com/document/d/19t8NRAKQOdUNgcCKb6D3jGS3Y41l2IIxCUVjmWXqSCU/edit?usp=sharing



    I am having trouble loading EXTEND_131121 ... it loads clean until in the vicinity of line 1679
    1678:  pub .RUNTIME 
    1679:        CR ." Runtime since last reset = " runtime @ $400A .NUM ." ms "
    1680:        ;
    

    It just stops and is repeatable. EXTEND.fth loads fine.


    OH YEAH ... you all may know this already ... the SD pins and card detect code for the BOE work on the Activity Board.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-23 18:56
    I am having trouble loading EXTEND_131121 ... it loads clean until in the vicinity of line 1679
    1678:  pub .RUNTIME 
    1679:        CR ." Runtime since last reset = " runtime @ $400A .NUM ." ms "
    1680:        ;
    

    It just stops and is repeatable. EXTEND.fth loads fine.


    OH YEAH ... you all may know this already ... the SD pins and card detect code for the BOE work on the Activity Board.

    Hi Brian, have you tried using the latest 2.3 kernel? It has a deep hybrid stack plus dedicated SPI support instructions.
    Anyway that EXTEND_131121.fth isn't a current file and was really jsut a case conflict with Dropbox at the time, so I left it there and just renamed it.
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-23 23:01
    Hi Brian, have you tried using the latest 2.3 kernel? It has a deep hybrid stack plus dedicated SPI support instructions.
    Anyway that EXTEND_131121.fth isn't a current file and was really jsut a case conflict with Dropbox at the time, so I left it there and just renamed it.


    Just now using current DRopBox files V2.3 spin (5 days old) and EXTEND.fth (3 hours old) - same thing - chokes to a halt about 3/4's through in vicinity of line 1969.
  • D.PD.P Posts: 790
    edited 2013-11-24 15:22
    Just now using current DRopBox files V2.3 spin (5 days old) and EXTEND.fth (3 hours old) - same thing - chokes to a halt about 3/4's through in vicinity of line 1969.

    Lastest Tachyon V2.3 and Extend.fth does not work on Quickstart. Kernel complies (BST), downloads and runs, EXTEND.fth will not load. I have been compling kernels and extend for a while now, have tried excruciatingly slow download rates and every other "trick" I know, no joy.

    TACHYON
    Propeller .:.:--TACHYON--:.:. Forth V23131116.1400
    ok

    from Extend.fth
    pri EXTEND.fth ." Primary extensions to TACHYON kernel - 131115-0000 " ;

    dp
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-24 15:35
    D.P wrote: »
    Lastest Tachyon V2.3 and Extend.fth does not work on Quickstart. Kernel complies (BST), downloads and runs, EXTEND.fth will not load. I have been compling kernels and extend for a while now, have tried excruciatingly slow download rates and every other "trick" I know, no joy.

    TACHYON
    Propeller .:.:--TACHYON--:.:. Forth V23131116.1400
    ok

    from Extend.fth
    pri EXTEND.fth ." Primary extensions to TACHYON kernel - 131115-0000 " ;

    dp

    I think you got me in the middle of an edit/debug as I had the same problem, it was just a compile-time memory allocation problem, the receive buffer and hub stack was too close to the end of RAM. But it's been fixed in the Google document about 5 hours ago. I've also updated the Dropbox files. How come you are not using the latest EXTEND.fth? It is 131124.

    BTW, the change was to fix a dictionary extension method so that I could easily move the dictionary or part thereof to EEPROM or SD and it would still be accessible although slower but a fair chunk of hub RAM would be freed up.
  • D.PD.P Posts: 790
    edited 2013-11-24 15:41
    I think you got me in the middle of an edit/debug as I had the same problem, it was just a compile-time memory allocation problem, the receive buffer and hub stack was too close to the end of RAM. But it's been fixed in the Google document about 5 hours ago. I've also updated the Dropbox files. How come you are not using the latest EXTEND.fth? It is 131124.

    BTW, the change was to fix a dictionary extension method so that I could easily move the dictionary or part thereof to EEPROM or SD and it would still be accessible although slower but a fair chunk of hub RAM would be freed up.

    That is the EXTEND.fth one that was linked to in the dropbox, thought you might have forgot to update the VER .

    Update:
    Now that's better, I'm sure Brian's issue will be resolved as well. Thanks Peter

    End of source code, 1305 lines processed and 0000 errors found
    Load time = 45,587ms
  • MJBMJB Posts: 1,235
    edited 2013-11-24 15:44
    I stumbled across the Succesive Aproximation Normalization (SAN) Filter
    while commenting Peters EXTEND.fth file ...
    and wondered about the real timings of the different versions of to solve this problem

    so I made some experiments, first in Tachyon then in SPIN.
    see SPIN version here http://forums.parallax.com/showthread.php/149231-DEMO-Succesive-Aproximation-Normalization-(SAN)-Filter?p=1221763&viewfull=1#post1221763

    What is still missing is a straight forward SPIN implementation using the FLOAT library
    which I expect to be really slow.
    Maybe someone can provide the numbers.

    this is the problem we want to solve:

    1) Data = [(Data-RefLOW)/(RefHIGH-RefLOW)]*(2^BitResolution)

    if we rearrange it a little we get rid of the requirement for float immediately

    2) Data = (Data-RefLOW) * (2^BitResolution) / (RefHIGH-RefLOW)

    and then replace the * 2^n with shift left

    3) Data = ((Data-RefLOW) SHL BitResolution) / (RefHIGH-RefLOW)

    I get the following timings: @80MHz
    Beau's filter in PASM 26 us
    Beau's filter in SPIN 579 us ( Peter writes around 1300us in his EXTEND.fth, I don't know how he measured it)
    EQ3 in SPIN 34 us
    from Tachyon
    Beau's filter in TForth 205 us
    EQ2 in a lazy impl. in TF 208 us
    EQ2 fast impl. in TF 28 us
    EQ3 fast TF impl. 24 us faster than the PASM implementation of the SAN-Filter
    -- I assume this speed is the result of Peter's fast kernel divide instruction.
    SPIN FLOAT-LIB ?? the horrible example of NOT to do it ;-)
    PASM impl. of EQ3 ?? would be a great reference - should be faster then all the others ...
    / EXTEND.fth has to be preloaded
     : norm ( data   bits low high -- result )
         \     X4     X3  X2   X1
          4 LOCAL 
          X4 X2 -
          X3 MASK *
          X1 X2 - / 
          4 RELEASE ;
       
    : norm3            ( data   bits low high -- result )
         OVER -       ( data   bits low high-low ) 
         SWAP        ( data   bits high-low low ) 
         4TH SWAP ( data   bits high-low data low )  
         -                 ( data   bits high-low data-low )   
         3RD MASK  
         *  
         SWAP /  
         NIP ;
        
    : norm4            ( data   bits low high -- result )
         OVER -       ( data   bits low high-low ) 
         SWAP        ( data   bits high-low low ) 
         4TH SWAP ( data   bits high-low data low )  
         -                 ( data   bits high-low data-low ) 
         3RD   SHL      
         SWAP /  
         NIP ;    
    
    / tests
    /  NORMALIZE  is Peter's Tachyon  implementation of Beau's SPIN code
     #2834    #12 #204 #8453 NEWCNT NORMALIZE .LAP SPACE .DEC     /    205us 1306 ok
     #2834    #12 #204 #8453 NEWCNT norm .LAP SPACE .DEC                /    208us 1305 ok
     #2834    #12 #204 #8453 NEWCNT norm3 .LAP SPACE .DEC              /      28us 1305 ok
     #2834    #12 #204 #8453 NEWCNT norm4 .LAP SPACE .DEC              /      24us 1305 ok
    
    
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-25 12:59
    D.P wrote: »
    That is the EXTEND.fth one that was linked to in the dropbox, thought you might have forgot to update the VER .

    Update:
    Now that's better, I'm sure Brian's issue will be resolved as well. Thanks Peter

    End of source code, 1305 lines processed and 0000 errors found
    Load time = 45,587ms

    Brian's issue will be resolved -- YES ... AND ... NO. The "come to a screeching halt" .... gone!

    New problem - TACHYON is essentially done and goes to execute "END" .... aaaannnndddd KAPLOOEY it endlessly loops spitting startup headers ad nauseam (see below)

    Repeatable on Activity board, Prop Platform and QUICKSTART
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
     Cold start - no user code - setting defaults
    ----------------------------------------------------------------
    TACHYON
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
     ok
    0000  ok
    0001  ok
    0002  okND.fth    ." Primary extensions to TACHYON kernel - 131124-0000 " ;
    0003  ok
    \
    \
    0004  okT       DUP $0A <> IF $100 OR 2* (EMIT) ELSE DROP THEN ;
    0005  ok
    \
    0006  ok ( --  \ do nothing ) ;
    0007 K ( on/off -- \ enable/disable OK prompts including the autospace )
    0008 F 0 ELSE ' NOOP THEN prompt 2+ W!
    0009  ok
    0010 CHO ( on/off --  \ set the ECHO flag on/off for controlling output )
    0011 1 flags ROT BIT!
    0012  ok
    \
    0013  ok      OFF ECHO OFF OK ' LEMIT uemit W! ;
    0014  ok
    \
    0015  ok      ON ECHO ON OK 0 uemit W! ;
    0016  ok
    [~        \
    0349    ce-miso-mosi-clk -- \ masks are created to COGREGs from pin positions given as 4 byte fields inside
    0360    ce-miso-mosi-clk -- \ masks are created to COGREGs from pin positions given as 4 byte fields inside
       -- cmdWord \ read in a 16 bit command from the tasks variable and return with it and also clear the tasks
    0446    str maxsize --  \ Create a string constant and specify size of string allocation else use 0 = defaul
       n -- \ Writes to the CTRMODE field of the current CTR channel without disturbing the other bits of the co
    1305  ok  t found "    registers "   )  into the dst area )ort )el PWM "object" ))
    \
    1306
    
    00
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
    
      Propeller .:.:--TACHYON--:.:. Forth V23131125.0300
    
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-25 14:03
    The exact same problem as I reported in my last message occurs with the v2.2 kernel
      Propeller .:.:--TACHYON--:.:. Forth V22131115.1400
     Cold start - no user code - setting defaults
    ----------------------------------------------------------------
    TACHYON
      Propeller .:.:--TACHYON--:.:. Forth V22131115.1400
     ok
    0000  ok
    0001  ok
    0002  okND.fth    ." Primary extensions to TACHYON kernel - 131124-0000 " ;
    0003  ok
    \
    
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-25 14:54
    The exact same problem as I reported in my last message occurs with the v2.2 kernel
      Propeller .:.:--TACHYON--:.:. Forth V22131115.1400
     Cold start - no user code - setting defaults
    ----------------------------------------------------------------
    TACHYON
      Propeller .:.:--TACHYON--:.:. Forth V22131115.1400
     ok
    0000  ok
    0001  ok
    0002  okND.fth    ." Primary extensions to TACHYON kernel - 131124-0000 " ;
    0003  ok
    \
    

    There are two ways to access Dropbox files, download through a web browser or access the Dropbox folder directly. Either way may require a refresh but I set my folder view to always show the most recent and V2.2 is not the most recent either. As a side note all the recent .fth Dropbox files were updated to ensure that they were CRLF line terminated files and that the file names were 8.3 short name friendly (capitals only).

    So start with refreshing the folder, setting it show most recent first, and then use the 2.3 kernel, then EXTEND.FTH.
  • D.PD.P Posts: 790
    edited 2013-11-25 15:02
    There are two ways to access Dropbox files, download through a web browser or access the Dropbox folder directly. Either way may require a refresh but I set my folder view to always show the most recent and V2.2 is not the most recent either. As a side note all the recent .fth Dropbox files were updated to ensure that they were CRLF line terminated files and that the file names were 8.3 short name friendly (capitals only).

    So start with refreshing the folder, setting it show most recent first, and then use the 2.3 kernel, then EXTEND.FTH.

    I am now checking internal version numbers of all files I download from dropbox, I have been burned by the box too many times now. No one's fault it's just the web.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-25 16:56
    D.P wrote: »
    I am now checking internal version numbers of all files I download from dropbox, I have been burned by the box too many times now. No one's fault it's just the web.

    I'm having an issue with Dropbox at the moment on a remote computer which I am accessing directly via Splashtop to see what's going on. I've checked all the Dropbox settings but it seems the files are not being updated. Just in case here is a zip of the latest files
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-25 17:50
    I'm having an issue with Dropbox at the moment on a remote computer which I am accessing directly via Splashtop to see what's going on. I've checked all the Dropbox settings but it seems the files are not being updated. Just in case here is a zip of the latest files

    Using files from the above posted ZipArchive.

    V2.3 spin - compiled with pll16x, 5 mHz, 115200 baud

    EXTEND.FTH - copy/pasted unchanged except commented out [~ of subsequent runs

    produces same problem on Activity Board, Prop Platform, and QuickStart - reads/processes whole copy/paste then hits the "END" directive and starts spewing endless repetitions of the kernel ID as was stated in my message #921 and shown at the bottom of the code section in msg 921
  • D.PD.P Posts: 790
    edited 2013-11-25 18:04
    Using files from the above posted ZipArchive.

    V2.3 spin - compiled with pll16x, 5 mHz, 115200 baud

    EXTEND.FTH - copy/pasted unchanged except commented out [~ of subsequent runs

    produces same problem on Activity Board, Prop Platform, and QuickStart - reads/processes whole copy/paste then hits the "END" directive and starts spewing endless repetitions of the kernel ID as was stated in my message #921 and shown at the bottom of the code section in msg 921

    When I get home I'll compile these and post. If they work we gotta figure out what's up on you end Brian, I'll be using a QuickStart board.


    UPDATE: Peter's latest as attached above:

    QuickStart P8X32A 4000 Rev A
    BST 0.19.3 Compiler: 0.15.4.-pre5
    Mac OSX 10.8.5
    minicom 230400 20ms line delay

    Propeller .:.:--TACHYON--:.:. Forth V23131125.0300

    NAMES: $5DA9...72F9 for 5456 (2659 bytes added)
    CODE: $0000...2ECD for 6525 (5645 bytes added)
    CALLS: 0537 vectors free
    RAM: 11996 bytes free

    AUTORUN BOOT
    MODULES LOADED:
    18C0: EXTEND.fth Primary extensions to TACHYON kernel - 131124-0000


    @Brian it is something on your end. How can we help?
  • TrapperBobTrapperBob Posts: 142
    edited 2013-11-26 03:40
    I have also confirmed that the zip archive files are okay. QuikStart 230400 Baud pll16x 5MHz no edits at all just copy/paste

    Propeller .:.:--TACHYON--:.:. Forth V23131125.0300


    NAMES: $5DA9...72F9 for 5456 (2659 bytes added)
    CODE: $0000...2ECD for 6525 (5645 bytes added)
    CALLS: 0537 vectors free
    RAM: 11996 bytes free


    AUTORUN BOOT
    MODULES LOADED:
    18C0: EXTEND.fth Primary extensions to TACHYON kernel - 131124-0000

    Seems to be something on your end Brian. Let us know what we can do to help.



  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-26 16:54
    There have been quite a few improvements to the kernel and extension files but part of this is also an attempt at improving the source code documentation. Many of my driver module source code pages have diagrams and datasheet clippings to help me along as well. MJB has started to tidy up some of the function descriptions that are meant to be included in the target at some point so that you could type HELP .NUM for instance and it will display MJB plans mainly to have this info extracted in hardcopy form, whereas I like to have it at my fingertips.

    I have also tidied up EXTEND.fth and added a contents table as well so this is best viewed as a webpage document so no sign in is required.
  • Brian RileyBrian Riley Posts: 626
    edited 2013-11-26 22:26
    TrapperBob wrote: »
    I have also confirmed that the zip archive files are okay. QuikStart 230400 Baud pll16x 5MHz no edits at all just copy/paste

    Propeller .:.:--TACHYON--:.:. Forth V23131125.0300


    NAMES: $5DA9...72F9 for 5456 (2659 bytes added)
    CODE: $0000...2ECD for 6525 (5645 bytes added)
    CALLS: 0537 vectors free
    RAM: 11996 bytes free


    AUTORUN BOOT
    MODULES LOADED:
    18C0: EXTEND.fth Primary extensions to TACHYON kernel - 131124-0000

    Seems to be something on your end Brian. Let us know what we can do to help.




    I have it working now on QS board ... a lot of effort. still need to check The PAB and PropPlat boards.. and I am still not exactly sure what/why it's working.


    @D.P. what terminal program ware you using on the Mac?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2013-11-26 22:57
    I have it working now on QS board ... a lot of effort. still need to check The PAB and PropPlat boards.. and I am still not exactly sure what/why it's working.


    @D.P. what terminal program ware you using on the Mac?

    Hi Brian, were you able to resolve what was causing the problem?

    BTW, all the current files have been updated in Dropbox.
Sign In or Register to comment.