Flash Memory Cards, USB sticks and Excel


Closed Thread
Results 1 to 18 of 18
  1. #1
    timmers's Avatar
    timmers Guest

    Default Flash Memory Cards, USB sticks and Excel

    Has anyone ever implemented a data logging routine accessible to Excel?

    The application is for a flight recorder to store data on a memory card or USB stick, in such a way as to allow import into Microsoft Excel as comma seperated variables (*.CSV) or similar. Collecting around 1200 bytes a second into a USB stick makes a very useful performance analyser and de-bugger.

    I think the hardest part is formatting the card in such a way as to make it PC compatible.

    Is there any usefull research material you could point me too.


    Tim.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default

    Writing to an USB stick may be a problem since the PIC is an USB-Slave, just as the USB stick. Writing to a SD-card or similar should be possible with PBP but there aren't any ready made "commands" to do so, you need to write the routines yourself.

    If you want to take an easier aproach you might have a look at modules like DOS-on-chip or the MicroDrive. They interface to your PIC via RS232 or SPI and handles all the reading/writing to the SD-card. There are other similar products but their names escape me at the moment.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Another possibility would be the FTDI Vinculum VDIP1. I have a couple on the bench and so far I like them. The only draw back I can see is the VDIP has to know EXACTLY how many bits are going to be written to it at a time.

    I am planning to use the VDPI for a data logger from a gps module.

    For the excel app, write the file as a CSV.

    BrianT put together a nice how to, to get started with the VDPI.
    http://www.picbasic.co.uk/forum/showthread.php?t=7700
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    To read a memory card directly on a PC, if needs to have a FAT file format as in the case of the DOSonChip. Note that the Microdrive, as mentioned in the second post does not have FAT so you cannot read the card directly on a PC.

    The simplest solution is to use a PIC18 to write directly to SD/MicroSD or Compact Flash using FAT16/32. You can create CSV files for reading by Excel. I would recommend going with SD or MicroSD (instead of compact flash) as the physical interface to the PIC is simpler (uses much fewer lines) and the cards are smaller and less expensive.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    In the past, I skipped the FAT16/32 step altogether. I save the data on the SD card (or CF card or whatever) according to the way I want it. When I need to retrieve the data, I just import it using the serial port on the PIC and Hyperterminal on a PC and save it to a file. Do some 'post-processing' on a PC with some VB instead of worrying about trying to reinvent the wheel and write a FAT16 filing system on a PIC.

  6. #6
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Yes, that is definitely a viable solution if it fits the needs of the end user/customer.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    Yes, that is definitely a viable solution if it fits the needs of the end user/customer.
    True...
    I guess in my mind, FAT16/32 support is nice, but is it really worth the programming hassle, much less the code space, instruction cycles, etc. that might be a lot better off used elsewhere.

  8. #8
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default

    Sometimes it is a convenience issue - or the customer just wants a fool-proof system for the average user. See post #2 here:
    http://www.picbasic.co.uk/forum/showthread.php?t=9619

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    Sometimes it is a convenience issue - or the customer just wants a fool-proof system for the average user. See post #2 here:
    http://www.picbasic.co.uk/forum/showthread.php?t=9619
    Oh, I agree... If a guy is getting paid for it, then sure, use FAT and everything else, especially if you've already got the libraries and/or routines already written...
    Biggest program I've got going is a full 18F4685 for that OBD2 reader...OBD2 interface, color gLCD, keypad, serial, SD card, and so on and so on...
    Problem is, I'll probably never make any money off it!!!

  10. #10
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Angry

    I also will not make any money off that project either, though - the customer probably will - it was contract design deal.

  11. #11
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    You could try this from here

    http://www.parallax.com/ProductInfo/...3/Default.aspx

    You could use an external eeprom then upload via the serial port striagh into excel I know it's for the basic stamp but should be easily ported over to PBP

    I know that sword fish and PDS support the SD card,

  12. #12
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rmteo View Post
    I also will not make any money off that project either, though - the customer probably will - it was contract design deal.
    Tell ya what... You make something for me, I'll buy it from you. Then I'll make something for you, and you buy it from me. That way we can both tell people we've made a lot of money from our knowledge!

  13. #13
    timmers's Avatar
    timmers Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for some good ideas, definately helps to discuss a project before you start...

    The DOS-ON-CHIP looks the most likely solution, and I will try and order one as soon as.
    Regarding the other sugestions of importing and converting, thanks for the thought, but not suitable. Its to go into our GY235 gyro stabilised camera so engineers can pull the card, plug into a laptop or blueberry, e-mail us the latest file then we can suggest fixes or settings issues from the comfort of an office instead of the customer coming back to us.

    If anyone is interested there is some demo footage on http://bradeng.com/videos.htm
    The whole thing has 9 PIC's inside.
    Father Christmas has the model number and elv's can deliver!!


    Tim.

  14. #14
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Cool

    I have it done ... with another compiler.
    Logger with PIC & SD-Card & CSV ... working !
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  15. #15
    timmers's Avatar
    timmers Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BigWumpus View Post
    I have it done ... with another compiler.
    ... any more details? or are you holding back.

  16. #16
    Join Date
    Dec 2006
    Posts
    38


    Did you find this post helpful? Yes | No

    Default Different Compiler

    Try MikroBasic by mikroelectronica they have support ie library for connecting an sd card directly to a pic via a few resistors.

    There are plenty of examples on their forum. and fat is supported

    The interconnect is on post 4

  17. #17
    Join Date
    Nov 2005
    Posts
    51


    Did you find this post helpful? Yes | No

    Default

    Try Proton or sword fish they also include library's to do the job and I think that swordfisfh supports fat32

  18. #18
    Join Date
    Apr 2006
    Location
    Alberta Canada
    Posts
    166


    Did you find this post helpful? Yes | No

    Default

    ive been using a rogue robotics SD card writer for some data logging circuits. http://www.roguerobotics.com/products/electronics/ummc just write data to it with "," in between, and it will open in excel.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts