After WORD"card_alive?" modify, please execute WORD"card_alive?" without "sd_init.
: card_alive? \ ( -- t/f ) zero if card is alive
_sd_cs_out_l
49 sd_shift_out \ CMD9 get csd
0 4 0 do dup sd_shift_out loop drop
1 sd_shift_out
dummy
0 tmp W!
begin sd_shift_in 0=
dup . <--------------------------------------------- adding
tmp W@ 64 > if drop 1 else tmp dup W@ 1+ swap W! then
until
tmp W@ 64 >
if
_sd_cs_out_h
1
else
dummy
begin sd_shift_in fe = until \ start-byte for data token
10 0 do sd_shift_in drop loop \ data block
begin sd_shift_in ff = until \ drop crc
dummy
_sd_cs_out_h
0
then
;
Cog6 ok
card_alive? .
0 0 0 0 .. 0 1 Cog6 ok <--- 101's "0" , not reply for CMD9
sd_init
SDSC initialize success
got the two files from post #127 and the changes to CARD-ALIVE
after making the change for CARD-ALIVE and loading the three files,
executing 'viewer' gives about eighty 0's then the message 'SDSC initialize success' then it freezes.
after reboot, executing sd_init works, but executing 'viewer' does not display proper data.
after reboot, executing sd_init works, but executing 'collect_info' freezes.
Sorry, caskaz, I can't figure out what you want me to do with this.
Could please:
1) make a zip file of the complete set of code needed to test your function
2) state the order in which the files are to be loaded
3) state the words which are to be executed from the command line, and the proper sequence
4) state the expected result for each word (i.e. 'success message', 'no_message, nothing on stack', 'SD volume info', etc)
You said it works at #124 although there is problem on card_alive.
It don't work at all?
got the two files and the changes to CARD-ALIVE
What is two files?
1) make a zip file of the complete set of code needed to test your function
2) state the order in which the files are to be loaded
3) state the words which are to be executed from the command line, and the proper sequence
4) state the expected result for each word (i.e. 'success message', 'no_message, nothing on stack', 'SD volume info', etc)
1) I always upload to test latest files/zip. sd_viewer works finely on my protoboard.
Your downloaded files/zip may be different on me. If it not work, or my code may not fit on your sd-card
I buy same as your sd-card tomorrow. Please uplaod sd-card's photo that sd_viewer don't work.
Or can you buy same as my using sd-card? My sd-card's photo at #114 inside this thread.
When I download my uploaded files/zip from Parallax forum, they works fine on my protoboard.
I use japanese localized Windows Vista. It's bad or Dell's inspiron1525 and Dell's japanese localized Windows Vista.
I have no idea.
2) 1st load sd_func
2nd load fat
3rd load sd_viewer
3) I 'll report later.
4) I 'll upload later.
I tested 6 sd-card.
All card almost work fine.
It seems that some SD-CARDs have different protocol.
Panasonic's 1G don't send 'deta start token' to request csd/cid.
Kingston's 2G(SDSC) reply to CMD8, althoug SDSC should reject CMD8.
It seems that some SD-CARDs have different protocol.
Panasonic's 1G don't send 'deta start token' to request csd/cid.
Kingston's 2G(SDSC) reply to CMD8, althoug SDSC should reject CMD8.
What is two files = the files from post#127.
Yes, Sal said the issue is likely in part to different protocol
The SD is a little complex, so the code is complex, and I am not very familiar.
I would really like to help with debug and testing, but I am not as smart as others.
One FORTH technique is to break the functions into many small simple functions that can be easily tested and debugged.
Please see recent PM, if you don't mind there are some suggestions.
Yours Writing/Reading issues can have problems on Yours Long wires to SD cards.
You can test place some Tantalum Capacitor ON Power wires as near SD holder as possible.
That can help SD card to have some extra Power that it needs in timw with starting Reading/Writing to it.
Yes, Sal said the issue is likely in part to different protocol
The SD is a little complex, so the code is complex, and I am not very familiar.
I would really like to help with debug and testing, but I am not as smart as others.
One FORTH technique is to break the functions into many small simple functions that can be easily tested and debugged.
Please see recent PM, if you don't mind there are some suggestions.
fl_buf reads keys from the input until there are no more keys, and puts them in the memory above the dictionary. It leaves a small amount of memory free in the dictionary.
a command is then sent to another forth cog (fl_skeys) , which send the data read by fl_buf one key at a time to the forth running on the current cog, releasing the dictionary memory as it sends each keys, and then it reconnect the IO as it was previously.
BTW, this behavior will change slightly in PropForth 4.0 (should be up in a few days)
Also, I now know to always execute sd_init AND collect_info before running viewer.
The issue with the Transcend 2G: it was formatted by WINDOWS XP. I found a digital camera and reformatted it with built in Nikon utility, now it words.
I have 10k pull-up resistors on all four ports, but i do not have any capacitor(s)
Comments
sd_init
and
collect_info
to the begining of the definition for viewer.
Everything works fine
EXCEPT the Transcend 2Gig, which locks after collect_info
Log are attached
Excellent work.
WORD"viewer" of sd_viewer_2.2 is below: I ckecked it download sd_viewer_2.2.txt from this thread.
It is correct.
Your downloaded sd_viewer_2.2.txt is different?
If so, other parts also may change.
I don't understand its reason.
My PC is bad?
Again I upload files using another PC.
When viewer executes, card_alive returns FALSE apparently.
Until AFTER sd_init and collect_info perhaps?
The comments in the file say card_alive returns zero if card is alive, so these would never run for a live card. Is that how its intended?
Anyway, all the issues went away after I forced those to run.
WORD"card_alive" check to read out csd.
It don't initialize already initialized SD-CARD.
When no card or not initialize, WORD"card_alive" return 1 because csd isn't got .
When no card, sd_init return "no card" and exit.
Not initialized SD-CARD should not reply to request csd.
If original not works, I think my code have mistake for your SD-CARD.
After WORD"card_alive?" modify, please execute WORD"card_alive?" without "sd_init.
Cog6 ok
card_alive? .
0 0 0 0 .. 0 1 Cog6 ok <--- 101's "0" , not reply for CMD9
sd_init
SDSC initialize success
Cog6 ok
card_alive? .
-1 0 Cog6 ok
I have question.
I'm going to make loader from SD-CARD.
Loaded one file size is within 1 cluster-size.
I thought it merely replace WORD"fl_buf" to WORD"load_file".
WORD"fl_buf" get datas from fkey and WORD"load_file" get datas from SD-CARD.
Small file(305byte) is ok.This WORD"dictDump" works.
But big file(15kbyte) is NG.
Althogh file get from SD-CARD to fl_in buffer, registration to dectionary is fail.
Althogh free size is 0x32FB, 'out of memory'error occure.
I think I have misunderstanding about registration to dectionary.
Please give me suggestions to fix problem.
after making the change for CARD-ALIVE and loading the three files,
executing 'viewer' gives about eighty 0's then the message 'SDSC initialize success' then it freezes.
after reboot, executing sd_init works, but executing 'viewer' does not display proper data.
after reboot, executing sd_init works, but executing 'collect_info' freezes.
Sorry, caskaz, I can't figure out what you want me to do with this.
Could please:
1) make a zip file of the complete set of code needed to test your function
2) state the order in which the files are to be loaded
3) state the words which are to be executed from the command line, and the proper sequence
4) state the expected result for each word (i.e. 'success message', 'no_message, nothing on stack', 'SD volume info', etc)
You said it works at #124 although there is problem on card_alive.
It don't work at all?
What is two files?
1) I always upload to test latest files/zip. sd_viewer works finely on my protoboard.
Your downloaded files/zip may be different on me. If it not work, or my code may not fit on your sd-card
I buy same as your sd-card tomorrow. Please uplaod sd-card's photo that sd_viewer don't work.
Or can you buy same as my using sd-card? My sd-card's photo at #114 inside this thread.
When I download my uploaded files/zip from Parallax forum, they works fine on my protoboard.
I use japanese localized Windows Vista. It's bad or Dell's inspiron1525 and Dell's japanese localized Windows Vista.
I have no idea.
2) 1st load sd_func
2nd load fat
3rd load sd_viewer
3) I 'll report later.
4) I 'll upload later.
I tested 6 sd-card.
All card almost work fine.
It seems that some SD-CARDs have different protocol.
Panasonic's 1G don't send 'deta start token' to request csd/cid.
Kingston's 2G(SDSC) reply to CMD8, althoug SDSC should reject CMD8.
What is two files = the files from post#127.
Yes, Sal said the issue is likely in part to different protocol
The SD is a little complex, so the code is complex, and I am not very familiar.
I would really like to help with debug and testing, but I am not as smart as others.
One FORTH technique is to break the functions into many small simple functions that can be easily tested and debugged.
Please see recent PM, if you don't mind there are some suggestions.
Yours Writing/Reading issues can have problems on Yours Long wires to SD cards.
You can test place some Tantalum Capacitor ON Power wires as near SD holder as possible.
That can help SD card to have some extra Power that it needs in timw with starting Reading/Writing to it.
Hi prof_braino.
I agree to Sapieha's idea.
Can you do wire shorter?
I atacche my board and SD.
I read WORD"fl".
: fl
fl_buf \ copy source-code to fl_in
if
c" fl_skeys" \ get string's address
tbuf
ccopy \ copy "fl_skeys" to tbuf
tbuf
c" cr "
over
cappend \ append "cr " to tbuf
cogid \ get current cogid
over
cappendnc \ append "cogid bl" to tbuf
c" 0 emitptr W! >con" \ get string's addres
swap
cappend \ append "0 emitptr W! .con" to tbuf <--tbuf's contents "fl_skeys cr cogid bl0 emitptr W! >con"
tbuf
cogxo
then
;
current cog: receiver
current cog + 1:transmitter
Executing "fl_skeys cr cogid bl0 emitptr W! >con" on transmitter.
How dose source-code register to dictionary?
Please teach me understanding hint for registration to dictionary.
a command is then sent to another forth cog (fl_skeys) , which send the data read by fl_buf one key at a time to the forth running on the current cog, releasing the dictionary memory as it sends each keys, and then it reconnect the IO as it was previously.
BTW, this behavior will change slightly in PropForth 4.0 (should be up in a few days)
The long wires were the problem!
Also, I now know to always execute sd_init AND collect_info before running viewer.
The issue with the Transcend 2G: it was formatted by WINDOWS XP. I found a digital camera and reformatted it with built in Nikon utility, now it words.
I have 10k pull-up resistors on all four ports, but i do not have any capacitor(s)
Thanks guys!
I updated to sd_viewer_2.3.
Please teach me if you need more information.