uOLED-96-PROP - uSD Card Interface
Greg P
Posts: 58
I just wrote some data to a 2GB uSD card inserted into the socket on the uOLED-96-Prop !!
I then transplanted the uSD card into its USB adapter, plugged it into my PC, and the newly created file with its data was there to read !!
Thanks guys for writing the SD card object !! Wonderful work !!
Note the variable 'di' holds the pin# of a Propeller OUTPUT to the Card DI INPUT
Likewise, the variable 'do' holds the pin# of Propeller INPUT receiving data from the Card DO OUTPUT
'==================
The start() routine within each sdspi*.spin file should be modified to look like this:
basepin := 14 'force basepin to avoid disaster ! cs := basepin++ 'a Propeller Output (P14) to SD Card's CS input ( pin 2 of SD card) clk := basepin++ 'a Propeller Output (P15) to SD Card's SCK input ( pin 5 ) do := basepin++ 'a Propeller Input (P16) to SD Card's DO output ( pin 7 ) di := basepin 'a Propeller Output (P17) to SD Card's DI input ( pin 3 )
I decided to eliminate the 'basepin' argument to the Start() routine entirely.
I didn't want to accidentially map the wrong pins and watch the thing go up in smoke someday !
Other changes:
Add to the OBJ section of your main uOLED-96-Prop Demo code a reference to the Fsrw.spin Object:
'================================================================
OBJ SDFAT : "Fsrw" 'FAT16 SD Card Access
'Within the OBJ section of Fsrw.spin:
'Select just one of these sdspi* objects to handle low-level SPI communication with the SD card:
'=============================================================
OBJ sdspi: "sdspi" ' low-level SD block I/O in spin (slow) 'sdspi: "sdspiasm" ' low-level SD block I/O in simple asm 'sdspi: "sdspifasm" ' low-level SD block I/O in faster asm 'sdspi: "sdspiqasm" ' low-level SD block I/O in fastest asm
Next step .... SD card read/write speed tests !!