Shop OBEX P1 Docs P2 Docs Learn Events
Data logging into 27937 using SPI, from parallax Quick Start board — Parallax Forums

Data logging into 27937 using SPI, from parallax Quick Start board

Hello everyone, i am new to spin programming language. Trying to write data into memory stick datalogger 27937 using SPI protocol. Not sure whether my code is absolutely wrong or if there is just something i am not aware off. The problem is that i can't get the Quick start board to communicate with the 27937. It keeps throwing message that "USB card not present ". Tried to use echo function but that doesn't work as well. I have attached my program to this message, if anyone have any ideas of how i can solve this problem, please share with me. Thanks in advance

Mindaugas

Comments

  • I haven't used a memory stick datalogger in SPI mode but I've used one in UART mode many times.

    I know some people like using these dataloggers but I've had lots of trouble with the ones I've used. I've had a very hard time finding thumb drives which work well with these dataloggers.

    IMO, it's much much easier to use SD cards with the Propeller.

    What thumb drive are you using? Are you sure it's compatible with the datalogger?

    Are you interested in trying the datalogger in UART mode?
  • Hi Duane,

    Thanks for replay.
    USB stick could be a problem as after initializing the red light should stay on the memory stick datalogger, but it doesn't.
    I would like to try UART just to see if that will work better. Any idea where i could start?
    Would like to be able to save some text in ASCII format if that's possible using UART.

    Mindaugas
  • PublisonPublison Posts: 12,366
    edited 2016-07-08 14:17
    There are a couple of objects in the OBEX. One is SPI. Is that the one you are trying to use?

    http://obex.parallax.com/search/27937

  • Hi Publison,

    Yes, from the link you sent i am using DataloggerSpi program, as well i am using Parallax serial terminal program. What i am trying to do, is to create a simple enough program which would create a .txt file in the usb stick, then write some data in it using SPI protocol. The problem is, in the programs available i never get further then up to the point where it checks if the disk is present. Duane suggested that this might be due to the USB stick, so i am going to try to buy one of the types which are specified in the 27937 datasheet to see it that help any how.
    Perhaps you know any better codes available for testing datalogger in SPI mode?? Then those available in the link you shared?

    Thank you
    Mindaugas,
  • PublisonPublison Posts: 12,366
    edited 2016-07-08 14:50
    Two obvious things from the 27937 document:

    Jumper in SPI Mode

    and
    If you continue having trouble reading from or writing to your USB drive, try the following.
    Connect the USB drive to your PC. Open a My Computer window so you can see what drive letter was
    assigned to the drive. Open a command prompt (DOS) window and type the following (replacing x with
    the letter assigned to your drive):
    chkdsk x: /f
    This will scan the drive for any file system errors and repair them. Always back up important data on the
    drive before running chkdsk or even before logging any data to it to avoid losing important information.
    

    I'm sure you checked these.

    I bought the Data Logger a couple of months ago, but I have not have time to hook it up yet.
  • PublisonPublison Posts: 12,366
    edited 2016-07-08 15:21
    I would not use P3 and P4, as they go to the resistive pads. I would not use P16 and P17, as they are connected to the LEDs. Recommend changing your Pin assignments to P8-P15, as they are not connected to anything.


    • P0 through P7 — General purpose input/output pins. Also connected to the resistive touch
    buttons. When not in use, the buttons will not load the I/O pins, when touched, they will add
    negligible resistive loading.
    • P8 through P15 — General purpose input/output pins.
    • P16 through P23 — General purpose input/output pins. Signals are buffered and displayed on D1
    through D8, with the most-significant bit on the left.
    
  • Thank you Publison, will do the changes and see if this will work for me.
  • MindaugasMindaugas Posts: 15
    edited 2016-07-11 14:57
    Is there any way to somehow force some kind of communication between Vinculum and in my case parallax Quick Start board. I have changed 4 different USB sticks by now. Two of them are made by the companies specified in the datasheet,maybe not exact model but as close as i could get. Used 1, 2, 4 and 8 GB size USB disks. Tried available test programs on the parallax page, but no lack so far. It just can't find the USB. I know UART is alternative but in the end i still will have to make it work in SPI mode.
    For all USB done the check using that command window, all without any faults or errors, i read in some forum that FAT 32 wasn't working then he changed to FAT 16 and it worked. USB i have used had FAT and FAT 32 type file system. I wonder should i try to get one of those FAT 16. Even though datasheet specifies that it should work with FAT 12, 16, 32 type USB discs.
    Thanks for any other ideas.
    By the way have changed the pin numbers as suggested just to be on the safe side, doesn't really made any affect.

    Mindaugas
  • Very interesting, i actually got it working. Of course the program very basic yet, but that's a start. What i changed in stead of using Quick start board i bought parallax chip and created a circuit on breadboard. Changed only few minor things in coding and it worked for all 4 different type USB's even the FAT which is not stated in Vinculum datasheet. Whether there was a problem in Quick Start board or something else hard to know, as it worked in UART mode with this board with out any problems.

    Thanks to everyone who shared their thoughts.
Sign In or Register to comment.