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.
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.
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
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?
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.
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.
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.
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+ =
;
]
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'.
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?
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
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.
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
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.
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.
Comments
Yesterday, I found out Propeller-chip(40pin DIP) is sold from akizuki( Very very famous parts-shop in Japan).
This is sold on RadioShack?
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?
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.
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.
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.
I think its the same in the EEProm files system kernel 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
There should be examples in there but its too early here.
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?
I did copy/paste to TeraTerm.
result is ;
fwrite need numblocks_to_allocate on stack.
There is fwrite inside sdfs.f.fwrite
I changed "fwrite test1" to 1 fwrite test1".
Resultis ;
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.
Sorry, it's my mistake.
Copy/paste is correctlly; "fl" don't need when copy/paste.
File"test1" is loaded by "fload test1" on current 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?
Copy/paste to TeraTerm;
next;
Next;
Loaded test10 by fload test10
Although test10's code is overrided, block-number is not overridede.
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.
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.
I'm learnig SD-file system.
I checked to read block.
Refering sdfs.f about file-header
Updated sd_dump.
( Sorry, please erase 'st?' on line19 in sd_dump_0.2)
Overwrited sd_dump file.
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
Same as StartKernel-1.f Same as DevKernel.f
These correct code are below;
test code;
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.
Updated alittle bit.
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.
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'.
I'm about using 'fl' on SD-card system under investigation.
test.f below;
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.
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?
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
Comments and such would be really helpful.
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
Updated SD_Utility.
Welcome frida.
Did you copy/paste lines between " "?
Yes I copy/pasted from my notepad into TeraTerm, without the " ".
Frida
I tried same. I changed block=1.
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
Thanks for looking at SD with caskaz
Is the word key? intentionally disconnected in version 5.5.
It is in version 4.6.
Frida
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
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.
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
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
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?
You might have to ask on the general or sensors forums. I still haven't gotten to use this yet.