Shop OBEX P1 Docs P2 Docs Learn Events
uOLED 96-PROP uSD mount issue — Parallax Forums

uOLED 96-PROP uSD mount issue

jwurmzjwurmz Posts: 7
edited 2008-10-24 00:03 in Propeller 1
As the title suggests I have an uOLED 96-PROP that seems to work great·-- the display, serial comm., command interpeting all work fine. The 1GB uSD card·was·formatted (and reformatted several times) as a FAT drive and works fine in Windows XP. No matter if I put SPINs, text files, pictures, or anything else on it, PropBASIC reports that the card can't be mounted:

(from Hyperterminal)
uOLED-96-Prop Basic Version 3.008
8860 bytes available
OK
files
Can't mount SD card
OK

I noticed in the·PropBASIC 'definitions' object·code that the lined for the uSD are as follows:
· spiCS······ = 14
· spiClk····· = 15
· spiDO······ = 16
· spiDI······ = 17

...but the schematic in the manual shows DO and DI being reversed (as far as I can tell), so I also recompiled using:
· spiCS······ = 14
· spiClk····· = 15
· spiDO······ = 17
· spiDI······ = 16

...without any luck, of course. Any ideas on what I'm doing wrong?
I'm using the ìUSB-CE5 and it's connected to a self-powered USB hub (5.0v, 2.6A).

