Shop OBEX P1 Docs P2 Docs Learn Events
Vinculum Speed ? — Parallax Forums

Vinculum Speed ?

BTXBTX Posts: 674
edited 2007-04-13 06:20 in Propeller 1
I'm trying a project, that uses vinculum VDIP1 modul, to read data from a USB disk, I think to use it by Parallel FIFO mode, to get more speed reading the data, the code for the propeller in assembly (of course).
Does anybody knows, how faster, could I read the data from the disk ? Which is the delay from the VDIP to get FATxx work ?
I ask vinculum support, but it is not clear their answer.....cry.gif
Some suggests Mike ?
I'll need about 800Kbyte/seccond data rate.

Thanks in advance.





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.
«13

Comments

  • BTXBTX Posts: 674
    edited 2007-02-14 14:28
    Hi!!
    Some feedback will be apreciated, or another idea of 'how to transfer data to a propeller, from a disk, at 800Kbytes/seccond'.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-02-14 15:38
    BTX,
    Well information seems thin on the ground at the moment - I was looking at these some time ago also but went with Rokicki SD card option instead ... simply because there was not enough info at the time on Vinculum stuff - maybe that has changed now ?

    Not specifically what you requested but the following may be an option for you :

    http://tomas.rokicki.com/fat16work/
  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-14 15:53
    800 KByte/s is at least 6.4MBit/s leaving an average of maybe 150ns/bit. That's only 3 instructions per bit if the transfers are done using SPI, not doable. Using the FIFO mode, the minimum time per byte is 100ns. Vinculum's documentation doesn't say what their transfer rates are, particularly the rate on/off the USB flash drive.

    I suspect you're going to have to test it yourself using a particular USB flash drive since whatever you get will likely not be the same for most other USB drives.
  • rokickirokicki Posts: 1,000
    edited 2007-02-14 16:22
    I believe it is possible to write SD support that will read at 1MB/sec or very very close. Of course, it depends on the
    card being that fast in SPI mode and many are not. With a reasonably fast card, the existing FAT16 work will get you
    past 400KByte/sec. The main trick to speeding it up past that is to do the low-level transfers at 32 bits and use a
    single WRLONG to write that back to hub memory. The inner loop of the SPI read routine is two instructions per bit,
    which is a 10MHz clock and a bulk rate of 1.25MBytes/second; the key is to eliminate all the overhead.

    Multiblock reads may also help.

    On the other hand, the Vinculum chip can use USB host controllers that drive the flash chips much faster, so it
    *should* be quite a bit faster than this. I'm waiting for someone to test it and report their results.
  • Tom BamptonTom Bampton Posts: 29
    edited 2007-02-14 17:25
    Whilst it doesn't help you now, we are planning on doing some testing with the Vinculum in the next few weeks. I'll post the results when we are done.

    Of course, I won't complain if someone beats me to it, since then I won't have to do it [noparse];)[/noparse]

    T.
  • BTXBTX Posts: 674
    edited 2007-02-14 20:38
    Nothing has changed Quattro....

    Like Mike said, i'll try by myself the test's with a USB drive in FIFO mode, it'll take me a bit more of time, because I have to setup first a protoboard for the circuit.

    Rokicki..., until I've some time I would like to try with your code too, not enought time to do all together now. (or if vinculum fails in 800K/sec... ).

    Tom...Same I'll be waiting for your results....this project will take me many months.

    Thanks again to all.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-07 14:45
    BTX,
    Not extremely informative but 'Elektor' mag. had some info this month on Vinculum VDRIVE2 using a VNC1l for usb host interface...

    Have a read anyway

    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • BTXBTX Posts: 674
    edited 2007-03-07 19:39
    Thanks so much Quattro
    I'll read it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • BTXBTX Posts: 674
    edited 2007-03-07 21:08
    I've just read the text, and it could be great for me, if vinculum chip is really cappable of read data files at 12Mbytes/sec.
    Well I suppose that, I could be get that using the FIFO mode, I'm just doing the tests PCB's for the VDIP1 and the propeller involved to 'test' that working cappabilities, I also add a SD socket to that PCB, to test the results with the Rokciki's code.
    I will post that results and some code when I've done it. (I'm doing many projects togheter at this time, so only a bit of time for each one).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • QuattroRS4QuattroRS4 Posts: 916
    edited 2007-03-08 03:04
    Alberto,
    Keep us Posted

    Regards,
    Quattro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Necessity is the mother of invention'
  • BrianCMMBrianCMM Posts: 2
    edited 2007-03-13 14:46
    FYI:

    I have been 'trying' to use the VNC1L-VDAP for weeks now.
    The sample VDIP1 which I have received works fine and has
    V2.08 firmware on it.· I have tried it in both FIFO and UART modes.

    But the VNC1L chips that we ordered and have implemented into our design
    are·not working out so well.· First off the documentation is horrendous, not to
    mention incorrect!!· If using FIFO mode,·you should be·aware that the RD and WR
    pins have been swapped!
    > Pin ACBUS2 is RD#
    > Pin ACBUS3 is WR
    Also note that RD is inverted, while WR is not.
    And be aware that these chips come with no firmware installed (contrary to the documentation)!

    This was discovered after MUCH trial and error and some emails from FTDI support,
    which also sent incorrect info!· Why is there no Erratta sheet on this?

    Further more, I can only get firmware version 2.19 on their website and I can't
    get my implementation to work with that firmware (maybe works 5% of the time).
    95% of the time I get hung while trying to read a file or send an IDD command?
    But DIR commands work fine?· I can't get a hold of firmware V2.08 to see if that
    is the problem.· I have tried both FIFO and UART mode with the same result.

    I will post any new info here as I get it and would appreciate any feedback from
    anyone using this chip.

    Thanks,
    Brian
  • PointDogPointDog Posts: 22
    edited 2007-03-22 04:13
    BrianCMM,
    I am using the vdap firmware in a design I am testing at the moment, I decided on a pic24 for the design, as when I started there was no ICD/ICE for the propeller, but I'm sure the info will help you anyway. I will keep you informed of the progress, as I have been unable to get this device to work either. thanks for the heads up on the RD/WR crossover, that's a major!

    A small note that I missed was the fact that you need a pll filter on the pllfilter pin (yeah, i'm not too bright [noparse]:)[/noparse]) and you need to pull pin 48 (acbus7) to ground via a 47k resistor to select a 12 Mhz crystal clock, if you pull acbus7 to +3.3v the chip will select 48mhz as its clock input frequency.

    Another thing to note (you've obviously worked this out, but for anyone else browsing this thread) you need to re-flash ft232 devices to use them to put firmware in the vinculum.
  • BrianCMMBrianCMM Posts: 2
    edited 2007-03-22 11:47
    I have contacted FTDI customer support again and have received V2.08 firmware. (attached)

    I have flashed this version onto the VNC1L chip in my project and all seems to be working fine now.

    So it would seem that V2.19 has introduced a bug...but then I flashed V2.19 onto the
    sample VDIP board and it also worked fine?· The only difference is that the VDIP was
    configured for UART mode and my project is configured for FIFO mode.

    So I assume there was a bug introduced after V2.08 that affects FIFO mode only.

    If you are using FIFO mode and having problems...use V2.08 firmware.
    If using UART or SPI (untested by me), you should be ok either V2.08 or V2.19 firmware.

    Good luck.
  • BTXBTX Posts: 674
    edited 2007-03-22 11:47
    Hi guys.
    I'll try directly with a VDIP1 modul....the tests are comming soon, I believe that using the VDIP chip, will avoid this kind of sticky issues of the design, than directly with the VNC1L.
    I'll keep posted.
    Thanks for the details. !!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • BTXBTX Posts: 674
    edited 2007-04-01 16:39
    BrianCMM.
    Is there a possibility that you share with me the Pchip FIFO code ?
    I'm trying since two days, and it's impossible.....I can't get read any form VDIP still, TOO BAD !! doccumentation from FTDI.
    Thanks so much.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • BTXBTX Posts: 674
    edited 2007-04-02 00:40
    At the momment, I only get to read the initials messages from the VDIP in FIFO mode, I'm still trying to send commands to it, it allways answer: Bad Command

    When I start the object, I get:

    Ver 02.08VDAPF On-Line:
    Device Detected P2
    No Upgrade
    D:\>

    Like BrianCMM said, the WR and RD# pins are swapped in the datasheet. (Such a error !!!)
    Now I'm trying, and I'm sure of nothing about I read...I'm getting crazy :-(

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • JamesxJamesx Posts: 132
    edited 2007-04-02 03:50
    I tried to get the Vinculum to work. I cracked it open slightly, but eventually gave up due to frustration. Also, the SD work by Rokicki was so elegant (and it worked too!) that I moved on.

    Jim C
  • BTXBTX Posts: 674
    edited 2007-04-02 04:02
    Thanks so much... Jim.
    The point, is that I need about 700-800 Kbytes/sec, I'd a hope in the Vinculum, that it gets more than those values, but it seems that noboby get it work fine yet.
    Except BriamCMM, he talk in this thread about get it work fine in FIFO mode...so I would like that he share his code, at least to see if really is faster.

    I need to send an AVI (non compresed and "adapted") file, to some electronics to get the final 30fps (not easy), I never tried with ethernet, so I've no time to deal now with such a difficult task, (It's hard than a simple VDIP).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Tom BamptonTom Bampton Posts: 29
    edited 2007-04-02 08:38
    Well, that would at least partly explain why I couldn't get the VDIP1 working in FIFO mode a few weeks back [noparse]:)[/noparse] Higher priority stuff got in the way so it is currently on the shelf, but I intend to revisit it at some point soonish.

    BTX,

    As you are actually getting a response from your VDIP1, you are clearly close to getting the thing to work. Why don't you post your code and see if anyone can help you fix it?

    On the other hand, if you are getting a Bad Command response back when you send it a command, clearly you are also at least writing something to it. Have you have checked that you are using it in the right mode ? For example, are you sending commands in ASCII when it wants them in hex ?

    T.
  • BTXBTX Posts: 674
    edited 2007-04-02 12:58
    Hi Tom.
    I too really thought that I was close to get it work, but after two days of trying, really now I'm getting frustrated, yesterday Sunday, I get the VDIP response, but only that in all day of work again.....
    The code is in spin I 'll post it.......but it's only pieces of code 'not nice' .
    Now, that you talk about ASCII or HEX commands.......I'm asking myself....How to send the data in both ways ????? Which is the difference ???? VERY GOOD POINT THAT !

    I'll post the entire and final code, when I get it work fine too (hope ......)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • BTXBTX Posts: 674
    edited 2007-04-02 16:53
    Hi friends !!

    I just get to send commands to the VDIP succesufully !!!!!!!!!!!!!!!!!!!!! in FIFO mode.

    Again more, there is some miserunderstanding or bad data in the firmware datasheet.

    I will post some code early, of what, I'm doing. I PROMESS.

    Thanks all for your support.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-04-02 17:24
    Great news!

    Graham
  • BTXBTX Posts: 674
    edited 2007-04-02 19:02
    Thanks Graham !!

    I'm testing now, the read speed in FIFO mode working in spin, .....I think I'll have it early !

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • BTXBTX Posts: 674
    edited 2007-04-02 21:10
    Hi all.
    Here's the code in spin, to read data from the VDIP in FIFO mode.


    Note:
    IT IS NOT the final code !, be carrefully, it is very simple, and the programming technics are poor, but WORKS fine. You probably need, to to it all better, just for the method that I used to read the VDIP responses, perhaps it wont work with another pen drive than mine.
    But....this is the way to get the VDIP work in this FIFO mode.


    Good Luck.

    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Tom BamptonTom Bampton Posts: 29
    edited 2007-04-03 00:47
    Awesome! I am glad you got it working [noparse]:)[/noparse]

    I have been intending to get back to the VDIP1 next week so I will definately be looking at this then. There is just the "small" matter of shipping an alpha of our secret project first ... you'll find out what is next week, but I think you guys are going to like it [noparse]:)[/noparse]

    T.
  • BTXBTX Posts: 674
    edited 2007-04-03 02:58
    Thanks Tom.
    But only I get is about 10-20Kbytes/sec in spin, now I'll be testing it in assembler, perhaps on Wednesday morning.
    At the momment, I'm not so happy with the VDIP, I'd hope to get more speed in spin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • rokickirokicki Posts: 1,000
    edited 2007-04-03 03:34
    Could you post the full archive of the code you are using to time things? Maybe we can speed things up.

    It looks like the actual read-a-byte code is simple enough that it should work pretty quickly even in Spin.
    But there are some elite spin hackers watching this who I am sure would be able to squeeze out a lot of
    performance from the Spin loop.

    Anyway, good to see progress on this! Many people are waiting, I am sure.
  • Tom BamptonTom Bampton Posts: 29
    edited 2007-04-03 03:41
    The low speeds with the Spin version are not entirely surprising. I was going to do something similar to the full duplex serial driver, that is have a cog running an asm driver that handles reading/writing to/from a buffer in hub ram. Actually, come to think of it, it should be a less than 5 minute job to hack the full duplex serial driver to talk to a VDIP1 in FIFO mode. You'd probably want to increase the buffer size a bit, though.
  • BTXBTX Posts: 674
    edited 2007-04-03 12:31
    Rokicki:
    The code that I used to test the speed is basically the same as I post except that in the last read loop I put two variables storing the cnt value at this time, one before and one after the repeat loop, then I saw which is the difference between them in "number of cycles" so I know the speed (with a not so good precision). Something like this: (the code reads 1152 bytes of data from the file)
    ·
       su := cnt
    
     
        repeat  1160
         temp := INA[noparse][[/noparse]RXF]
          repeat while temp <> 0
           temp := INA[noparse][[/noparse]RXF]
     
          !outa[noparse][[/noparse]VRD]       '                                      
          dato[noparse][[/noparse]x] := INA[noparse][[/noparse]7..0]                'To read data sent by the  VDIP
          !outa[noparse][[/noparse]VRD]       '                                                      
          x := x + 1
    
     
       sd := cnt
       time := sd-su ' Time is about 11Kbyte/sec.  21Kbyte/sec max in spin
       tv.dec(time)  
    

    I prefeer to put some code more, but with a piece of·it in assembler, the last code that I use in spin is basically who I post, but optimized.

    Tom: I'm not a good programmer, it could take to me 5 months ! not 5 minutes, I'dont know why you say to increase the buffer size ?
    at this time I don't remember if I·post a code reading only 15 bytes of data (Could be for that ?).
    I think to use an assembler rutine method, similar that I did for TLC5940, to share data in main memory.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • rokickirokicki Posts: 1,000
    edited 2007-04-03 15:20
    The code looks okay, but there are some minor optimizations; the inner loop might be a bit faster if coded like:

    repeat 1160
       repeat while ina [noparse][[/noparse] rxf]
       !outa [noparse][[/noparse] vrd]
       dato [noparse][[/noparse] x++] := ina [noparse][[/noparse] 7..0]
       !outa [noparse][[/noparse] vrd]
    
    



    But I'm not sure how much of a difference that would make. Certainly worth a try.

    You also mention that you get "about 11Kbyte/sec, and 21Kbyte/sec max in spin"; these
    numbers are different by a factor of two. Have you seen both measurements?
Sign In or Register to comment.