Troubles with PropC3 and SD-Card
nomad
Posts: 276
hi
in the moment i working on the C3 with gps + sd-card with spin.
on the "programming & customizing the multicore Propeller Microcontroller" Book
in chapter 09 page 319 is a description of a GPS-DataLogger.
look at the attachment: Main_01.spin and sdspi.spin
under propC3 i have troubles with the descriptions of basepin
look under sdspi.spin
code:
pub start(basepin)
'
' Initialize the card! Send a whole bunch of
' clocks (in case the previous program crashed
' in the middle of a read command or something),
' then a reset command, and then wait until the
' card goes idle. If you want to change this
' method to make the pins not be adjacent, all you
' need to do is change these first four lines.
'
cs := basepin++
di := basepin++
clk := basepin++
do := basepin
if i working with simpleIDE and "filetest"
under PropC3
i can compile and run the SD-Card stuff
in the source-code mount.c
look at the attachment: mount.c
is the following source-code-snippets
c-code
#ifdef C3_CARD
static _SD_Params params =
{
AttachmentType: _SDA_SerialDeMUX,
pins:
{
SerialDeMUX:
{
MISO: 10, // The pin attached to the SD card's MISO or DO output
CLK: 11, // The pin attached to the SD card's CLK or SCLK input
MOSI: 9, // The pin attached to the SD card's MOSI or DI input
CLR: 25, // The pin attached to the counter's reset/clear pin
INC: 8, // The pin attached to the counter's clock/count pin
ADDR: 5, // The SD card's demux address (the counter's count)
}
}
};
i will change in spin-code on sdspi.spin the basebin with:
cs := ??? i dont know which pin
di := 9 ' - MOSI
clk := 11 ' - CLK
do := 10 ' - MISO
but what i do is wrong , dont run.....
can somebody help my in my troubles
thanks for help and hints and tricks
excuse my bad english
regards nomad
in the moment i working on the C3 with gps + sd-card with spin.
on the "programming & customizing the multicore Propeller Microcontroller" Book
in chapter 09 page 319 is a description of a GPS-DataLogger.
look at the attachment: Main_01.spin and sdspi.spin
under propC3 i have troubles with the descriptions of basepin
look under sdspi.spin
code:
pub start(basepin)
'
' Initialize the card! Send a whole bunch of
' clocks (in case the previous program crashed
' in the middle of a read command or something),
' then a reset command, and then wait until the
' card goes idle. If you want to change this
' method to make the pins not be adjacent, all you
' need to do is change these first four lines.
'
cs := basepin++
di := basepin++
clk := basepin++
do := basepin
if i working with simpleIDE and "filetest"
under PropC3
i can compile and run the SD-Card stuff
in the source-code mount.c
look at the attachment: mount.c
is the following source-code-snippets
c-code
#ifdef C3_CARD
static _SD_Params params =
{
AttachmentType: _SDA_SerialDeMUX,
pins:
{
SerialDeMUX:
{
MISO: 10, // The pin attached to the SD card's MISO or DO output
CLK: 11, // The pin attached to the SD card's CLK or SCLK input
MOSI: 9, // The pin attached to the SD card's MOSI or DI input
CLR: 25, // The pin attached to the counter's reset/clear pin
INC: 8, // The pin attached to the counter's clock/count pin
ADDR: 5, // The SD card's demux address (the counter's count)
}
}
};
i will change in spin-code on sdspi.spin the basebin with:
cs := ??? i dont know which pin
di := 9 ' - MOSI
clk := 11 ' - CLK
do := 10 ' - MISO
but what i do is wrong , dont run.....
can somebody help my in my troubles
thanks for help and hints and tricks
excuse my bad english
regards nomad
Comments
Hi Mike
I have some problem with SD Card in C3
I want to write data in to SD Card in text
but when I'm not mount SD Card the string "failed to mount" dose not appear
how can i solve this problem
thanks
thanks for your answers :-)
@mike:
thanks for share the code.
today i working with your code and the code of Dave Hein.
zitat: working with "c" or with spin:
last year i working on my quadcopter and buy the C3
then i make some experiments with spin + C3 + sd-card:
on spin : nothing runs , then i see the "filetest" for the SimpleIde
and compile the whole stuff and its running.....
now: i working with the c3 with the LaserRangeFinder, GPS, XBee etc (under spin)
all is OK and running
but not the SD-Card-stuff
@Dave Hein: thanks for your Code
today i make some experiments with the new spin code
and i make posting of the results.
on all thanks for your help
regards nomad
@ mike:
in the meantime i have tested the fsrwFemto / sdspiFemto.spin
now i have some problems:
for this i make a attachment : sdCardmain01.spin
(its a verry chaotic source) but its only for testings.
what i want:
1) read once gps-datas (here dummy datas) this is ok
2) mount sdcard
3) open gps.txt
4) write this datas to sdCard into gps.txt
5) close gps.txt
6) unmout sdcards
in my program at line 220
i write a variable into the sd-card
----
'now output to the file the values we have
if sdrecording == 1
\sdfat.sdstr(latitude_degpart)
----
on the fsrwFemto.spin i dont find a function to write a variable aka "latitude_degpart" to
file
it this possible ???
and i have make a Test with your C3_FemtoBasic.spin on my C3-board and the PropellerTool
its a failure -> object exceeds runtime memory limit by 50 longs ;-)
@DaveHein:
if working with your safe_spi-c3.spin - object i must change my whole program
please look at "what i want"
@ggg558877
- thanks for your posting
- you have the same problem
thanks for your help
regards nomad
I don't know why your program is so large (to run out of memory). I can't tell from the information you've provided. FemtoBasic is larger and has more string constants used, yet has several thousand bytes left for the Basic program.
@mike #7 posting
thanks for your answer and help.
FemtoBasic: it's ok for me, i will dont work with FemtoBasic
it was only a experiments, what happen :-)
@DaveHein #8
thank you for your help and the FSRW2.6
@mike #9
Thanks for the new fsrwFemto.spin
today i working with the new stuff and make later a posting
regards
nomad
now my first results of my experiments.
as attachments:
mike-sdcard.zip
davehein-sdcard.zip
in this zips are my testings included the spin-objects
@mike:
thanks for your help but i have some troubles
when i would compile my spincode -> please look on the zip-file:
following happened
- 1.compile with mike_fsrwFemto + sdspiFemto.spin
- failure access:
-> pub initSDCard(DO, Clk, DI, CS)
return sdspi.initSDCard(DO, Clk, DI, CS)
- should be
-> initSDCard(Sel,Clr,Inc,DI,DO,Clk)
- wrong access to sdspiFemto
- failure to compile....
i think its my fault .....
but in the moment i dont know what i should do ?
@davehein:
thanks for the fsrw26:
-> i have not testing the test.spin
i think its not for the c3-board
-> instead i working with my code
please look at your zip-folder
i running the source (davehein-c3-sdcard.spin, and for the moment its no failure
for the result look at the screenshot: davehein-c3-sdcard-run.jpg
excuse the chaotic source (its only experiments)
i think, i can mount the sdcard ?? is this correct
i must say that i have not the big experience for sd-cards
thanks for all your helps and hints
regards
nomad
In davehein-c3-sdcard.spin remove 'ssc3 : "safe_spi_c3"' and 'ssc3.start_explicit(10,11,9,25)'.
Hi nomad,davehein,Mike
i solve my problem
thanks for your help
@davehein
thanks for your replay
today i make some experiments
@ggg559977
fine "i solve my problem"
please , can your share the solved problem (the source-code)
thanks for all help
regards
nomad
Hi nomad
I used JonnyMac's jm_sd_text_read.spin in before thread
and I can used it to write string into SD card
I will test to write the GPS receive's string into SD card later
thanks for sharing your code
today i make some experiments.
in the meantime i working with davehein_c3_sdcard.spin
in the moment i can do:
- mount sdCard
- openDir
- unmount sdCard
no failure
now i will working on
-read the dirs
- open / close a file
- write and read the file
regards
nomad
thanks for your code...
it's running and i am happy
i think for me my problem is solved
now i working with your code to write gps-datas (first dummys) then real gpsDatas
thanks all for help, hints......
regards
nomad