Shop OBEX P1 Docs P2 Docs Learn Events
USB datalogger and SX — Parallax Forums

USB datalogger and SX

astro70astro70 Posts: 8
edited 2008-04-25 11:37 in General Discussion
I'm woring on building a data aquisition system for and RC car using the SX and the Parallax·memorystick datalogger.· I've got everything working well except talking to the memory stick.· I can't get the serial communications to work, nor can I find any information·shakehead.gif.· The device is the Parallax USB datallogger (#27937) that uses the Vinculum chip.


Question:· Has anyone used the memory stick datalogger with the SX?· If so, do you have an example of your code I could look at to get me going?· Even the BS2 examples converted to SX (which I've tried and failed) would be helpfull.· If I can get the interface working I can go from there.



Thanks for your help!·

Comments

  • BeanBean Posts: 8,129
    edited 2008-04-22 17:05
    Astro70,
    If you post you code we could maybe see why it's not working.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • astro70astro70 Posts: 8
    edited 2008-04-22 18:21
    Thanks Bean, I pasted below the sub where I am doing the writing to the USB drive.·

    With this I can get the light on the USB drive to flash:

    Write:
    ··revdata = __PARAM1
    · SHIFTOUT Dpin, Cpin, MSBFIRST, revdata, 10
    · PULSOUT Latch, 1
    · RETURN


    I'm pretty sure that the the above is wrong and it should be something like below, but I cannot make anything happen this way.· I think the device needs to use the flow control input, but the SEROUT doesn't allow you to as far as I can tell.· Baud=9600 and counter is a VAR byte

    Write:
    ··revdata = __PARAM1
    · PAUSE 100
    · SEROUT TX, Baud, revdata
    Return

    I know the first thing I need to do is create a file named "blablabla.txt", open the file then write to it, but I can't get past this step.

    Thanks for your help!·





  • BeanBean Posts: 8,129
    edited 2008-04-22 18:32
    Here is some code I wrote for it awhile ago.

    Try the code I have attached.

    P.S. You cannot use the internal oscillator with SERIN and SEROUT is not accurate enough. This may be the problem.
    If your DEVICE line has OSC4MHZ then the code won't work. You need to use a resonator.

    Bean.

    [noparse][[/noparse]edit] Removed code. Posted revised code further down.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com



    Post Edited (Bean (Hitt Consulting)) : 4/25/2008 11:37:04 AM GMT
  • astro70astro70 Posts: 8
    edited 2008-04-23 15:33
    Thanks!· I'll give it a try tonight.· Didn't know about not using the internal oscilator, maybe that was part of my problem.·
  • astro70astro70 Posts: 8
    edited 2008-04-23 23:48
    Well...no luck.· I loaded the program you attached, tried 2 different resonators, verified my connections several times and all it does is flash red-green, red-green on the datalogger.· Won't even flash my thumbdrive light!·

    I hooked it back up to my BS2 and it works flawlessly there.· Any other ideas?· I'm starting to think i have a device problem since my code and your proven code doesn't work confused.gif, but i've never had any problems with my SX?·
  • BeanBean Posts: 8,129
    edited 2008-04-24 01:25
    Please post the working BS2 "and" the non-working SX code.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com

    ·
  • astro70astro70 Posts: 8
    edited 2008-04-24 12:10
  • BeanBean Posts: 8,129
    edited 2008-04-25 11:37
    Okay,
    · I made a few small changes and added some comments about the connection.

    · *** Note that RX on the SX connects to TXD on the datalogger, and so forth for all the connections.

    · I have tried this code and it does work.

    Bean.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Did you know that 111,111,111 multiplied by 111,111,111 equals 12345678987654321 ?

    www.iElectronicDesigns.com
Sign In or Register to comment.