Shop OBEX P1 Docs P2 Docs Learn Events
Anyone successfully using OBEX Vinculum code — Parallax Forums

Anyone successfully using OBEX Vinculum code

pgbpsupgbpsu Posts: 460
edited 2008-09-01 14:02 in Propeller 1
I've recently downloaded a number of examples of interfacing with a USB flash drive using Vinculum's VDIP1 chip. I'm confident in that my wiring and chip work because I can talk to the drive using Mike Green's spin routines
http://forums.parallax.com/showthread.php?p=620161

However I'm trying to get faster access and tekochip claims a byte take 4.8us.

My question is: Has anyone sucessfully used tekochip's code in the OBEX:

http://forums.parallax.com/showthread.php?p=718404
obex.parallax.com/objects/305/

It's not giving me any results. I'm not sure if I've found a mistake, but I sure don't know what this block is supposed to do:
    if result==">" 'See the prompt?
      prompt:=TRUE 
    elseif prompt and result:=13 'Seen the prompt and now a CR
      return 'We are done
    else
      prompt:=FALSE 'Keep waiting     




seems to me that the elseif line should be:
    elseif prompt and result==13 'Seen the prompt and now a CR




However, making that change doesn't improve things.

Any advice out there for working with the Vinculum hardware or teckochip's code? teckochip, if you are out there can you give me a few pointers? I'm not very interested in reading data from the USB. But I do need to write to the disk at ~200Kbytes/sec. If teckochip's numbers are correct his code should get me there. However, I've read all about BTXs troubles with the VDIP so I'm not yet convinced, especially in light of my current (lack of) success.


Thanks,
Peter

Comments

  • tekochiptekochip Posts: 56
    edited 2008-08-29 13:40
    Yup, looks like a typo to me.

    I don't know about writing, since that requires waiting for EEPROM inside the thumb drive, but you can read at the 4.8uS rate through the Assembly portion of code.· What's important in a fast transfer is that you request ALL of the bytes you need.· Don't request 16 bytes and then 16 bytes and then 16 bytes.· Each request to read takes a great deal of time from the VDIP to fill its buffer, but if you request the whole file VDIP will fill its buffer 256 bytes at a time (about 270uS) which you can extract at 4.8uS/byte.· With all the buffer filling back and forth·the total throughput for large files is 15uS/Byte.

    ·
  • pgbpsupgbpsu Posts: 460
    edited 2008-08-29 14:04
    tekochip-

    Thanks for the reply. I've changed that line and still I don't get anything. I've stepped back to using Mike Green's test code to prove that my device/drive are still working. However, that's no longer working mad.gif

    When I get that going again, I'll return to your code. If I only make adjustments to pin assignments, what should I expect to see on the display? The "Started" display gets scrolled off the screen right away. I seem to be stuck in the EchoUntilPrompt routine. Is there a way to skip that?

    Do you have any feel for write speeds? I'm using this as part of a datalogger and I need 200KBytes/second. Am I barking up the wrong tree?


    Thanks,
    Peter
  • tekochiptekochip Posts: 56
    edited 2008-08-30 12:46
    EchoUntilPrompt is trying to retrieve the splash screen, so if it gets stuck there you're not getting the splash screen from the VDIP.· You can write to the VDIP at that speed and I know that thumb drives can go faster than 1.75MB/s, so you should be OK.· You will find that some drives write faster than others, though.

    ·
  • pgbpsupgbpsu Posts: 460
    edited 2008-08-30 14:15
    Hi tekochip-

    Thanks for responding.

    I went back to Mike Green's code and got things working there. After a bit of fiddling with my hardware, I was able to get your code working hop.gif. It brought up the splash screen and gave me a directory listing. Now I just need to figure out how to use it to write a buffer to a file on the disk.

    I'm getting closer.

    I tried the following but it didn't work.
    VAR
      byte buffer[noparse][[/noparse]512]
    .
    .
    .
    
    WriteFile(@myFile, @buffer, 512)
    
    .
    .
    .
    DAT
      myFile     byte "TESTFILE.JNK", 0
    
    
    




    I'm off for the weekend, but hopefully Tuesday I'll have time to get back to this.

    Maybe I should go with, opening a file, then write N bytes to it, then close it. I guess that's what I'll need anyway because I can't possibly buffer in prop memory all the data I want written to disk. It seems like the Write method is what I'll need. However since it returns right away, I'll need to use WaitUntilReady before moving to the next chunk, right?

    1. Open file
    2. Write
    3. WaitUntilReady
    4. jump to 2 until I've written all I want
    5. Close file

    Is this right?

    Thanks again for the code and for responding to my questions. Am I using the WriteFile command correctly?

    The disk I'm working with should support transfer speeds in excess of what I need (provided the vdip can as well). I moved a +50MB file from my mac to the drive in ~10seconds. That's 5MB/sec which is ~20 faster than I need.

    Thanks,
    pgbpsu
  • tekochiptekochip Posts: 56
    edited 2008-09-01 14:02
    Spin may have trouble running at these speeds, so you may have to·add an Assembly command to the driver that will allow you to transfer all the bytes directly to the thumb drive.
Sign In or Register to comment.