Shop OBEX P1 Docs P2 Docs Learn Events
Propforth v5.5 is available for download - Page 9 — Parallax Forums

Propforth v5.5 is available for download

1679111226

Comments

  • caskazcaskaz Posts: 957
    edited 2013-07-24 16:53
    Hi.

    Yesterday, I found out Propeller-chip(40pin DIP) is sold from akizuki( Very very famous parts-shop in Japan).
    This is sold on RadioShack?
    640 x 480 - 57K
  • caskazcaskaz Posts: 957
    edited 2013-07-24 22:52
    Hi prof_braino.

    Can I make directory for user code inside .partition-sys/ directory?
    Or should I make such a directory inside .partition-usr/ directory?

    And how does I save file(for example test.f) to SD-card?

    What size does using max SD-card?
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-07-25 06:34
    caskaz wrote: »
    Propeller-chip(40pin DIP) is sold from akizuki( Very very famous parts-shop in Japan).
    This is sold on RadioShack?

    That looks like the same packaging I see at Radio Shack. However, Radio Shack does not list the 40 pin DIP on there web site. They might change they stock from order to order.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-07-25 06:58
    caskaz wrote: »
    eroor had gone.
    mountusr
    ls
    65667 .partion-usr/
    
    mountsys
    ls
    390 usrboot.f
    491 .partion-sys/
    130 .sdcardinfo
    133 sdboot.f
    Prop0 Cog6 ok
    
    

    Can I make directory for user code inside .partition-sys/ directory?
    Or should I make such a directory inside .partition-usr/ directory?

    So, you see that Sal made two SD partions by default. The idea is that PARTION-SYS is where any system related stuff goes.

    PARTION-USR is were the user stuff goes.

    A) You can leave PARTION-SYS alone, and put all you stuff in PARTION-USR. This way you won't risk stepping on the system stuff, as your app won't even see it.

    B) you can put you APP in PARTION-SYS, and have you app Read and write to PARTION-USR. This way your end-users can does what ever they do, and not worry about stepping on the application software or the system software.


    Of course, you can do what every you want, even switch between the two partions, or remove one, etc. This is just for organization. Its sometime "better" to put the unchanginf system related stuff in a separate place, and the volitile stuff in a seaparate. place.

    I would use (A) while I develop, and (B) when the development is done and I want to deploy the finished units. You can do this or something different, please let us know it you find a better way. This was just the first guess as what might be convenient.
    And how does I save file(for example test.f) to SD-card?

    I think its the same in the EEProm files system kernel
    fwrite TEST.f       [ notice fwrite instead of FSWRITE]
    < source cocde >
    ...
    
    fsls
    
    fsdrop
    
    One difference is there is no fsclear on the SD. We just keep saving the same file name over and over to make new versions. After 1 million times the SD might start to get full, at which time reformat the SD.

    Another is
    mkdir NewDirectoryName
    

    There should be examples in there but its too early here.
    What size does using max SD-card?

    The kernel uses any (every?) size SD. I think Sal said he had a 16 or 32 gig card that worked fine as expected. He has not been able to fill a 1 Gig card after continuous logging of multiple records per second for weeks on end (in the "write to the SD until it dies" tests). So we only use the smallest, oldest SD until we can find something that would use a big SD. Have something in mind?
  • caskazcaskaz Posts: 957
    edited 2013-07-25 22:51
    Hi prof_braino.

    I did copy/paste to TeraTerm.
    fl
    
    fwrite test1
    
    : test1 d10 0 do i . loop ;
    
    ...
    
    

    result is ;
    fl
    
    Prop0 Cog5 ok
    fwrite test1
    
    CON:Prop0 Cog5 RESET - last status: 3 MAIN STACK UNDERFLOW
    
    Prop0 Cog5 RESET - last status: 3 MAIN STACK UNDERFLOW
    
    Prop0 Cog5 ok
    
    : test1 d10 0 do i . loop ;
    
    Prop0 Cog5 ok
    
    Prop0 Cog5 ok
    
    ...
    
    Prop0 Cog5 ok
    

    fwrite need numblocks_to_allocate on stack.
    There is fwrite inside sdfs.f.fwrite
    \ fwrite filename ( numblocks_to_allocate -- )
    : fwrite parsenw dup if sd_write else 2drop then ;
    

    I changed "fwrite test1" to 1 fwrite test1".
    Resultis ;
    fl
    
    Prop0 Cog5 ok
    
    1 fwrite test1
    
    Prop0 Cog6 ok
    
    CON:Prop0 Cog5 RESET - last status: 117 UNKNOWN ERROR
    
    Prop0 Cog6 ok
    
    

    How does I save file to SD-card?
    And Can I save file under desired directory?

    Although I start to read files SD-file-sytem, I can't understand at all because there is many files.
  • caskazcaskaz Posts: 957
    edited 2013-07-26 04:18
    Hi prof_braino.

    Sorry, it's my mistake.
    Copy/paste is correctlly;
    4 fwrite test1
    : test1 d10 0 do i . loop ;
    ...
    
    "fl" don't need when copy/paste.

    File"test1" is loaded by "fload test1" on current directry.
    ls   <--- after mountusr
    test1
    .usr1/   <--- new directry
    
    If I want to save file inside .usr1/ directry, I must move to .usr1/ directry.

    Can I use path?

    About Block of "4 fwrite test1"
    I think block-number is 1 since test1's size is 60byte.
    How to setup automatically this number?
  • caskazcaskaz Posts: 957
    edited 2013-07-26 05:41
    Hi prof_braino.

    Copy/paste to TeraTerm;
    2 fwrite test10
    : test10 ." 10 " d10 0 do i . loop ;
    ...
    
    ls
    56985  test10
    other file ignore
    

    next;
    1 fwrite test10
    : test11 ." 11 " d10 0 do i . loop ;
    ...
    
    ls
    56985  test10
    other file ignore
    

    Next;
    1 fwrite test12
    : test12 ." 12 " d10 0 do i . loop ;
    ...
    
    ls
    56985  test10  <-- 3block
    56988  test12  <--  maybe 2block
    other file ignore
    

    Loaded test10 by fload test10
    test10
    11 0 1 2 3 4 5 6 7 8 9 Prop0 Cog6 ok
    

    Although test10's code is overrided, block-number is not overridede.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-07-26 08:00
    Thanks for working through this. I haven't gone back to SD for a bit, so its not so fresh in my memory. Its something like this:

    1) initialize the SD card (with the initialization script, this is done once in the life of the card)
    2) select the partition (system or usr)
    3) create a directory, if needed
    4) make the desired directly the current directory
    5) create a file. Allocate the maximum block you will need. Determine this with a experiments and math before the final application. The file size will never change, until you create a new file of the same name with a different size. Old version of files on the SD never go away until the card is reintialized.
    6) The current directory remains the current directoy until changed
    7) the current file remains the current file until changed
    8) to write to a file (a logfile for example), the file must exist and be the current file in the current directory.
    see simple logger for examples.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-07-26 18:52
    A question came in:
    Is there a PropForth Object exchange similar to the Parallax OBEX? I'm not sure if this question should be on the Parallax Forum or not.

    Any question you can ask is worth asking publicly. I won't vouch for the answers.... :)

    The propforth community code contributions are in the forum posts, usually the thread for the current release (this thread)
    http://forums.parallax.com/showthread.php/146693-Propforth-v5.5-is-available-for-download
    but sometimes appear in specific or tangential threads;

    Refined sets of contributed code get posted in the downloads section,
    http://code.google.com/p/propforth/downloads/list
    for example Nick Lordi and caskaz's code set contributions and to a lesser extent mine;

    and eventually complete and tested sets should make it into the extensions directory in the propforth download archive, after they get tested sufficiently. We haven't figured out a way to determine "tested sufficiently" yet. Ideally, they would be added to the test automation suite, and everyone could run the tests to prove that everything works according to requirements and doesn't get broke. Still working on this future tech.

    In some cases Sal decides it better just to finish the implementation if its too hairy or requires kernel mods or its just beyond my ability. Examples would be VGA (for jupiterACE), caskaz's SD (required kernel changes to do it efficiently), servo and PWM (I didn't figure out to use the counters, so Sal just did it himself).

    In other cases (for example Loopy's half duplex serial) the request is different from what Sal imagined anyone would ask for (actually happens all the time), and I was unable to figure out a satisfactory solution. In these cases, something may get done different in the next release.

    So, there are locations to find contributed code, but we cant always guarantee the quality; and there are mechanisms to get internal changes made. The process can be frustratingly slow, and the results a very long time coming.
  • caskazcaskaz Posts: 957
    edited 2013-07-27 05:20
    Hi.

    I'm learnig SD-file system.
    I checked to read block.
    Refering sdfs.f about file-header
    Prop0 Cog6 ok
    
    ls
    390 usrboot.f
    491 .partion-sys/
    130 .sdcardinfo
    133 sdboot.f
    
    Prop0 Cog6 ok
    
    mountusr ls
    65667 .partion-usr/
    Prop0 Cog6 ok
    
    cd .partion-usr/ ls
    65796 .usr1/            <-- Make directory 'mkdir .usr1/'
    Prop0 Cog6 ok
    
    cd .usr1/   ls
    65925 sd_dump           
    Prop0 Cog6 ok
    
    --- Load sd_dump to dictionary ---
    fload sd_dump
     ..
     ..
    Prop0 Cog6 ok
    
    65925 sd_dump
    Block Number:65925        -- Heder for sd_dump --
    0000: 1B 2F 2E 70 61 72 74 69 6F 6E 2D 75 73 72 2F 2E  ./.partion-usr/.
    0010: 75 73 72 31 2F 73 64 5F 64 75 6D 70 20 20 20 20  usr1/sd_dump         <-- full path name
    0020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0030: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0080: 07 73 64 5F 64 75 6D 70 20 20 20 20 20 20 20 20  .sd_dump             <-- file name
    0090: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00A0: 20 20 20 20 20 20 20 20 3B 02 00 00 05 00 00 00          ;.......     <-- A8-AB 571bytes(h23B) Length of file in bytes
    00B0: 20 20 20 20 20 20 20 20 02 00 01 00 04 01 01 00          ........     <-- B8-BB 65538  block number of root directory
    00C0: 20 20 20 20 20 20 20 20 02 00 01 00 00 B0 3B 00          ......;.         BC-BF 65796  block number of parent directory
    00D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                         AC-AF  5 number of blocks allocated to this file(including header block)
    00E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0170: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0180: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0190: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01A0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    
    Prop0 Cog6 ok
    
    65926 sd_dump                  -- file body for sd_dump --
    Block Number:65926
    0000: 0D 0D 5C 20 44 69 73 70 6C 61 79 20 42 6C 6F 63  ..¥ Display Bloc
    0010: 6B 28 35 31 32 62 79 74 65 73 29 20 69 6E 73 69  k(512bytes) insi
    0020: 64 65 20 53 44 2D 63 61 72 64 0D 5C 20 28 20 6E  de SD-card.¥ ( n
    0030: 20 2D 2D 20 29 20 20 6E 3A 62 6C 6F 63 6B 20 6E   -- )  n:block n
    0040: 75 6D 62 65 72 0D 3A 20 73 64 5F 64 75 6D 70 0D  umber.: sd_dump.
    0050: 2E 22 20 42 6C 6F 63 6B 20 4E 75 6D 62 65 72 3A  ." Block Number:
    0060: 22 20 64 75 70 20 2E 20 63 72 0D 68 65 78 0D 5C  " dup . cr.hex.¥
    0070: 20 52 65 61 64 20 31 20 42 6C 6F 63 6B 28 35 31   Read 1 Block(51
    0080: 32 62 79 74 65 73 29 20 66 72 6F 6D 20 53 44 2D  2bytes) from SD-
    0090: 63 61 72 64 0D 73 64 5F 62 6C 6F 63 6B 72 65 61  card.sd_blockrea
    00A0: 64 20 20 0D 20 20 20 20 20 20 20 20 20 20 20 20  d  .
    00B0: 20 0D 74 62 75 66 20 73 64 5F 63 6F 67 62 75 66   .tbuf sd_cogbuf
    00C0: 0D 64 33 32 20 30 20 64 6F 0D 20 20 20 20 20 69  .d32 0 do.     i
    00D0: 20 64 31 36 20 75 2A 20 2E 77 6F 72 64 20 5F 65   d16 u* .word _e
    00E0: 63 73 20 0D 20 20 20 20 20 32 64 75 70 20 20 20  cs .     2dup
    00F0: 20 20 20 20 20 20 20 0D 20 20 20 20 20 5C 20 43         .     ¥ C
    0100: 6F 70 79 20 38 4C 6F 6E 67 28 33 32 62 79 74 65  opy 8Long(32byte
    0110: 73 29 20 66 72 6F 6D 20 43 6F 67 20 6D 65 6D 6F  s) from Cog memo
    0120: 72 79 20 74 6F 20 74 62 75 66 0D 20 20 20 20 20  ry to tbuf.
    0130: 34 20 63 6F 67 3E 6D 65 6D 20 20 20 20 20 0D 09  4 cog>mem     ..
    0140: 74 62 75 66 20 64 31 36 20 62 6F 75 6E 64 73 0D  tbuf d16 bounds.
    0150: 09 64 6F 0D 09 09 69 20 43 40 20 2E 62 79 74 65  .do...i C@ .byte
    0160: 20 73 70 61 63 65 0D 09 6C 6F 6F 70 20 20 20 20   space..loop
    0170: 20 0D 20 20 20 20 20 5C 20 44 69 73 70 6C 61 79   .     ¥ Display
    0180: 20 41 53 43 49 49 0D 09 73 70 61 63 65 20 0D 20   ASCII..space .
    0190: 20 20 20 20 74 62 75 66 20 64 31 36 20 62 6F 75      tbuf d16 bou
    01A0: 6E 64 73 0D 09 64 6F 0D 09 09 69 20 43 40 20 64  nds..do...i C@ d
    01B0: 75 70 20 62 6C 20 68 37 45 20 62 65 74 77 65 65  up bl h7E betwee
    01C0: 6E 20 69 6E 76 65 72 74 20 69 66 20 64 72 6F 70  n invert if drop
    01D0: 20 68 32 45 20 74 68 65 6E 20 65 6D 69 74 0D 09   h2E then emit..
    01E0: 6C 6F 6F 70 0D 20 20 20 20 20 63 72 0D 20 20 20  loop.     cr.
    01F0: 20 20 5C 20 6E 65 78 74 20 43 6F 67 20 6D 65 6D    ¥ next Cog mem
    
    Prop0 Cog6 ok
    
  • caskazcaskaz Posts: 957
    edited 2013-07-28 05:21
    Hi prof_braino.

    Updated sd_dump.
    ( Sorry, please erase 'st?' on line19 in sd_dump_0.2)
    Overwrited sd_dump file.
    ls
    65925 sd_dump
    Prop0 Cog6 ok
    fstat sd_dump
    File Length:                          4  blocks           1,862  bytes
    Num Blocks Allocated:                 5  blocks           2,560  bytes
    Prop0 Cog6 ok
     -- sd_dump filename
    sd_dump sd_dump
    
    ST: 0001_0185 0000_0005
    0000: 1B 2F 2E 70 61 72 74 69 6F 6E 2D 75 73 72 2F 2E  ./.partion-usr/.
    0010: 75 73 72 31 2F 73 64 5F 64 75 6D 70 20 20 20 20  usr1/sd_dump
    0020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0030: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0080: 07 73 64 5F 64 75 6D 70 20 20 20 20 20 20 20 20  .sd_dump
    0090: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00A0: 20 20 20 20 20 20 20 20 46 07 00 00 05 00 00 00          F.......
    00B0: 20 20 20 20 20 20 20 20 02 00 01 00 04 01 01 00          ........
    00C0: 20 20 20 20 20 20 20 20 02 00 01 00 00 B0 3B 00          ......;.
    00D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0170: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0180: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0190: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01A0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    
    Push ESC-key if stopping, space key if continue to display
    0000: 0D 0D 5C 20 44 69 73 70 6C 61 79 20 42 6C 6F 63  ..\ Display Bloc
    0010: 6B 28 35 31 32 62 79 74 65 73 29 20 69 6E 73 69  k(512bytes) insi
    0020: 64 65 20 53 44 2D 63 61 72 64 0D 5C 20 73 64 5F  de SD-card.\ sd_
    0030: 64 75 6D 70 20 66 69 6C 65 6E 61 6D 65 0D 3A 20  dump filename.:
    0040: 73 64 5F 64 75 6D 70 0D 68 65 78 0D 5C 20 47 65  sd_dump.hex.\ Ge
    0050: 74 20 62 6C 6F 63 6B 6E 75 6D 62 65 72 20 66 72  t blocknumber fr
    0060: 6F 6D 20 66 69 6C 65 6E 61 6D 65 20 20 20 0D 5C  om filename   .\
    0070: 20 69 66 20 6E 6F 74 20 66 69 6C 65 6E 61 6D 65   if not filename
    0080: 2C 20 22 20 46 49 4C 45 20 4E 4F 54 20 46 4F 55  , " FILE NOT FOU
    0090: 4E 44 22 0D 5F 73 64 5F 66 73 70 20 64 75 70 20  ND"._sd_fsp dup
    00A0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00C0: 20 5C 20 47 65 74 20 63 73 74 72 20 20 20 20 20   \ Get cstr
    00D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00E0: 20 20 20 20 20 20 0D 69 66 0D 20 20 20 20 20 73        .if.     s
    00F0: 64 5F 66 69 6E 64 20 20 20 20 20 20 20 20 20 20  d_find
    0100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0110: 20 20 20 20 20 20 20 5C 20 47 65 74 20 62 6C 6F         \ Get blo
    0120: 63 6B 20 6E 75 6D 62 65 72 0D 20 20 20 20 20 64  ck number.     d
    0130: 75 70 0D 20 20 20 20 20 5C 20 47 65 74 20 68 65  up.     \ Get he
    0140: 61 64 65 72 28 31 20 42 6C 6F 63 6B 29 20 66 72  ader(1 Block) fr
    0150: 6F 6D 20 53 44 2D 63 61 72 64 20 74 6F 20 73 64  om SD-card to sd
    0160: 5F 63 6F 67 62 75 66 28 43 6F 67 20 6D 65 6D 6F  _cogbuf(Cog memo
    0170: 72 79 29 0D 20 20 20 20 20 73 64 5F 62 6C 6F 63  ry).     sd_bloc
    0180: 6B 72 65 61 64 0D 20 20 20 20 20 5C 20 47 65 74  kread.     \ Get
    0190: 20 6E 75 6D 62 65 72 20 62 6C 6F 63 6B 73 20 61   number blocks a
    01A0: 6C 6C 6F 63 61 74 65 64 20 74 6F 20 74 68 69 73  llocated to this
    01B0: 20 66 69 6C 65 0D 20 20 20 20 20 73 64 5F 63 6F   file.     sd_co
    01C0: 67 62 75 66 20 68 32 42 20 2B 20 43 4F 47 40 20  gbuf h2B + COG@
    01D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01E0: 20 20 20 20 20 20 20 20 20 20 20 20 73 74 3F 0D              st?.
    01F0: 20 20 20 20 20 30 20 64 6F 0D 20 20 20 20 20 20       0 do.
    
    Push ESC-key if stopping, space key if continue to display
    

    I found out strange inside sdfs.f.
    This forth-code return filename's blocknumber.
    But return actually is cstr. <-- Sorry, this return cstr. I did misunderstand. Edited 2013.8.1
    \ _sd_fsp ( -- cstr ) filename, if cstr is 0 no file found
    : _sd_fsp
    	parsenw dup
    	if
    		dup sd_find 0=
    		if
    			drop 0
    		then
    	then
    ;
    

    Same as StartKernel-1.f
    \ i ( -- n1 ) the most current loop counter
    : i
    	2 RS@
    ;
    \
    \
    \ seti ( n1 -- ) set the most current loop counter
    : seti
    	2 RS!
    ;
    
    Same as DevKernel.f
    \ lasti? ( -- t/f ) true if this is the last value of i in this loop, assume an increment of 1
    [ifndef lasti?
    : lasti?
    	1 RS@ h2 RS@ 1+ =
    ;
    ]
    

    These correct code are below;
    : i 1 RS@ ;
    : seti 1 RS! ;
    : lasti? 0 RS@ 1 RS@ 1+ = ;
    

    test code;
    : test  
    20 0 do
         \ final number of loop counter
         0 RS@ .  
         \ current loop counter
         1 RS@ .  cr 
    loop
    ;     
    

    It seems that these(StartKernel-1.f, StartKernel-2.f, DevKernel.f, SD-files including sdfs.f) are NOT real source codes.
    I need real source codes.
  • caskazcaskaz Posts: 957
    edited 2013-07-28 22:33
    Hi prof_braino.
    Updated alittle bit.
    Prop0 Cog6 ok
    ls
    390 usrboot.f
    491 .partion-sys/
    130 .sdcardinfo
    620 sd_dump
    625 sd_dump1
    133 sdboot.f
    Prop0 Cog6 ok
    mountusr ls
    65667 .partion-usr/
    Prop0 Cog6 ok
    cd .partion-usr/ ls
    65796 .usr1/
    Prop0 Cog6 ok
    cd .usr1/ ls
    65925 sd_dump   <--- Can't override sd_dump_0.3 because size is more than 2048bytes
    65930 sd_dump1
    Prop0 Cog6 ok
    
    fload sd_dump1
    Prop0 Cog5 ok
     ..
    
      ..
    Prop0 Cog5 ok
    fstat sd_dump1
    
    File Length:                          5  blocks           2,218  bytes
    Num Blocks Allocated:                 6  blocks           3,072  bytes
    Prop0 Cog6 ok
    sd_dump sd_dump1
    
    Using Block Size:6
    Block number:65930
    0000: 1C 2F 2E 70 61 72 74 69 6F 6E 2D 75 73 72 2F 2E  ./.partion-usr/.
    0010: 75 73 72 31 2F 73 64 5F 64 75 6D 70 31 20 20 20  usr1/sd_dump1
    0020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0030: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0050: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0060: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0080: 08 73 64 5F 64 75 6D 70 31 20 20 20 20 20 20 20  .sd_dump1
    0090: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00A0: 20 20 20 20 20 20 20 20 AA 08 00 00 06 00 00 00          ........
    00B0: 20 20 20 20 20 20 20 20 02 00 01 00 04 01 01 00          ........
    00C0: 20 20 20 20 20 20 20 20 02 00 01 00 00 B0 3B 00          ......;.
    00D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0140: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0150: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0160: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0170: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0180: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0190: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01A0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    01F0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    
    Push ESC-key if stopping, space key if continue to display
    Block number:65931
    0000: 0D 0D 5C 20 44 69 73 70 6C 61 79 20 42 6C 6F 63  ..\ Display Bloc
    0010: 6B 28 35 31 32 62 79 74 65 73 29 20 69 6E 73 69  k(512bytes) insi
    0020: 64 65 20 53 44 2D 63 61 72 64 0D 5C 20 73 64 5F  de SD-card.\ sd_
    0030: 64 75 6D 70 20 66 69 6C 65 6E 61 6D 65 0D 3A 20  dump filename.:
    0040: 73 64 5F 64 75 6D 70 0D 5C 20 47 65 74 20 62 6C  sd_dump.\ Get bl
    0050: 6F 63 6B 6E 75 6D 62 65 72 20 66 72 6F 6D 20 66  ocknumber from f
    0060: 69 6C 65 6E 61 6D 65 20 20 20 0D 5C 20 69 66 20  ilename   .\ if
    0070: 6E 6F 74 20 66 69 6C 65 6E 61 6D 65 2C 20 22 20  not filename, "
    0080: 46 49 4C 45 20 4E 4F 54 20 46 4F 55 4E 44 22 0D  FILE NOT FOUND".
    0090: 5F 73 64 5F 66 73 70 20 64 75 70 20 20 20 20 20  _sd_fsp dup
    00A0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 5C 20 47               \ G
    00C0: 65 74 20 63 73 74 72 20 20 20 20 20 20 20 20 20  et cstr
    00D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    00E0: 20 20 0D 69 66 0D 20 20 20 20 20 73 64 5F 66 69    .if.     sd_fi
    00F0: 6E 64 20 20 20 20 20 20 20 20 20 20 20 20 20 20  nd
    0100: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
    0110: 20 20 20 5C 20 47 65 74 20 62 6C 6F 63 6B 20 6E     \ Get block n
    0120: 75 6D 62 65 72 0D 20 20 20 20 20 64 75 70 0D 20  umber.     dup.
    0130: 20 20 20 20 5C 20 47 65 74 20 68 65 61 64 65 72      \ Get header
    0140: 28 31 20 42 6C 6F 63 6B 29 20 66 72 6F 6D 20 53  (1 Block) from S
    0150: 44 2D 63 61 72 64 20 74 6F 20 73 64 5F 63 6F 67  D-card to sd_cog
    0160: 62 75 66 28 43 6F 67 20 6D 65 6D 6F 72 79 29 0D  buf(Cog memory).
    0170: 20 20 20 20 20 73 64 5F 62 6C 6F 63 6B 72 65 61       sd_blockrea
    0180: 64 0D 20 20 20 20 20 5C 20 47 65 74 20 6E 75 6D  d.     \ Get num
    0190: 62 65 72 20 62 6C 6F 63 6B 73 20 61 6C 6C 6F 63  ber blocks alloc
    01A0: 61 74 65 64 20 74 6F 20 74 68 69 73 20 66 69 6C  ated to this fil
    01B0: 65 0D 20 20 20 20 20 73 64 5F 63 6F 67 62 75 66  e.     sd_cogbuf
    01C0: 20 68 32 42 20 2B 20 43 4F 47 40 20 20 20 20 20   h2B + COG@
    01D0: 20 0D 20 20 20 20 20 64 75 70 20 63 72 20 2E 22   .     dup cr ."
    01E0: 20 55 73 69 6E 67 20 42 6C 6F 63 6B 20 53 69 7A   Using Block Siz
    01F0: 65 3A 22 20 2E 20 63 72 20 20 20 20 20 20 20 20  e:" . cr
    
    Push ESC-key if stopping, space key if continue to display
    

    How to save file to SD-card
    1. Copy/paste from '5 fwrite sd_dump1' to '...'
    2. Use 'Send File' from TeraTerm menu
    There is problem in 2.

    Sending 'sd_dump_0.3' from TeraTerm's Send File when current directory is '.usr1/' directory.
    File 'sd_dump1' is NOT saved.
    File 'sd_dump1' is saved on system directory.
    mountsys
    Prop0 Cog6 ok
    ls
    390 usrboot.f
    491 .partion-sys/
    130 .sdcardinfo
    620 sd_dump1
    133 sdboot.f
    Prop0 Cog6 ok
    

    If using copy/paste, it can save files to disired directory.
    But when using 'Send file', it let files to save system directory.
    I have no idea.

    Of course, I know Not recomendation for using 'Send file' on PropForth.
    But I have no experience such a trouble when using 'Send file'.
  • caskazcaskaz Posts: 957
    edited 2013-07-30 19:44
    Hi.
    I'm about using 'fl' on SD-card system under investigation.
    test.f below;
    fl
    1 fwrite test
    : test d10 0 do i . loop ;
    ...
    
    

    Current-directory is '.partion/'(mountusr side).
    test.f is load to propforth by "Send file" for TeraTerm.
    test.f is saved on mountsys.

    File always is saved on mountsys anywhere current-directory.

    Maybe I think this is caused by speed between 'fl' and SD-card acccess.
    Or 'fl' cause?

    Anyway, 'fl' cannot use on SD-card system.
  • caskazcaskaz Posts: 957
    edited 2013-07-31 19:08
    Hi.
    Uploaded SD_Utility including 'file_dump' and 'blk_dump'.
    I think these often are not used.
    If you want to understand propforth's sd-structure, these code is helpfull to you maybe.
    To do: rename and delete


    It seems someone did download SD_utility.
    Did you try 'file_dump' and 'blk_dump'?
    Did they correctly operate?
  • caskazcaskaz Posts: 957
    edited 2013-08-02 01:33
    Updated SD_Utility.
    Added delete.

    Sorry, there is mistake at 5line in Readme_SD_Utility_0.1.txt.
    1. Copy/Paste from 'd50 fwrite SD_blk_dump' to '...' on desired directory to TeraTerm Window. <-- incorrect
    1. Copy/Paste from 'd50 fwrite SD_Utility' to '...' on desired directory to TeraTerm Window. <-- correct
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-08-02 06:21
    Is anybody following along on caskaz's SD investigation?

    Comments and such would be really helpful.
  • fridafrida Posts: 155
    edited 2013-08-04 04:21
    Hi caskaz
    I have done some try and error with the filesystem,and this is working for me.

    "
    mountusr
    cd .partion-usr/
    cd .usr1/
    cwd

    3 fwrite myfile5
    : st st? ;
    ...

    fstat myfile5
    "
    The lines between " " have I copied into the TeraTerm window after a reset of the Propeller.
    Allways remember the 3 ... at the end and a cariage return, for it to work.

    You can also type it into the TeraTerm, but then you have 3 char delay, and it is difficult to know where you are.

    Frida
  • caskazcaskaz Posts: 957
    edited 2013-08-04 07:04
    Hi.
    Updated SD_Utility.

    Welcome frida.
    Did you copy/paste lines between " "?
  • fridafrida Posts: 155
    edited 2013-08-04 07:27
    caskaz wrote: »

    Did you copy/paste lines between " "?

    Yes I copy/pasted from my notepad into TeraTerm, without the " ".

    Frida
  • caskazcaskaz Posts: 957
    edited 2013-08-04 07:46
    Hi.

    I tried same. I changed block=1.
    Prop0 Cog6 ok
    fstat myfile5
    File Length:              1 blocks 11bytes
    Num Block Allocated: 2blocks  1,024bytes
    
    Prop0 Cog6 ok
    fload myfile5
    Prop0 Cog6 ok
    
    Prop0 Cog6 ok
    st
    ST:
    Prop0 Cog6 ok
    
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-08-04 07:53
    frida wrote: »
    The lines between " " have I copied into the TeraTerm window after a reset of the Propeller.

    Hi frida

    If you click "go advanced" below the reply window you can a button with # on it, this puts CODE tags around code so it display properly
    this is the start code tag  [ C O D E ]
    this is the end code tag  [ / C O D E ]
    

    Thanks for looking at SD with caskaz
  • fridafrida Posts: 155
    edited 2013-08-07 05:01
    Hi there

    Is the word key? intentionally disconnected in version 5.5.
    It is in version 4.6.

    Frida
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-08-07 05:38
    it is
    fkey?
    

    unblocked check for key pressed,

    return flag and character.
    if key pressed, flag =1 and character is 0-255
    if no key pressed, flag=0 and character = 256
    key
    

    blocked check for key pressed,

    wait until key press, and return character.
    if key pressed, character is 0-255
    if no key pressed , pause execution until key press.


    I think it was something like key and key? were too close, so key and fkey? we selected as sufficiently distinct.
  • fridafrida Posts: 155
    edited 2013-08-07 06:35
    Hi, thanks

    That explains why my old code in version 4.6 does not work anymore.
    In version 4.6 is key? and fkey?, and I have used key?

    Frida
  • Martin_HMartin_H Posts: 4,051
    edited 2013-08-10 15:43
    Does Propforth have a see word? I looked in the documentation and used the words command, but I haven't found anything yet. I need it because I was noodling around and got a word to work, did a saveforth, and now I forgot what I did.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-08-10 21:43
    It doesn't have see but there is a very good decompiler in the wiki listings I believe written by Peter of Tachyon fame.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-08-11 07:48
    mindrobots wrote: »
    It doesn't have see but there is a very good decompiler in the wiki listings I believe written by Peter of Tachyon fame.

    Can you post a link to that? I can't seem to find it right now.

    Never mind, I found it is in the download tab.

    http://code.google.com/p/propforth/downloads/detail?name=decomp 2V1.fth
  • Martin_HMartin_H Posts: 4,051
    edited 2013-08-11 11:23
    Great, thanks for help me recover from my sloppiness.
  • caskazcaskaz Posts: 957
    edited 2013-08-18 02:08
    Hi.
    I got HMC5883L-module(3-axis digital compass).
    I read registers.
    RegisterA is 0x48.
    RegisterB is 0x34.
    RegisterA is 0x33.
    So I think I2C-communication is ok.

    But default-value is different.
    ConfigurationA 0x10 default:0xF0
    ConfigurationB 0x20 default:0x20
    Mode 0x03 default:0x81
    DataX MSB 0xFF default:0x00
    DataX LSB 0xA8 default:0x00
    DataZ MSB 0xFE default:0x00
    DataZ LSB 0xC3 default:0x00
    DataY MSB 0x01 default:0x00
    DataY LSB 0x19 default:0x00

    I tried 29133CompassSpinDemo.zip from http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/HMC5883L/List/0/SortField/4/ProductID/779/Default.aspx
    Result is strange.


    This chip is broken?
    691 x 525 - 35K
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-08-18 08:40
    caskaz wrote: »
    I got HMC5883L-module(3-axis digital compass).

    This chip is broken?

    You might have to ask on the general or sensors forums. I still haven't gotten to use this yet.
Sign In or Register to comment.