Shop OBEX P1 Docs P2 Docs Learn Events
Memory Stick Datalogger — Parallax Forums

Memory Stick Datalogger

Earl FosterEarl Foster Posts: 185
edited 2008-08-19 02:56 in Propeller 1
Couple of questions

The memory stick features "5V supply with 3.3V/5V Safe I/O" pins.· Does this means that I do not need to use 1K resistor to interface with the Propeller even though it is powered by 5V?

Which mode is better to use (UART or SPI) with the Propeller?· Is there an advantage/disadvantage of one mode over the other?


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
WWW.HAPB.NET

"Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-02 14:47
    Earl,

    The internal I/O reference voltage is set to the 3.3V supply on board making the I/O outputs suitable for 3.3V systems. So yes, you can connect directly, however be aware that a programming mistake can still cause damage to an I/O pin. As for mode that’s really a matter of choice, however I find that the serial mode is more useful on the BASIC Stamp because of the ability to format the output strings going to the device. On the Propeller this could easily be done either way. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • LeonLeon Posts: 7,620
    edited 2008-07-02 14:50
    SPI can be a lot faster than async. serial.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-02 15:14
    Leon is correct...it would also consume less I/O pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Earl FosterEarl Foster Posts: 185
    edited 2008-07-02 18:07
    Thanks for responses.

    I noticed the 2 LEDs on the PCB (Red, Green) but I did not see anything mentioned about them in the VDAPFirmwareSpec or MemoryStickDataloggerV1.0 pdfs. I would assume they are for visual indications of what is happening during read/write processes. If so, is there a reference available?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-02 19:21
    The LEDs were recently covered in the following thread. I hope this helps. Take care.

    http://forums.parallax.com/showthread.php?p=733935

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Earl FosterEarl Foster Posts: 185
    edited 2008-07-25 15:57
    I tried both SPI and UART and had better success with UART.· For some reason I could not get consistant results with the published SPI object.· I do have an additional question.

    I wrote a small test·program that writes to my USB flash drive using USBDrive object.· It seems straight forward but the filename gets written at the end of each write statement.· Not sure why.· Perhaps someone can help.

    con
      _clkmode = xtal1 + pll8x
      _xinfreq = 10_000_000
      'Datalogger UART pins
      CTS   = 15                  ' RTS# Request To Send (Connects to MCU CTS)
      TXD   = 14                  ' RXD Receive Data (Connects to MCU TXD)
      RXD   = 13                  ' TXD Transmit Data (Connects to MCU RXD) 
      RTS   = 12                  ' CTS# Clear To Send (Connects to MCU RTS)
    obj
      flash:        "USBdrive"
    pub main
      waitcnt(clkfreq*10 + cnt)        'Used for cold startup of MemoryStick
      flash.start(TXD,RTS,RXD,CTS)
      waitcnt(clkfreq/4 + cnt)         'Wait time between operations
      flash.openForWrite(@filename)
      waitcnt(clkfreq/4 + cnt)
      flash.writeline(@alt)
      waitcnt(clkfreq/4 + cnt)
      flash.close(@filename)
    dat
     alt          byte      "My altitude is 535 feet"
     filename     byte      "hapb.txt", 0    ' Zero is needed to prevent junk from being written to file
    

    The output file looks like this after 3 runs
    My altitude is 535 feethapb.txt
    My altitude is 535 feethapb.txt
    My altitude is 535 feethapb.txt

    It seems that it is writting everything I put under the DAT section of my code instead of just the information I am pointing to.· I added additional DAT statements and they appeared in the file so I must not be terminating the write statement properly.

    Figured it out.· Need to terminate my DAT statements with Zero.· Never mind!!!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    WWW.HAPB.NET

    "Don't ask yourself what the world needs - ask yourself what makes you come alive, and then go do it." - H.T.Whitman

    Post Edited (Earl Foster) : 7/25/2008 4:44:30 PM GMT
  • heathclfheathclf Posts: 43
    edited 2008-08-19 01:09
    Earl,

    I'm having trouble getting off of the ground. I'm setup for UART mode, I believe correctly (8 is NC though), and I used your exact code (thanks, btw) just to get something to write. Anyway, I can't get anything to write, would appreciate any help

    2 things that bug me:

    My lights never stop flashing, which I guess means that my monitor never connects?

    Is your propeller Pin 13 RXD connected to pin 4 or 5 of the Datalogger? (is the MCU referred to on the DataLogger or is it the propeller)

    Thanks
  • heathclfheathclf Posts: 43
    edited 2008-08-19 02:56
    Wow...nevermind. Got it to work...it's always the dumb mistakes...
Sign In or Register to comment.