Comments

  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-10 06:46
    Don't panic, it does, or will, work. As long as your SD card is OK it will be fine. I haven't used Prop BASIC, as all my coding is done in spin and pasm, but I have used FSRW and sdspiqasm (written by Rokicki) - I suspect that the prop basic routines use this, although I can't be sure. I can confiirm the pin assignments are::

    do := 16
    clk := 15
    di := 17
    cs := 14

    If you do use the (excellent) fsrw instead, then it does have a few (minor) issues and you should read up on these on the forum. For example

    http://forums.parallax.com/forums/default.aspx?f=25&m=294690

    plus others (a new bug was posted recently).

    -CF smile.gif
  • RaymanRayman Posts: 14,364
    edited 2008-10-10 11:18
    I would guess it's the sector size that the card was formatted with....

    I have Rockiki's notes on that at the bottom of this page:
    http://www.rayslogic.com/propeller/Programming/SD_Card/SD_Card.htm


    Also, I have a (contest winning[noparse]:)[/noparse]) driver and Windows interface that you can test the card with here:
    http://www.rayslogic.com/propeller/3rdPartyHardware/uOLED-96-Prop/RS232Driver.htm

    Just note that if you have a newer version of the uOled-96-Prop, it has a 10MHz crystal instead of 8.· So, you need to change the CLKFRQ and PLL settings to 10_000_000 and PLL8X, in that case.
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-10 11:42
    Rayman said...
    Just note that if you have a newer version of the uOled-96-Prop, it has a 10MHz crystal instead of 8. So, you need to change the CLKFRQ and PLL settings to 10_000_000 and PLL8X, in that case.

    Grrr! Didn't know that! I just sorted out all my timing issues with the (several) uOLEDs I have here, all of which have an 8MHz crystal... good job you mentioned this Rayman. I did wonder why 4D used an 8MHz crystal, as it doesn't seem to make that much sense as far as the prop is concerned. It can't run at top speed, if I am correct, since this would make it unstable...?? (This was from Mike Green.)
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-10 15:57
    Here's a copy of the archive from the Object Exchange with two binaries, one for the 8MHz uOLED-96-PROP and the other for the 10MHz uOLED-96-PROP. I'd appreciate it if you'd try the 10MHz version and let me know if it works for you.
  • jwurmzjwurmz Posts: 7
    edited 2008-10-10 17:18
    Thanks everyone for all your help. Looking at the suggestions, I'm willing to bet it's the cluster size; I completely overlooked that so it must be my issue. I'm at work right now, but when I get home I'll be sure to try each suggestion and feedback the results. Stay tuned...
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-10 19:12
    Mike Green said...
    Here's a copy of the archive from the Object Exchange with two binaries, one for the 8MHz uOLED-96-PROP and the other for the 10MHz uOLED-96-PROP. I'd appreciate it if you'd try the 10MHz version and let me know if it works for you.

    To prove that the 10MHz version works on the 8MHz board? Yes, OK, I can do that, but I am entrenched in some nasty bug hunts right now so it won't be immediately...
    jwurmz said...
    Thanks everyone for all your help. Looking at the suggestions, I'm willing to bet it's the cluster size; I completely overlooked that so it must be my issue. I'm at work right now, but when I get home I'll be sure to try each suggestion and feedback the results. Stay tuned...

    Looking forward to hearing of success!

    -CF
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-10 19:30
    No, I know the 8MHz version works on the 8MHz board and I know the 10MHz version will only work on the 10MHz board which I don't have. I just want to verify that the 10MHz version works on the 10MHz board from 4D Systems before I post the modified archive.

    You'd have to have an 8MHz board to be able to run uOLED-96-Prop Basic at all since the serial I/O routines depend on having the right clock frequency.

    Post Edited (Mike Green) : 10/10/2008 7:35:37 PM GMT
  • jwurmzjwurmz Posts: 7
    edited 2008-10-11 18:56
    Still can't mount the card. It's a 1GB Sandisk, 16k clusters. I'll keep tinkering with it.

    @ Mike Green:
    My problem aside, everything works well using your updated version for 10MHz.
  • jwurmzjwurmz Posts: 7
    edited 2008-10-17 21:17
    This is driving me up the wall. Every program I load into the prop works well, aside from uSD access. The uSD card works splendidly on my computer, as well as several other devices. I've confirmed that the filesystem and cluster size·are compatible with each program I try.

    The project I have in mind is a data collection tool (using a barcode scanner) so the capability for storage is critical. I'm tempted to·prototype and test using another dev platform, but something tells me that I'm just missing some mundane setting in defs or something similar. Can anyone else suggest another issue that I might be facing? Please don't let this beat me confused.gif
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-17 21:57
    Try the attached. Compile and load helpjwurmz_top.spin, you should see a 3 second delay and then (hopefully) a list of SD files... I just tried this on my uOLED and it works as described. If it doesn't on yours, then maybe you have a hardware fault...? If it DOES, then disassemble what's in these files and locate the diffs in yours!

    Waiting to hear....

    -CF

    PS please ignore all the extra junk in these files that isn't relevant, it's a part of a project I'm developing here
  • rjo_rjo_ Posts: 1,825
    edited 2008-10-17 22:08
    it might be your initialization...

    are you using this:

    FORMAT E:/fs:fat16/a:32k

    ?
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-17 22:41
    Actually, I just realised from Mike's earlier posts that you may have problems with my example because you are using a 10MHz version of the board. If that's the case you might (will) have to change _xinfreq = 8_000_000 to _xinfreq = 10_000_000. There might possibly be other necessary changes as well, so I'm really sorry if this just makes things worse for you... I can see you're having a real problem already!

    -CF
  • RaymanRayman Posts: 14,364
    edited 2008-10-17 23:13
    Did you already try my driver and Windows interface app to test the SD card (link was posted above)?

    If so, you might look down in the connector and make sure you didn't break any pins somehow...

    Also check that the card is clicking into place like it is supposed to...

    Post Edited (Rayman) : 10/17/2008 11:20:28 PM GMT
  • RaymanRayman Posts: 14,364
    edited 2008-10-17 23:22
    Also, I just noticed that 2 GB micro SD in SDHC format exists. I could be wrong, but I don't thing that SDHC cards will work with Rockiki's driver...
  • lonesocklonesock Posts: 917
    edited 2008-10-17 23:27
    Rayman said...
    Also, I just noticed that 2 GB micro SD in SDHC format exists. I could be wrong, but I don't thing that SDHC cards will work with Rockiki's driver...
    I have a modified version which supports MMC and SD and SDHC. Please see this thread: http://forums.parallax.com/showthread.php?p=746666

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
  • Mark SwannMark Swann Posts: 124
    edited 2008-10-18 17:08
    rjo_ said...
    it might be your initialization...

    are you using this:

    FORMAT E:/fs:fat16/a:32k

    ?
    I tried that on my 2GB Kingston Micro SD and got the following repsonse.

    The type of the file system is FAT. 
    The new file system is FAT16. 
    FORMAT is not available for FAT16 drives
    

    What does it mean?

    Mark
  • rokickirokicki Posts: 1,000
    edited 2008-10-19 02:21
    Just try using

    FORMAT E: /fs:FAT /a:64K

    That should work just fine.

    (Note that this gives you 64K clusters, which is what I recommend; I don't know why
    everyone keeps suggesting smaller cluster sizes.)
  • jwurmzjwurmz Posts: 7
    edited 2008-10-19 05:30
    Yes sir, I did. Aside from uSD access,·everything works well with the interface app (and the app itself is pretty nifty btw). If I·issue any commands not related to the uSD card via·your app,·the OLED 96-PROP·reacts as expected then responds appropriately over serial interface. I tweaked the·code·a little and found that the MountSD routine is returning -20; according to the code in your top object, this corresponds to "Error:· Not a FAT16 volume." However, the card is most definitely FAT16 (according to XP, my ATT8525, and my Garmin Nuvii GPS).·I've tried using·several different·settings for cluster size at the time of format but it didn't make any difference.·I'm using·a brand new 1GB standard capacity (not HC) Sandisk uSD card that works great in all said devices.
    Rayman said...
    Did you already try my driver and Windows interface app to test the SD card (link was posted above)?

    If so, you might look down in the connector and make sure you didn't break any pins somehow...

    Also check that the card is clicking into place like it is supposed to...
    Tried it, same issue [noparse]:([/noparse]
    CarlosFandango said...
    Try the attached. Compile and load helpjwurmz_top.spin, you should see a 3 second delay and then (hopefully) a list of SD files... I just tried this on my uOLED and it works as described. If it doesn't on yours, then maybe you have a hardware fault...? If it DOES, then disassemble what's in these files and locate the diffs in yours!

    Waiting to hear....
    I'd like to say that it's a hardware issue with the device itself, but when I tweaked the code in Rayman's code it feeds back a -20 over the serial link. According to part of the code in his top object this means that the card is not formatted as FAT16. Having said that, my next question·is that if there was a problem with the hardware itself, do you think·it would·still·be capable of returning a -20? I'd think that it wouldn't get far enough to return a specific, predefined·error code (such as -20) if the hardware was bad.

    I'm sort of ashamed·to have to keep bothering everyone about this, as I'm the type of person who·just KNOWS they can fix it given enough time and insight. I think I might just send it back to 4D for testing soon, along with my uSD card...
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-19 09:19
    jwurmz said...
    I'd like to say that it's a hardware issue with the device itself, but when I tweaked the code in Rayman's code it feeds back a -20 over the serial link. According to part of the code in his top object this means that the card is not formatted as FAT16. Having said that, my next question is that if there was a problem with the hardware itself, do you think it would still be capable of returning a -20? I'd think that it wouldn't get far enough to return a specific, predefined error code (such as -20) if the hardware was bad.

    Hmm... it does look like the card is not formatted correctly, as has already been suggested. Others on this forum with more knowledge than I (tom Rokicki for a start) and would know more about the intricacies of the code and what it may return under which circumstances, but let's look at the obvious first I suppose. I would be doing a few basic things by now to see what affected or did not affect this. For example, do you get the same error when the card is not in the socket? If you don't (I haven't reviewed everything you've said above to be honest, you might have done that already) then look again at formatting. I use XP's disc manager to format - go to mycomputer->rightclick->manage->disk management->right click drive->format, I use disc label "FAT16" and set clusters to 32K for a 1G card.

    Hopefully you'll also get other suggestions that I haven't thought of and FIX this! I'm sure we are all keen to find out what the problem **WAS**!

    Incidentally, considering the fragility of the uOLED, the possibility of destruction during development etc., I just purchased several of them. If you had another you could eliminate hardware issues more easily?
  • rokickirokicki Posts: 1,000
    edited 2008-10-19 18:22
    It's almost certainly the format. Did you try the exact formatting command I listed?
  • rjo_rjo_ Posts: 1,825
    edited 2008-10-19 21:29
    Mark,

    Not a clue... I don't actually understand any of this... I just do what I'm told and don't complain too much[noparse]:)[/noparse]

    Hope someone else can help we-two clueless victims[noparse]:)[/noparse]

    Rich
  • Mark SwannMark Swann Posts: 124
    edited 2008-10-19 22:08
    rjo_ said...
    Mark,

    Not a clue... I don't actually understand any of this... I just do what I'm told and don't complain too much[noparse]:)[/noparse]

    Hope someone else can help we-two clueless victims[noparse]:)[/noparse]

    Rich
    I tried Rokicki's suggestion and it worked.
    He gave me a different command line: FORMAT E: /fs:FAT /a:64K

    I guess FAT and FAT16 are the same, in this case.

    Thanks,

    Mark

    ·
  • Mark SwannMark Swann Posts: 124
    edited 2008-10-19 22:16
    CarlosFandango said...
    Try the attached. Compile and load helpjwurmz_top.spin, you should see a 3 second delay and then (hopefully) a list of SD files... I just tried this on my uOLED and it works as described. If it doesn't on yours, then maybe you have a hardware fault...? If it DOES, then disassemble what's in these files and locate the diffs in yours!

    Waiting to hear....

    -CF
    CF,

    I tried·the·code you made for jwurmz. I had to tweak it a little to get it to work for me.

    Here's my version.

    {{
    The top level object for the RGDISP1 project
    }}
    VAR
    
    CON
         '_clkmode = RCFAST
        _clkmode = xtal1 + pll8x
        _xinfreq = 8_000_000
        _STACK = 200
    DAT
    str     byte  "defaulttext1234567",0
    OBJ
      glob    : "Glob_funcs"
      comms   : "SerialMirror"
      fs      : "fsrw"
    PUB Start | done 
    
        ' Start comms in a cog
      comms.start(31,30,0,9600) ' Rx,Tx, Mode, Baud
      glob.wait(1000)
      comms.PrintOut(string("Hello"))
      comms.PrintOut(@str)
      \fs.mount
      comms.PrintOut(string("Mounted"))
      ' List files on card
      fs.opendir
      comms.PrintOut(string("Dir opened"))
      done~
      repeat until \fs.nextfile(@str) == -1  
        comms.PrintOut(@str)
      comms.PrintOut(string("End of list"))
      repeat
    

    Mark
  • jwurmzjwurmz Posts: 7
    edited 2008-10-19 22:40
    Yup. I also tried that command with every other cluster size that·is allowed with FAT16 filesystem. The disk shows up as "FAT16" in every device I've mounted it under. I'm going to find my Win2K disc, set up a dual-boot, and try formatting it under that OS.
    rokicki said...
    It's almost certainly the format. Did you try the exact formatting command I listed?
    Thanks again everyone. I think before I opt to send it back to 4D I'll just end up debugging the hell out of it using one of the many spin objs that have been suggested. It'll be a good way to get more familiar with the Prop in general.
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-20 08:35
    @Mark: OK, cool, if that worked then it's confirmed - I don't think you need var 'done' though, possibly a leftover.

    -CF
  • CarlosFandangoCarlosFandango Posts: 67
    edited 2008-10-20 08:44
    jwurmz said...
    Thanks again everyone. I think before I opt to send it back to 4D I'll just end up debugging the hell out of it using one of the many spin objs that have been suggested. It'll be a good way to get more familiar with the Prop in general.

    Perhaps you could find someone who has a win2k / xp machine and try formatting on there...? And it's a shame we haven't fixed his problem of yours, I felt at the start that it was going to be simple as pie. I know how these things can really slow you down.

    I'm starting to think it would be a good idea to write a windows-based format tool, it seems to me that this whole affair is another stupid m*cros*ft issue (bah! who needs to format in FAT16 anymore, anyway?). No way do I have time for that right now though...
  • jwurmzjwurmz Posts: 7
    edited 2008-10-23 03:09
    Well I'm certain that the card is formatted properly. I've tried formatting it under Windows 98, 2K, XP, and even WM6 (btw PocketMechanic for WM6 is a GREAT utility) with the issue persisting. I think it may be time to send it back for testing. Thank you everyone for your help!
  • rjo_rjo_ Posts: 1,825
    edited 2008-10-24 00:03
    Mark,

    I still don't get it. I had it written down on a cheat sheet... which I kept under my window...

    You are right though. I get the same message on the same machine...in xp.... and

    format E:/fs:fat/a:32K does work for me.

    It took me a while to retrieve my uSD to test.

    It is voodoo to me... maybe I saved the wrong cheat sheet[noparse]:)[/noparse]



    Rich
Sign In or Register to comment.