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

Vinculum?

Graham StablerGraham Stabler Posts: 2,510
edited 2009-08-05 10:27 in Propeller 1
Greetings gents, long time no type.

Has anyone produced a full object for the VDrive with error checking etc? A colleague needs to do a bit of data logging and I don't have time to help him much and he is just starting with the propeller otherwise I would try and write it myself.

Basically looking to write to a file as fast as possible nothing much else.

Cheers,

Graham

Comments

  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-08-04 17:35
    I have no experiance with that but did you check the OBEX?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.



    If it's not Parallax then don't even bother. :-)
    ·
    I have changed my avatar so that I will no longer be confused with others who use genaric avatars.

    Mini-Din/PS2 connectors are for sale! 5 for $1! PM me if you wish to make an order.
    Cheap·shipping unless specified!··········150 left!!··




  • T ChapT Chap Posts: 4,223
    edited 2009-08-04 18:47
    I don't have an object, but I have various code blocks used in a project that reads and writes to the USB drive(serial). If you don't find an object that suits you I'll post my snippets. There is no checking though.
  • rokickirokicki Posts: 1,000
    edited 2009-08-04 22:49
    Check the files at the top of this thread:

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

    I think this is the best available option at the moment.

    It is a test release, though.

    How fast is fast, for you?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2009-08-04 23:10
    Thanks I will give that code a go with an SD card. I need about 250kb/s though more would be nice.

    Graham
  • rokickirokicki Posts: 1,000
    edited 2009-08-04 23:29
    From a throughput perspective, that should be pretty easy.

    The tricky thing to watch out for is jitter; occasionally writing a single block will take a substantial
    fraction of a second.

    The write behind code implemented in what we provide above can help, but if you want to sustain
    250KB/sec and the card needs to momentarily pause for, say, 100ms (not outside the realm of
    possibility), then that's 25KB you'll need to buffer somewhere. So even with raw, multiblock
    writes on a super fast card, the propeller just can't buffer very much and there's a chance you'll
    have to drop some data.

    Attaching a large RAM chip to the prop might help with this.

    There are also filesystem issues; depending on the state of your card, how many files there
    are and how fragmented the FAT is, along with how big your cluster size is, the overhead
    for a single block might be quite significant (worst case is probably in the minutes easily,
    if the file system needs to scan a 32GB FAT32 with 512 byte clusters for a free block that
    just happens to be far, far away, well, that's 256MB of FAT we need to scan). You may
    want to use raw writes if you cannot tolerate any latency.

    If you would like to, I'd be happy to discuss more specific details of what you are trying
    to attain. But without a *significant* buffer, SD cards have difficulty with real-time high-rate
    data capture.

    But if you can tolerate the occasional jitter, you can easily get above 1MB/sec to an SD
    card on the prop.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2009-08-05 09:58
    Well essentially we need to store position information from 6 encoders (decoded in another cog and stored in hub memory) which would be two bytes each (12 bytes in total) 1000 times in 1/20th of a second. The card can be completely empty of other files while this is done.

    If the write fails it does not matter as long as we know this and can run it again.

    If I added a ram chip then I would probably just store the data in that and then send to the PC via the usb link but I don't have time to develop anything so it would need to be off the shelf.

    Graham
  • AleAle Posts: 2,363
    edited 2009-08-05 10:27
    I thought the vinculum was the device that kept drones, borg drones, connected to their ship. Or was it the ship-to-ship comm device ?. I forgot. It doesn't matter. lol.gif

    In all seriousness, A preallocated contiguous file in the card and writing raw to it may be the way to go. Then you avoid the filesystem overhead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
Sign In or Register to comment.