+ Reply to Thread
Results 1 to 4 of 4

Thread: Parallax Memory Stick Datalogger using SPI

  1. #1
    Join Date
    Oct 2008
    Posts
    6

    Default Parallax Memory Stick Datalogger using SPI

    Hello, I have purchased a Memory Stick Datalogger from Parallax
    http://www.parallax.com/Store/Microc...%2cProductName

    and would like to take the sample code found in the samples on microEngineerings website http://www.melabs.com/resources/samp...LSE-LOGGER.pbp

    and use it using SPI for this device. I was wondering how difficult it would be to change the code. I am not too interested in keeping the debug statements. Just the basics to be able to create a file and populate it with some data. I am using a Pic18F452 for the job. Any help is much appreciated.

  2. #2
    Join Date
    Oct 2008
    Posts
    6

    Default

    ok so no replies asof yet so let me ask a different question... after each serout command sent to the datalogger they call the fuction
    GOSUB GET_SERIAL_BYTES ' Purge Received Buffer


    GET_SERIAL_BYTES: ' Subroutine to get serial byte data

    serin2 rx,84,100,phase_out,[iobyte] ' Get byte data
    buffer[index] = iobyte ' Load buffer with IOBYTE
    index = index + 1 ' Increase the buffer size
    if index > 30 then PHASE_OUT ' if more than 30 phase out
    return

    PHASE_OUT: ' timeout buffers too big
    RETURN

    I am not familiar with UART communications. Could this purging function be ommited when using SPI?

  3. #3
    Join Date
    Aug 2006
    Location
    La La Land, where errant code runs by
    Posts
    1,957

    Default

    Quote Originally Posted by djmachine View Post

    I am not familiar with UART communications. Could this purging function be omitted when using SPI?
    That subroutine causes the pic to put each character into individual bytes of an array, and if the information exceeds 30 characters it dumps the whole mess and starts over.
    Human ears are very much like the gills on fish, they close whenever the mouth opens.

  4. #4
    Join Date
    Oct 2004
    Posts
    171

    Default

    For SPI help see SPI clk speed adjustment post #13.
    First run program with Shiftin and Shift out.

    Norm

+ Reply to Thread

Similar Threads

  1. Winbond ISD1700 Voice Recorder
    By RFEFX in forum mel PIC BASIC Pro
    Replies: 54
    Last Post: - 22nd March 2010, 09:18
  2. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 04:08
  3. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 15:42
  4. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 00:22
  5. USB memory stick
    By Robert Hedan in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 12th July 2005, 20:57

Posting Permissions

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