Parallax Memory Stick Datalogger using SPI


+ Reply to Thread
Results 1 to 4 of 4
  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
    Look, behind you.
    Posts
    2,817

    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.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Oct 2004
    Posts
    440

    Default

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

    Norm

Similar Threads

  1. Winbond ISD1700 Voice Recorder
    By RFEFX in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 22nd April 2014, 11:00
  2. Using SPI with External Interrupts
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 29th June 2008, 05:08
  3. 16-bit SPI problem
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th June 2008, 16:42
  4. Need the code to write to a memory
    By Hamlet in forum General
    Replies: 0
    Last Post: - 20th August 2007, 01:22
  5. USB memory stick
    By Demon in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 12th July 2005, 21: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