Micro SD on uOLED-96-Prop
CarlosFandango
Posts: 67
Has anyone by any chance written any code (or modified existing code such as Radical Eye's) to provide a filesystem to the SD card socket on the uOLED-96?
Comments
http://www.rayslogic.com/propeller/3rdPartyHardware/uOLED-96-Prop/RS232Driver.htm
This uses Rockiki's SD routines to read and write files on the card...
(It's also in OBEX).
I only got everything up and running for the first time today, so I'm at ground zero right now. Fortunately there seems to be a highly helpful and generous user base!
- Richard
pub start
'
' 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.
'
do := 17
clk := 15
di := 16
cs := 14
stop
command := "I"
cog := 1 + cognew(@entry, @command)
repeat while command
if param
abort param
return 0
Which basically hard-codes the micro SD pins to those on the uOLED; effectively, no other code is changed apart from the removal of the basepin parameter in this and FSRW's mount method. I also tried implementing the SPIN-only version of sdspi for completeness, but the result is again the same.
After a short (ahem..) interlude caused by a lack of understanding of ABORT - I am still a prop fresher! - I have been able to get some return codes. I am getting an abort code of -20 which equates to 'not a fat16 volume'. Fair enough, it's possible that the format is incorrect I thought, so tried various ways of formatting to resolve but no change. I then tried mounting the filesystem with no card inserted - but the same abort code results.
In order to determine whether things are actually functioning at all, I have loaded Ray's uOLED-96-Prop-RS232 and tried that: indeed, the @D command lists the files on the card as expected. However I have not been able to determine how this works due to its size and obvious complexity...
So it's back to those with more experience than I - has anyone any idea what the problem might be, and how to get FSRW (more or less as written, that is) to work on the uOLED?
-CF
return mount(16,15,17,14) 'spiDO,spiClk,spiDI,spiCS)
which caused me to look at my schematics again.
Basically, the schematic from 4D systems shows the SDI pin as 16 and the SDO pin as 17, which I took to mean [noparse][[/noparse]fsrw DO] = [noparse][[/noparse]card DO] and [noparse][[/noparse]fsrw DI] = [noparse][[/noparse]card DI]. This is not correct; [noparse][[/noparse]fsrw DO] = [noparse][[/noparse]card DI] and [noparse][[/noparse]fsrw DO] = [noparse][[/noparse]card DI], I guess in a similar way to 'tx' is connected to 'rx' in an RS232 link. Simple mistake but one which is bound to cause trouble somewhere...
-CF
Wading through complex code like fsrw or other complex objects can be very frustrating without a good understanding of Spin.
There are some great tutorals in the Sticky Threads which may be worth reviewing before tackling somethings like this.
There are people in here that will write the code for you if you pester long enough. I don't see there is much to be gained from that.· Unless you are doing it just to look good to your peers.
There is much more satisfaction to be had from writing small peices of code and making sure its works the way you expected it to. From these code snippets you build· a small library which you can then use later in bigger projects.
BTW I am not suggesting that you should have a complete understanding of fsrw or other objects in the Obex before you use them,· but you do need to have some coding behind you so that you can understand·how to use these objects.· It won't take you too long, most seem to get their head around Spin so that they can get a few of their own simple code snippets working within a few days.···
Just a thought
regards
Ron
Post Edited (Ron Sutcliffe) : 9/21/2008 11:58:34 PM GMT
Yes I totally agree, and I am very much looking to learn. What I'm trying to do now is easy, compared to what is to come after all. I started by writing a version of 'cmpstr' which functioned as expected and have been building on that. In this specific case I once again resolved my problem by paying proper attention, which as you seem to be suggesting, I need to do more of. Indeed I think that's a correct assessment (but the 4D schematic IS a little misleading, in my defense!).
I'm not a newcomer to writing code (either high level or assembly), and have written in C++, fortran, 6500 code, PIC, Atmel etc. over a span of some 30 years or so. Having said that I've not done any actual embedded stuff for a while, this rustiness coupled with the idiosyncracies of the propeller is tripping me up for the moment.
Richard
cmpstr is exactly the sort of thing that I was referring to.·If I recall that is from Mike's Femento Basic, but·it's been used in much code since then. If you have·a mental block and get stumped with·this sort thing everyone will jump in to help.
Post Edited (Ron Sutcliffe) : 9/21/2008 2:07:23 PM GMT