Shop OBEX P1 Docs P2 Docs Learn Events
Hitt data logger vs. memory stick data logger — Parallax Forums

Hitt data logger vs. memory stick data logger

UVA BAJAUVA BAJA Posts: 2
edited 2008-04-01 00:39 in General Discussion
i am trying to create a data acquisition system for a mini baja competition car and we had previously tried to use the BS2 controller and a memory stick data logger. we found that the BS2 did not have the speed that we needed to take accurate reading for all four shocks and the acceleration at the same time. We had previously purchased the memory stick data logger (uses a flash USB drive) and i was wondering if it was possible to adapt that to the SX. I have all the code that makes it run on the BS2 but since i have very limited experience with the SX i am having trouble updating it to the system. Is this even possible to do (we are under a budget and time constraints). Thanks

UVA Mini Baja Team

Comments

  • BeanBean Posts: 8,129
    edited 2008-04-01 00:25
    The Hitt SD Datalogger is not really the fastest, it was not designed to be fast. It was designed to use low power.

    The writing speed is·quick until the data file grows·large, then it can take a couple seconds to write.

    My suggestion would be to save the data to EEPROM, then after the fact move the data from the EEPROM to the data logger.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com



    Post Edited (Bean (Hitt Consulting)) : 4/1/2008 11:25:14 AM GMT
  • UVA BAJAUVA BAJA Posts: 2
    edited 2008-04-01 00:39
    thanks that helps a lot. we have to take a ton of data at very small time intervals and then record it. that was one of the options that we had been considering. I was also wondering if anyone had some helpful hints about converting the code. I am not very good at it and it is difficult to work on seeing that i am not sitting with the microcontroller here at my desk.

    PAUSE 120
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"CD UVAMiniBaja", CR]
    GOSUB Get_Serial_Bytes

    ' Open FrontRight.xls for output (write)
    PAUSE 120
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"OPW FrontRight.xls", CR]
    GOSUB Get_Serial_Bytes

    counter = counter + 1 ' Increment Counter

    ' Write loop counter value and data separator to DATAFILE.TXT
    PAUSE 120
    'DEBUG "Writing data separator now... ", CR
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"WRF ", $00, $00, $00, $09, CR,
    DEC5 counter, "**", CR, LF,CR]
    GOSUB Get_Serial_Bytes


    PAUSE 120
    DIRH=255

    FOR i=1 TO 1000 'data acquisition loop

    GOSUB Get_ADC_Data
    'DEBUG DEC3 ADCdata,CR

    SEROUT TX\CTS, Baud, [noparse][[/noparse] "WRF ", $00, $00, $00, $05, CR, ' writes data to flash drive
    DEC3 ADCdata, CR,LF, CR]
    'DEBUG "say hello, ",CR
    GOSUB Get_Serial_Bytes
    PAUSE 1

    NEXT ' end of data acquisition loop

    ' Close DATAFILE.TXT
    PAUSE 120
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"CLF FrontRight.xls", CR]
    GOSUB Get_Serial_Bytes

    ' Change to root folder
    PAUSE 120
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"CD ..", CR]
    GOSUB Get_Serial_Bytes


    ' USB Suspend Mode (Power Saving Mode)
    PAUSE 120
    DEBUG "Putting drive to sleep...", CR
    SEROUT TX\CTS, Baud, [noparse][[/noparse]"SUD", CR]
    GOSUB Get_Serial_Bytes
    END ' ends program at this point ready for addition of loops

    Get_Serial_Bytes:
    timeout = 1 ' Set Timeout Indicator Flag
    index = 0 ' Initialize Index
    marker= 0
    DO WHILE (timeout > 0) ' While Timeout Has Not Occurred
    'DEBUG "hello get serial bytes",CR
    marker = marker+1
    ioByte = 0 ' Clear Temporary Storage
    SERIN RX\RTS, Baud, 100, No_Data, [noparse][[/noparse]ioByte]
    buffer(index) = ioByte ' Save Byte Received To Array
    index = index + 1 ' Increment Index
    IF (index > 14) THEN ' Check For Overflow
    index = 14 ' Prevent Overflow
    ENDIF
    LOOP
    DEBUG "Do loop ran...", DEC marker, " times",CR
    RETURN


    there is some of the code i am working on it right now but so far i am not getting that far. Also if there is any way to optimize the time that it takes to run that would be great. that is the hardest thing that we have come across so far and if the data does not come in fast enough it is invalid and there is no reason to even take it. all we need is the raw data which we can then convert to what we need in excel.
Sign In or Register to comment.