Shop OBEX P1 Docs P2 Docs Learn Events
Micro SD on uOLED-96-Prop — Parallax Forums

Micro SD on uOLED-96-Prop

CarlosFandangoCarlosFandango Posts: 67
edited 2008-09-21 12:09 in Propeller 1
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

  • RaymanRayman Posts: 14,363
    edited 2008-09-17 13:20
    You might want to check out my driver here:

    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).
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-09-17 13:49
    Rayman, thanks for this - it will save me some effort. I looked in OBEX, must not have used the right keywords.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-17 13:51
    There's also a specialized version of FemtoBasic (uOLEDbasic) in the Object Exchange that has filesystem statements and display statements for the uOLED.
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-09-17 18:04
    I'm still digesting all of this (as I am new to the Propeller chip, but not to embedded devices). I'm not sure at the moment how FemtoBasic relates to development - I'm trying to get the fastest app I can, I see FemtoBasic (and other Basic implementations) have plenty of high level commands that make things a lot easier, but the binaries take up a lot of room and the interpretation process must be slow - unless I'm wrong about that.

    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
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-09-21 09:55
    Further to my earlier posts on this topic, I have now spent some time trying to get fsrw to work on the uOLED-96, but so far without success. I changed the start method in sdspiqasm to

    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
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-09-21 10:45
    OK, true to empirical experience I resolved this almost as soon as I had sent my post! I noted that in Rayman's code the call to mount was

    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
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2008-09-21 11:46
    Richard
    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
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-09-21 12:04
    Ron,

    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
  • Ron SutcliffeRon Sutcliffe Posts: 420
    edited 2008-09-21 12:09
    Ok richard, well you will be on top of it in no time [noparse]:)[/noparse]

    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
Sign In or Register to comment.