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 14 — Parallax Forums

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

11112141617109

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-09-24 17:54
    D.P wrote: »
    I tried as many ways, programs etc that I could think of to output $0000 $8000 IDUMP to a binary including hex2bin (mac osx) None of them were recognized as a valid image by BST like your .binary was.

    Here's the best of them:

    hex2bin v1.0.9, Copyright (C) 2012 Jacques Pelletier
    checksum extensions Copyright (C) 2004 Rockwell Automation
    improved P.G. 2007, modified Danny Schneider,2012

    Lowest address = 00000000
    Highest address = 00007FFF
    Pad Byte = FF
    8-bit Checksum = 15
    -rw-r--r-- 1 dp staff 32768 Sep 24 15:33 Tachyon.binary

    The IDUMP on it's own will not work if you want a valid image for a Prop binary. Have a look at BINARYDUMP which fixes up the header and checksum (first 16 bytes of memory) before it dumps from the EEPROM. You don't need to set any parameters for this word as it caclulates what's needed.
  • D.PD.P Posts: 790
    edited 2012-09-24 18:23
    The IDUMP on it's own will not work if you want a valid image for a Prop binary. Have a look at BINARYDUMP which fixes up the header and checksum (first 16 bytes of memory) before it dumps from the EEPROM. You don't need to set any parameters for this word as it caclulates what's needed.

    Works perfect with BST, thanks.
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-24 21:24
    D.P wrote: »
    hex2bin v1.0.9, Copyright (C) 2012 Jacques Pelletier
    checksum extensions Copyright (C) 2004 Rockwell Automation
    improved P.G. 2007, modified Danny Schneider,2012

    How did you get this to compile. I am running 10.8.2 and it couldn't find GCC. I though that got installed along with the XCode package.
  • D.PD.P Posts: 790
    edited 2012-09-25 09:55
    How did you get this to compile. I am running 10.8.2 and it couldn't find GCC. I though that got installed along with the XCode package.

    My system is:
    Darwin dp.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

    GCC is located at:
    dp:Hex2bin-1.0.9 dp$ whereis gcc
    /usr/bin/gcc

    This is all I had to do

    gcc -O2 -Wall -o hex2bin hex2bin.c
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-09-25 10:00
    Brian,

    GCC is part of XCode (sort of) but you still need to go into XCode | Preferences and install "Command Line Tools". Then you can GCC to your heart's content!
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-25 10:13
    FOUND ANOTHER ODDITY

    I was setting up a situation to try out BACKUP and RESTORE. I added my own small file LOOKUP.fth after EXTEND.fth did a BACKUP and a REBOOT and MODULES stopped reporting EXTEND, but it IS there!

    End of source code, 0027 lines processed and 0000 errors found
    Load time = 2,502ms
    
    CODE   @$4B02  - bytes added = 0189 and 13566 bytes free
    NAMES  @$2648  - bytes added = 0151 and 2568 bytes free
    YCALLS @ 0163 entries free
    Runtime since last reset = 306,496ms
     ok
    MODULES
    LOOKUP.fth              120922.1300 - extension to examine LOOKUP/VECTORS
    EXTEND.fth              Primary extensions to TACHYON kernel - 120923.2300
     ok
    BACKUP  ok
    REBOOT
    
      Propeller .:.:--TACHYON--:.:. Forth V20120919.1215
    
    CODE   @$4B02  - bytes used in this load = 0189
    NAMES  @$2648  - bytes used in this load = 0151
    YCALLS @ 0163 entries free
    ----------------------------------------------------------------
    MODULES
    LOOKUP.fth              /
     ok
    MODULES
    LOOKUP.fth              \
     ok
    QWORDS
    LU DEFLT FTH ETH DTH CTH BTH ATH 9TH 8TH 7TH 6TH 5TH 4TH 3RD 2ND 1ST 0TH SPCHAR
    LOOKUP.fth COLD EXTEND exttimers INFO STATS END .RUNTIME BINARYDUMP FIXCKSUM IDUMP cksum CONBAUD
    RESTORE ?BACKUP BACKUP kernel 64K? EVERIFY EFILL EECOPY eebuf ELOAD ESAVEB ESAVE EDUMP ENDRD
    EE@ EE! EERD @EE I2CBUS SI2C@ SI2C! SI2C!? I2C@ I2C! I2C!? I2CSTOP I2CSTART I2CPINS
    EEPROM SDA SCL sda scl % PWM! PWMFREQ RUNPWM PWMCOG pwmfreq pwmtbl pwmchans pwmpins
    RUNTIMERS TIMERTASK ALARM TIMEOUT? TIMEOUT TIMER timercnt timers runtime MUTE HZ KHZ MHZ DAC!
    FRQ BPIN APIN PLLDIV PLL DUTY CTRMODE NCO B A CTR@ CTR! CTR ctr PINS? .PIN SPRS REG$
    .LAP .NUM (SEP) B>L B>W W>L W>B L>W >B >W CON SERIN SEROUT SERBAUD MAP MODULES QWORDS
    @. C~~ C~ W~~ W~ ~~ ~ C-- C++ W-- W++ -- ++ <= => >| |< seconds second MOD
    LONGFILL LBIT! MASKS PININP PINCLR PINSET TYPE SPACES ALIGNL TASKS TASK? ENQ@ ATN! ENQ! ATN@
    ATN? RUN COGINIT @CNT @MISO @MOSI @SCK COGREG@ COGREG! CLKFREQ U@ .INDEX ... Published
    IMMEDIATE ok ]~ [~ LEMIT EXTEND.fth RESET 0EXIT EXIT NOP 3DROP 2DROP DROP ?DUP DUP OVER 3RD
    4TH SWAP ROT NIP 1+ 1- + - * U/MOD UM* NEGATE INVERT AND ANDN OR XOR SHR SHL 2/ 2*
    REV MASK 0= = > C@ W@ @ C+! C! C@++ W+! W! +! ! CMOVE BIT! SET CLR IC! (PUSH4)
    (PUSH3) (PUSH2) (PUSH1) (VAR) FALSE OFF 0 1 2 3 4 5 6 7 8 ON TRUE -1 BL IN@ P@ OUT!
    P! CLOCK OUTSET OUTCLR OUTPUTS INPUTS WAITLOW SHROUT SHRINP LOADMOD RUNMOD SFR@ SPR@
    COG@ COGREG COG! PASM STACKS LSTACK CALL JUMP (XCALL) (YCALL) (WCALL) (ELSE) (IF) (UNTIL)
    (AGAIN) ADO DO LOOP +LOOP FOR NEXT <BEGIN AGAIN> UNTIL> POPMARK >R R> >L L> (EMIT) (REG)
    REG DELTA WAITCNT WAITPEQ WAITPNE CMPSTR I XCALLS REBOOT STOP COGID PAR CNT INA INB
    OUTA OUTB DIRA DIRB CTRA CTRB FRQA FRQB PHSA PHSB VCFG VSCL SPR SPR! [SPIO] [SPIOD]
    [SDRD] [SDWR] [PWM] [PWM!] [PLOT] !SP 2+ 2- SET? / 2DUP MIN MAX 0<> <> 0> 0< < U<
    WITHIN ?EXIT BOUNDS LEAVE J K IX ERASE FILL ms us CNT@ NEWCNT LAPCNT OUT IN INPUT PIN!
    PIN@ KEY? KEY HEX DECIMAL BINARY .S DUMP COGDUMP .STACKS DEBUG EMIT CLS SPACE BELL CR
    SPINNER .HEX .BYTE .WORD .LONG . >DIGIT NUMBER SCRUB GETWORD FINDSTR NFA>CFA EXECUTE V2 VER
    .VER TACHYON @PAD HOLD >CHAR #> <# # #S (STR) .STR STRLEN U. .DEC DISCARD colors pixels
    REG flags base digits delim word autorun keypoll tasks unum uemit ukey names here codes
    errors baudcnt prompt find create lines ALLOT ALLOCATED HERE AUTO! MARK UNMARK >PFA NFA' '
    
    KEYPOLL \ '' ( { } IFNDEF " ." AUTORUN IF ELSE THEN ENDIF BEGIN UNTIL AGAIN WHILE REPEAT
    ; [COMPILE] GRAB LITERAL : pub pri CREATEWORD CREATE CVARIABLE WVARIABLE VARIABLE BYTE
    WORD LONG TABLE CONSTANT C, | || TASK IDLE LOOKUP VECTORS +XCALL +YCALL ITEM ITEM@ ITEMS
    NFA>CFA WORDS =PIXELS STATS FREE COLD
     ok
    
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-25 17:07
    @mindrobots and @DP .. muchas gracias

    1.61 GB of Xcode 4.5 later plus another 115 MB for 'command line tools' and I had hex2bin turned into an executable under Mountain Lion ... did either of you guys get a compiler warning about 'signedness.'

    I could not figure how to make SpinSIDE do a .binary. So I brought up Parallels/WinXP and PropTool 1.3.2, and burned the EEPROM and it ran.
  • D.PD.P Posts: 790
    edited 2012-09-25 17:47
    @mindrobots and @DP .. muchas gracias

    1.61 GB of Xcode 4.5 later plus another 115 MB for 'command line tools' and I had hex2bin turned into an executable under Mountain Lion ... did either of you guys get a compiler warning about 'signedness.'

    I could not figure how to make SpinSIDE do a .binary. So I brought up Parallels/WinXP and PropTool 1.3.2, and burned the EEPROM and it ran.

    Yes I got the gcc warning, that's the beauty of the -Wall arg. Parallels? I highly recommend BST since your on OSX, it handles tachyon source and binarys perfectly so far.
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-25 18:29
    D.P wrote: »
    Yes I got the gcc warning, that's the beauty of the -Wall arg. Parallels? I highly recommend BST since your on OSX, it handles tachyon source and binarys perfectly so far.

    For some reason, I have never been able to fathom, the BST IDE stopped working for me under Lion and Mtn Lion. The BST executables work fine for SpinSIDE (Simple IDE). Parallels is so thoroughly integrated into OSX that its no bother at all.
  • nglordinglordi Posts: 114
    edited 2012-09-26 18:42
    I have found that TACHYON and the Micomega uM-FPU64 64-bit Floating Point Coprocessor work well together. A minimal code for using the FPU64 in a TACHYON environment is shown below. Note that 3 words are included which allow access to a serial lcd connected to the coprocessor serial port. This chip includes support for a 1-Wire bus, servo controller, parallel lcds, GPS input with NMEA sentence parsing, etc..
    
    {  TACHYON V2.0   um-FPU64 Access      Nicholas G. Lordi  9/2012 
    
       See uM-FPU64 Datasheet and Instruction Set for details.  }
    
    
    '' SPI Words  - require loading SDCard.fth 
    
    '' Pin Assignments - scs is not needed, since the FPU cs pin is wired to ground
    #21  MASK CONSTANT .miso
    #22  MASK CONSTANT .sclk
    #23  MASK CONSTANT .mosi
    
    #4   MASK CONSTANT .busy   \ monitor FPU busy signal (lo - busy   hi - not busy)
    
      
    
    : SPI  ( -- ) \  Initialize spi engine (2.8 MHz).
        #8 3 COGREG!
        .miso 2 COGREG!
        .mosi 1 COGREG!
        .sclk  0 COGREG!
        .mosi OUTCLR
        .sclk  OUTCLR   ;
    
    : FPU>B   ( -- b ) \ Leaves 1 byte on stack.  
        SD@ ;
    
    : B>FPU   ( b -- ) \ Sends 1 byte to  FPU64. 
        SD! ; 
    
    : W>FPU  ( w -- ) \ Sends 1 word to FPU64.
        DUP #8 SHR SD! SD!  ;
    
    : L>FPU  ( l -- ) \ Sends 1 long to device.  
        DUP #24 SHR SD! DUP #16 SHR SD! DUP #8 SHR SD! SD! ;
    
    : FPU>W  ( -- w ) \ Leaves 1 word on stack. 
       SD2@  ;
    
    : FPU>L  ( -- l ) \  Leaves 1 long on stack.  
       SD@  #8 SHL SD@ OR  #8 SHL SD@ OR #8 SHL SD@ OR ;
     
    
    
    
    '' Utilities
    
    WVARIABLE REGA   \ stores reg A  number
    WVARIABLE REGX   \ stores reg X  number
    
    : FPU  ( -- b )  \ Initialize SPI engine and resets the fpu chip. Leaves $BC on stack if fpu is in sync.
        SPI  10 0 DO $FF SD! LOOP  $00 SD! 10 ms $F0 SD!  SD@ ;
    
    
    '' Some Useful Subroutines
    
    : SETREGA  ( n1 -- )  \ Assigns register A as register #n1.
        DUP REGA W! $01 SD! SD!  ;
    
    : SETREGX  ( n1 -- )  \ Assigns register X as register #n1.
        DUP REGX W! $02 SD! SD!  ;
    
    : I>FP ( l -- ) \ Stores long in fpu reg A and converts it to floating point.
        $91 SD! L>FPU  $60 SD!  ;
    
    : FP>I ( -- l ) \ Leaves integer form of floating point value in fpu reg A on stack. Value unchanged in reg A.
        $08 SD! #0 SD! $62 SD! $95 SD! 1 ms FPU>L $10 SD! REGA W@ SD!   ;
    
    : SCALEUP  ( n1 -- )  \ Multiplies fp value in reg A by n1.
        $08 SD! #0 SD! I>FP $2D SD! $06 SD!  ;
    
    : SCALEDN  ( n1 -- )   \ Divides fp value in reg A by n1.
        $08 SD! #0 SD! I>FP $2F SD! $06 SD!  ;
    
    : LCD  ( -- ) \ Initializes serial lcd (4x20) attached to the seroil port at 19200 baud.
        $CE SD! $00 SD!  #7 SD!  ;
    
    : >LCD ( b -- )  \ Sends control code b to lcd.
        $CE SD! $01 SD! SD! $0 SD! ;
    
    : FP>LCD  ( n1 -- )  \ Converts value in reg A to a string of length n1 (max 10) to the lcd. 
        $1F SD! #0 SD! $E4 SD! #0 SD! SD! $CE SD! #3 SD! #13 >LCD ;
     
    
    END
    
    

    NickL
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-29 09:34
    I wanted to share some info from Peter via pm:

    "BTW, use the ATN! command rather than the RUN for passing commands to tasks. I noticed that the task that stopped may not have been stopped because you probably said 1 4 RUN rather than 1 4 ATN!. The ATN? looks in another location for the command while the RUN vector really only takes effect when the task is in IDLE.

    pub ATN? \ alias for newer command ATN@
    pub ATN@ ( -- cmd )
    COGID TASK 4 + DUP W@
    0 ROT W! \ Clear the command (ack)
    ;


    ( To talk to tasks in other cogs )
    \ Use this in place of "cmd n RUN"
    pub ATN! ( cmd cog -- )
    TASK 4 + W!
    ;

    Cheers,
    Peter
    "
  • D.PD.P Posts: 790
    edited 2012-09-29 12:17
    I wanted to share some info from Peter via pm:

    "BTW, use the ATN! command rather than the RUN for passing commands to tasks. I noticed that the task that stopped may not have been stopped because you probably said 1 4 RUN rather than 1 4 ATN!. The ATN? looks in another location for the command while the RUN vector really only takes effect when the task is in IDLE.

    pub ATN? \ alias for newer command ATN@
    pub ATN@ ( -- cmd )
    COGID TASK 4 + DUP W@
    0 ROT W! \ Clear the command (ack)
    ;


    ( To talk to tasks in other cogs )
    \ Use this in place of "cmd n RUN"
    pub ATN! ( cmd cog -- )
    TASK 4 + W!
    ;

    Cheers,
    Peter
    "

    While the source for V2 and Extend.fth do have some inline documentation an example of inter-task communications would be fantastic.
  • HumanoidoHumanoido Posts: 5,770
    edited 2012-09-30 01:36
    Is there a version of Tachyon Forth that can qualify as Tiny Forth for the Propeller?
  • Brian RileyBrian Riley Posts: 626
    edited 2012-09-30 16:09
    D.P wrote: »
    While the source for V2 and Extend.fth do have some inline documentation an example of inter-task communications would be fantastic.

    Peter set a good example in Msg #241 of this thread. I copy pasted it to an editor and corrected it for the changes that have occurred over the last few weeks.
    "Okay so I have made an addition to allow other Tachyon cogs to receive a command, a bit like hitting a key. It's really very simple, we just insert ATN? which returns with a non-zero byte command which is inserted by another cog. You can interpret the command anyway you want, just like a key. The command is read from the cog's "tasks" vector which won't cause it to run wild as it will simply clear a byte command in the idle loop without trying to execute it.

    Here's what my BLINKY looks like:
    #13 MASK    CONSTANT .RDY
    : BLINKY    BEGIN .RDY OUTSET 50d ms .RDY OUTCLR 50d ms ATN? UNTIL ;
    ' BLINKY	CONSTANT UBLINKY
    
    UBLINKY 4 RUN
    

    Now when I type:
    1 4 ATN!
    

    Where 1 is a "command" for cog 4 the loop will terminate and I can get control of it once again in the idle loop. This is also a neat way to pass commands to the cog if it is setup to process them like this:
    #13 MASK    CONSTANT .RDY
    : BLINKY    50d BEGIN .RDY OUTSET DUP ms .RDY OUTCLR DUP ms ATN? DUP 1 > IF NIP DUP THEN 1 = UNTIL ;
    ' BLINKY	CONSTANT UBLINKY
    
    UBLINKY 4 RUN
    

    So BLINKY will start off with a fast blink, but now type:
    #200 4 ATN!
    

    will cause it to slow blink. NOTE from BBR ... even with BLINKY reconfigured to set the blink rate sending "1" to ATN? still terminates the loop and hands control back over to the TF VM IDLE loop. "
  • D.PD.P Posts: 790
    edited 2012-09-30 22:29
    Peter set a good example in Msg #241 of this thread. I copy pasted it to an editor and corrected it for the changes that have occurred over the last few weeks.

    #241 Thanks Brian, Tachyon is moving faster than I can keep up with it seems.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-01 01:14
    D.P wrote: »
    #241 Thanks Brian, Tachyon is moving faster than I can keep up with it seems.
    Oh, and I thought it had slowed to a pedestrian pace in recent weeks! :) I've been very busy with hardware and application software with very little time for improving the kernel lately. Big things are happening with Tachyon in the next couple of weeks though (unless other big things happen in the meantime!).
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-10-01 16:26
    So, watching this thread, I started wondering if C could be compiled to Tachyon bytecode.So, I Googled "compile C to stack machine" and the first result was My history with Forth & stack machines which is an absolutely fascinating article. After reading it, I can somewhat wrap my head around Forth, but I also understand that some people can't, so I won't feel bad if I never do, completely.
  • Brian RileyBrian Riley Posts: 626
    edited 2012-10-01 17:05
    So, watching this thread, I started wondering if C could be compiled to Tachyon bytecode.So, I Googled "compile C to stack machine" and the first result was My history with Forth & stack machines which is an absolutely fascinating article. After reading it, I can somewhat wrap my head around Forth, but I also understand that some people can't, so I won't feel bad if I never do, completely.

    Funny you should mention this. I just today added that article to my "Fort Resources" directory http://www.wulfden.org/downloads/Forth_Resources/
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-03 07:35
    Tachyon is just on 3 months old and there is still so much to do yet. I have finally just gotten around to tidying up a couple of things and expanding the vector table to allow for larger programs. In Tachyon all definitions need to have (it's automatic) the absolute address recorded in the vector table (XCALLS) and one of 4 instructions along with an 8-bit index is normally compiled and accesses code via the table. Later on when P2 comes out the vector table can be "widened" to accommodate longer addresses without impacting the compactness of the compiled code.

    The dictionary still needs to be moved out of RAM and the 2K kernel image will be reused for the serial buffers and paging the dictionary from EEPROM/SPI/SD into RAM. I just need to figure out how to convince the Spin tool that I want the dictionary compiled right at the very end.


    The startup screen after which I type INFO then 0 8000 MAP:
    [FONT=courier new] Propeller .:.:--TACHYON--:.:. Forth V20121003.2240
    
    NAMES:  $2066...39A7 for 6465 (2434 bytes added) with 0222 bytes free
    CODE:   $0000...67CE for 20109 (2282 bytes added) with 6194 bytes free
    CALLS:  0434 vectors free
    
    MODULES LOADED: 
    5EE4: LABELLER.fth        P1121 V1.5 121003.1100 
    5735: L6470.fth           L6470 MicroStepper V1.2 121003.1140
    4ED7: SDCARD.fth          SD CARD Toolkit - 120908.0400 
    40C0: EXTEND.fth          Primary extensions to TACHYON kernel - 121003.1130 
    ----------------------------------------------------------------
    [B]INFO [/B]
      Propeller .:.:--TACHYON--:.:. Forth V20121003.2240
    
    Clock frequency = 80,000,000
    MODULES LOADED: 
    5EE4: LABELLER.fth        P1121 Labeller  V1.5 121003.1100 
    5735: L6470.fth           L6470 MicroStepper V1.2 121003.1140
    4ED7: SDCARD.fth          SD CARD Toolkit - 120908.0400 
    40C0: EXTEND.fth          Primary extensions to TACHYON kernel - 121003.1130 
    
    Tasks 
    0000: IDLE                            0000 01 00 00 00 00 00 
    0001: CONSOLE                         0000 00 00 00 00 00 00 
    0003: IDLE                            0000 01 00 00 00 00 00 
    0004: IDLE                            0000 01 00 00 00 00 00 
    0005: IDLE                            0000 01 00 00 00 00 00 
    0006: IDLE                            0000 01 00 00 00 00 00 
    0007: TIMERTASK                       47F8 01 00 00 00 00 00 
    Status 
    NAMES:  $2066...39A7 for 6465 (2434 bytes added) with 0222 bytes free
    CODE:   $0000...67CE for 20109 (2282 bytes added) with 6194 bytes free
    CALLS:  0434 vectors free
    
    I2C BUS SCAN 
    Fast Device at 00A0  B4 C4 04 6E 25 10 00 44 
    
    I/O Port states 
    +----------u----------+
    P00 <-- 1     1 --> P31
    P01 <-- 1     1 <-- P30
    P02 <-- 1     1 --> P29
    P03 <-- 1     * <-- P28
    P04 <-- *     * --> P27
    P05 <-- *     * --> P26
    P06 <-- *     * --> P25
    P07 <-- *     * --> P24
    P08 <-- *     * --> P23
    P09 <-- *     1 --> P22
    P10 <-- *     1 --> P21
    P11 <-- *     1 --> P20
    P12 <-- *     * --> P19
    P13 <-- *     * --> P18
    P14 <-- 1     * --> P17
    P15 <-- *     * --> P16
    +---------------------+
    Special function registers 
    01F0: PAR  = $0000_1600   00_0000_0000_0000_0001_0110_0000_0000
    01F1: CNT  = $634B_198D   10_0011_0100_1011_0001_1001_1000_1101
    01F2: INA  = $E070_400F   10_0000_0111_0000_0100_0000_0000_1111
    01F3: INB  = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01F4: OUTA = $4000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01F5: OUTB = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01F6: DIRA = $5000_0000   01_0000_0000_0000_0000_0000_0000_0000
    01F7: DIRB = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01F8: CTRA = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01F9: CTRB = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FA: FRQA = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FB: FRQB = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FC: PHSA = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FD: PHSB = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FE: VCFG = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000
    01FF: VSCL = $0000_0000   00_0000_0000_0000_0000_0000_0000_0000 ok
    [B]0 8000 MAP [/B]
    0000: 28 .. .. .. .. .. 2C 7C 66 69 65 66 5E 6C 6A 7B 
    0400: 6D 5E 72 76 89 7C 78 6D 7A 6E 74 7A 9C 9C 8E 66 
    0800: 46 .. .. 05 0F 07 31 26 44 64 66 51 48 56 56 8B 
    0C00: 92 78 8B 7A 71 58 63 49 43 5E 5E 53 60 4E 55 52 
    1000: 5F 56 66 6D 6E 64 60 4E 70 77 82 61 73 83 51 54 
    1400: 60 6B 49 63 5B 5C 6F 62 77 74 76 7C 7C 4F 4E 4B 
    1800: 6C 58 3E 53 5D 56 59 5A 52 64 6F 6A 66 73 72 77 
    1C00: 34 .. .. .. .. .. .. .. .. .. .. .. .. .. DF ## 
    2000: ## B6 50 4F 50 50 52 61 61 62 57 58 4B 55 6B 6A 
    2400: 68 61 68 69 71 70 6E 6D 6B 72 68 67 57 65 62 61 
    2800: 60 63 63 60 6D 73 67 65 5C 63 5B 5B 55 5F 5F 5F 
    2C00: 63 5A 59 57 56 54 5A 53 59 51 50 4C 4C 54 3D 35 
    3000: 34 3A 36 3B 40 3E 44 4C 4A 49 4B 54 51 4F 52 53 
    3400: 56 4E 49 53 50 53 51 52 56 59 5A 69 75 72 62 5C 
    3800: 59 61 61 5D 65 59 65 80 13 .. .. .. .. .. .. .. 
    3C00: .. .. .. .. .. .. .. .. 5A 5B 57 67 60 7E 90 73 
    4000: 3C 3F .. 4D 66 50 3A 52 5F 61 69 42 3F 54 58 45 
    4400: 5B 5B 4E 68 69 64 72 6A 4D 66 48 5F 44 5A 56 55 
    4800: 77 6C 4E 71 61 69 74 6E 63 6F 70 68 6F 72 70 81 
    4C00: 59 74 5E 5B 66 61 57 71 5F 5A 05 51 0C .. .. .. 
    5000: .. .. .. .. 0F 11 09 14 64 7B 77 7A 74 70 7B 7F 
    5400: 77 5C 57 5A 52 67 81 8E 72 64 6A 53 4F 3D 3A 4C 
    5800: 90 71 4D 8A 88 3A 20 22 22 48 77 84 99 71 60 63 
    5C00: 66 5E 60 63 66 5F 56 43 8B 64 4F 80 3C 03 40 4F 
    6000: 4C 2C 38 60 6B 83 60 59 55 53 6D 6A 6A 68 3D 3B 
    6400: 51 59 5A 64 63 66 64 61 6B 5E 64 59 52 60 5B 1D 
    6800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    6C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..  ok
    
    [/FONT]
    
  • Brian RileyBrian Riley Posts: 626
    edited 2012-10-06 10:43
    I found a bug in my jmservo8 code that would blow the stack. It has been fixed. Along the way I created a second piece of code titled jmservo2 . Where the original code would flexably handle 1-8 servos this is hard coded for two, though one or two more could be easily added.

    I also created a shared DropBox folder for Tachyon Forth Apps and JMSERVO and NIc Lordi's 64 bit FPU code are the first entries.

    ... enjoy!
  • Brian RileyBrian Riley Posts: 626
    edited 2012-10-07 09:42
    The shared DropBox folder, "Tachyon Forth Apps," has had quite a bit of traffic. I set it up so that any "member" can also invite members. The problem is I only have a very few regular email addresses to use to issue "invitations" for a few of the regular posters and lurkers. So, if you wish to subscribe to the shared folder, send me an email to <brianbr@wulfden.org>. In order to accept the sharing status you need to have a DropBox account. The initial account is free with 2 GB. DropBox has all sorts of ways to earn extra space for no cost. I have almost doubled my free space already. Personally I am quite satisfied.with the DropBox service. I have it running on my iMac, an old MacBook Pro, my iPhone, iPad, a WinXP box and also on my iMac, Parallels passes the Mac DropBox through to a WinXP VM transparently.

    If you are not interested in joining feel free to lurk and browse simply by clicking on the link to that folder in my sig.

    While on the subject of Tachyon Forth Apps. Nick Lordi wrote up a great toolkit for the Micromega uM-FPU64 64-bit Floating Point Coprocessor. The 32 bit version of this is found in abundance, even right here at Parallax, but the 64 bit not so much. Solarbotics out in Western Canada has the chip for $25 plus shipping. The link to it is here

    I created a separate folder for the FPU64 code and added the documentation from Micromega ... enjoy
  • Brian RileyBrian Riley Posts: 626
    edited 2012-10-07 15:47
    Peter et al.
    I was going over Nick's FPU 64 code this afternoon and a thought occurred to me. The FPU64 uses SPI for I/O, thus necessitating loading SDCARD.fth before loading FPU64. So when reading or writing to the FPU64 you are mostly using Forth word whose names derive from "SD" which is only logical if you are familiar with Tachyon history. In my rarely very humble opinion would not it be easier on future apprentices of TF if SPI words were collected together, given SPI derived names and put into their own file? Do it now while it is still a manageable task.

    Does this make any sense? thanks for listening ...
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-10-07 16:44
    I'm a step away from earning my apprenticeship but Brian's suggestion makes sense to me. A layer of SPI words on top of which any device/application specific words for a particular SPI peripheral can be built.
  • nglordinglordi Posts: 114
    edited 2012-10-07 20:17
    I required SDCARD.fth for the FPU64 words since my application included both the FPU64 and an SD card. In a previous post on this thread (#334), I included generic SPI words and applied them to accessing flash memory.

    NickL
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-09 20:38
    I'm in the process of tidying up and optimizing the memory map for Tachyon so I can work with the bulk of the dictionary in EEPROM or SD memory. So the bytecode kernel itself and the images and the vector table (kernel and user) requires 8K. Since accessing the dictionary in EEPROM will be slow I am looking at employing another task to page in sections and scan them but we'll see how that goes. Other than that there is nothing really new yet but these changes will enable more functionality to be incorporated while also freeing up more RAM for user applications. I almost forgot to mention that the HS-SerialRxL driver is now integrated in the Tachyon source.
    Latest binary - bare kernel, 230400 baud, 5MHz

    TACHYON Forth V2.png
    [FONT=courier new]0 8000 MAP 
    0000: 34 34 68 65 7A 7A A7 A6 11 87 6B 68 5C 6A 66 63 
    0400: 6C 7B 6F 5C 6F 6E 8B 82 7E 68 7A 72 73 6F 9D 9A 
    0800: 8F 77 5A .. .. 01 3D 5D 68 57 4B 50 4E 87 91 7B 
    0C00: 8E 77 72 61 57 59 3B 63 5A 5B 55 53 54 4F 62 53 
    1000: 67 64 76 6A 60 4D 68 7B 80 62 71 81 5A 51 63 69 
    1400: 4E 5A 5E 5D 6C 62 6D 75 74 7F 75 4A 0D 0C 20 0F 
    1800: 43 54 5C 41 58 4C 69 4D 5E 54 33 .. .. .. .. .. 
    1C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    2000: ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## 
    2400: ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## 
    2800: ## ## ## ## ## ## ## ## E7 66 5B 60 5B 5C 55 5F 
    2C00: 62 5F 62 5B 58 54 57 54 5C 52 56 52 4D 4E 4C 56 
    3000: 38 35 35 3A 37 3C 42 3D 45 4B 4A 49 4D 51 50 51 
    3400: 53 54 58 49 4D 56 4D 54 55 50 56 59 5A 70 73 74 
    3800: 5B 54 5F 5F 63 5D 62 61 63 5E .. 4D 66 50 3A 52 
    3C00: 5F 61 69 42 3F 54 58 45 5B 5B 4E 68 69 64 72 6A 
    4000: 4D 66 48 5F 44 5A 56 55 77 66 4E 71 61 69 74 6E 
    4400: 63 6F 70 68 6F 6C 6F 7D 5C 6F 5C 5E 66 5B 5B 6B 
    4800: 63 4E 0C 2E .. .. .. .. .. .. .. .. .. .. .. .. 
    4C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    5000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    5400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    5800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    5C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    6000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    6400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    6800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    6C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 
    7C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..  ok
    
    [/FONT]
    
    1024 x 768 - 76K
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-12 23:06
    The memory map has been optimized again and this time the image for the Tachyon VM and HS-Serial are located at the end of hub memory so that they can be used for buffers. The SD card buffers will be moved to overlay the 2K VM image which will also include dictionary buffers.

    To speed up compilation I have added a number preprocessor so that prefixed numbers are processed immediately rather than searching the dictionary first. The dictionary search has also been optimized as well as the dictionary headers with the most common kernel words being searching first for an earlier match. I've been able to reduce my line delay to 12ms even on SDCARD.fth which used to need 60ms or more.

    So the kernel dictionary is searched first unless it's a prefixed number (#$%) and then the extended dictionary is searched while allowing for an alternate search method so that SDCARD.fth can be expanded to buffer the extended dictionary into SD memory and page it in and out rapidly as needed. The SD card routines use the 2K Tachyon image as a buffer area.

    Since bytecode is referenced via the vector table it can be relocated very easily which will allow modules to be moved around or in and out of memory. This also means that kernel bytecode words can also be redefined by changing it's vector to point to the new definition. I will be making more use of these features as I expand Tachyon's functionality.

    Loading EXTEND.fth takes 18.6 seconds (11.7 seconds with 6ms line delay @3M baud)
    End of source code, 0978 lines processed and 0000 errors found
    Load time = 18,607ms

    NAMES: $6488...7446 for 4030 (23176 bytes added) with 23648 bytes free
    CODE: $0000...250B for 5453 (3595 bytes added) with 23285 bytes free
    CALLS: 0688 vectors free

    and loading SDCARD.fth only takes 8 seconds now (6 seconds with 8ms line delay @3M baud)
    End of source code, 0423 lines processed and 0000 errors found
    Load time = 8,094ms

    NAMES: $61AB...7446 for 4763 (20973 bytes added) with 22915 bytes free
    CODE: $0000...2D69 for 6862 (2142 bytes added) with 21143 bytes free
    CALLS: 0609 vectors free


    RMAP
    0000: 47 4F 45 4E 35 47 62 43 4A 45 59 44 66 29 .. ..
    0400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    0800: 09 05 23 0F 2E 59 65 5D 4A 4B 50 7D 92 7C 7F 81
    0C00: 76 5C 61 5E 3B 5B 5B 59 56 5A 52 4E 57 60 63 5E
    1000: 75 6D 68 41 65 7E 79 74 63 7E 68 50 5B 66 5C 56
    1400: 65 54 6C 65 72 77 60 79 79 77 39 .. 4D 62 50 3A
    1800: 52 5F 61 5B 42 42 50 58 45 5B 5B 4E 68 69 66 73
    1C00: 6A 4C 65 48 60 45 58 57 59 76 62 53 71 5C 6E 71
    2000: 70 66 71 6B 6A 6E 73 6E 81 5A 6C 5D 5D 66 5D 5B
    2400: 6B 63 47 15 47 3B 2A 7E 88 36 77 7E 5A 1E 29 27
    2800: 3D 6B 77 72 79 76 76 80 78 72 5A 56 59 59 6A 84
    2C00: 87 6F 67 66 51 34 .. .. .. .. .. .. .. .. .. ..
    3000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    3400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    3800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    3C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    4000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    4400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    4800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    4C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    5000: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    5400: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    5800: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    5C00: .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..
    6000: .. 2A 6C 5D 64 6A 5F 58 68 5F 62 60 62 63 60 6B
    6400: 71 6A 65 5D 5F 5E 5A 55 60 60 5D 63 5B 57 57 56
    6800: 54 5A 53 58 51 4F 50 48 55 3E 3D 4E 42 32 3A 38
    6C00: 35 41 4B 4B 4B 53 48 46 59 5D 58 65 52 53 55 52
    7000: 48 50 55 51 52 52 57 58 5A 63 74 73 64 5B 5C 5B
    7400: 5D 7B 65 71 5A 69 64 65 6A 74 6C 6E 61 70 82 91
    7800: 7C 6C 71 74 6A 72 8E A1 8D 8A 72 0E .. .. 08 54
    7C00: 4F 55 76 6A 6F 85 76 30 92 3E .. .. .. .. .. .. ok
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-13 06:38
    Funny you should mention this. I just today added that article to my "Fort Resources" directory http://www.wulfden.org/downloads/Forth_Resources/

    I really appreciated finding this page. The 'one' item that no one seems to have is a PDF version of Starting Forth by Leo Brodie, and yet it is very worthwhile.

    Since one can't download it, you either have to buy an out of print copy or read it on-line. Fortunately, Forth, Inc. has it in the original format.

    http://www.forth.com/starting-forth/sf1/sf1.html

    I find out that while so much of Forth has been generously shared with the public domain, this one book has become rather protected. If you can find it used, the second edition published 1987 by Prentice Hall is supposed to be the best.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-10-13 07:31
    There's a pdf of the online version of Starting Forth here.
    I have just found an old copy in reasonable condition which I have ordered just for nostalgia (loved that book). I used to have about 3 copies but you know how people are when they say "just want to borrow it for a day or two...bring it right back..." :frown:
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-13 08:54
    There's a pdf of the online version of Starting Forth here.
    I have just found an old copy in reasonable condition which I have ordered just for nostalgia (loved that book). I used to have about 3 copies but you know how people are when they say "just want to borrow it for a day or two...bring it right back..." :frown:

    Thanks, I don't have to pay for wifi in Starbucks to read it on my notebook.

    AbeBooks.com has several copies available of both first and second editions, along with several other Forth classics. Prices range from under $5 to over $100USD.

    Reading Starting Forth really makes moving on to Brodie's other later book Thinking Forth, much easier.
  • Brian RileyBrian Riley Posts: 626
    edited 2012-10-13 11:55
    I really appreciated finding this page. The 'one' item that no one seems to have is a PDF version of Starting Forth by Leo Brodie, and yet it is very worthwhile.

    Since one can't download it, you either have to buy an out of print copy or read it on-line. Fortunately, Forth, Inc. has it in the original format.

    http://www.forth.com/starting-forth/sf1/sf1.html

    I find out that while so much of Forth has been generously shared with the public domain, this one book has become rather protected. If you can find it used, the second edition published 1987 by Prentice Hall is supposed to be the best.

    ... and thanks to Peter's link to an SF in PDF, my Forth Resources Directory now has filled this hole in its catalog.
Sign In or Register to comment.