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

Parllax USB datalogger

tabbotttabbott Posts: 26
edited 2007-09-07 22:58 in BASIC Stamp
I am trying to connect the Parallax USB datalogger to a custom design using the OEM SX stamp IC. The board is one of our standard products - the base·PCB design·is working well. I have connected the datalogger in UART mode to the last 4 open IO pins and modified the·test code to work for our configuration - but I can get no feedback from the device.
Baud: 240
Power on: the LED on the device switched red/green then goes dark.
When I connect a USB stick the LED changes to solid red. The stick's light is on.
Datalogger pins: 1=+5, 2=CTS, 3=GND, 4=TX, 5=RX, 6=RTS, 7,8=NC

Is there a list of meanings for the different red/green LED combinations on the datalogger?

My code never exits this loop and always times out:

DO WHILE NOT(iobyte = "E")
· PAUSE 250
· SEROUT· TX\CTS, Baud, [noparse][[/noparse]"E", CR]
· GOSUB getdata
· SEROUT 16,Speed9600,[noparse][[/noparse]DEC iobyte," "]······ 'debug line
LOOP

getdata:
SERIN RX/RTS, Baud, 50000, No_Data, [noparse][[/noparse]ioByte]
RETURN
NO_data:
· SEROUT 16,Speed9600,[noparse][[/noparse]"T"]··················· 'debug line
RETURN

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-04 15:57
    Hello,

    Because you're not listing how the pins of the datalogger connect to the BASIC Stamp, I would suggest checking in the Test Code the I/O Definitions section. It lists exactly where each BASIC Stamp pin should connect. I have seen a few cases of the TX/RX pins being backward when trying to do it by designation rather than number. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • tabbotttabbott Posts: 26
    edited 2007-09-04 17:05
    That would do it, but it appears to match ok.
    And, say someone·did have·the datalogger pluged in backwards or in the wrong mode·- whould that damage it? The red/green LED flashed constantly.

    Here are my assignments:

    CLK············· PIN 2··· 'clock output
    DOline·········· PIN 1··· 'DOline/DI from tool board
    CStension······· PIN 0··· 'select tension ADC
    CScutoff········ PIN 3··· 'select cutoff ADC
    CSeeprom········ PIN 4··· 'select EEPROM
    Relay1·········· PIN 14·· 'Out to relay #1
    Relay2·········· PIN 13·· 'Out to relay #2
    RedLED·········· PIN 11··· 'Out to red LED
    GreenLED········ PIN 10·· 'Out to green LED
    YellowLED······· PIN 12·· 'Out to yellow LED
    Reset··········· PIN 6···· 'In from reset switch (1=off, 0=pressed)
    SpeedSelect····· PIN 7·· 'Select serial speed (1=2400, 0=9600)
    CTS············· PIN 15··· 'yellow pin 2
    TX·············· PIN 9··· 'brown pin 4
    RX·············· PIN 8·· 'blue pin 5
    RTS············· PIN 5··· 'green pin 6
    982 x 1096 - 196K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-04 17:25
    Well, looking at your picture two things come to mind as possibilities as well…One is that longer leads/wires, such as you have may pick up noise from other leads or external EMI/RFI sources. The other thing is the possibility of a bad solder joint or short. Did you solder the wires to the Datalogger?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ahendahend Posts: 4
    edited 2007-09-05 23:49
    Greetings,
    ·
    I am having the exact same issue with my Parallax USB datalogger. Mine is connected to a BS2sx per the datalogger documentation. I have verified each pin connection and made sure it correlated in the code. To be sure the power to the module is adequate, I installed a separate +5VDC regulated supply. Thinking it may be the memory stick, I checked its file system using chkdsk /f·as described, all was well. I even tried a different memory stick. One of the thumb drives is 256Mb, the other is 512Mb. Like tabbott, my processor never exits the synchronization loop:
    ·
    ' For Synchronization send E until echoed back
    DO WHILE (index < 1)
    · PAUSE 250
    · SEROUT· TX\CTS, Baud, [noparse][[/noparse]"E", CR]······ ' Transmit "E CR"
    · GOSUB Get_Serial_Bytes··············· ' Get Returned Data
    LOOP
    ·
    Some documentation on the LED states would be very helpful. What should I see (LED wise) when the drive is synchronized and talking?
    ·
    Any further help is greatly appreciated.
    ·
    Andy

    Basic Stamp 2sx
    Super Carrier development board
  • TintinTintin Posts: 37
    edited 2007-09-06 02:32
    Hello,

    I've noticed the same behaviour with my bs2pe (eme OWL2pe module) when using the datalogger. However by using a debug statement in the synchronization loop, I've realized that the stamp seems to stop/stall in executing its code altogether (power issue?). What's even more interesting is that while the stamp is apparently stalled, momentarily disconnecting power to the datalogger forces the stamp to continue in the synchronization loop for a while until it stalls again.

    My problem originally arose after trying to write to the usb drive once, then unplugging the drive for data transfer to my computer, then plugging it back to the datalogger to write to the device again. For my application this must all happen with the power continuously on. I observed the synchronization problem during the second write attempt. Luckily, I've managed to assure reliable synchronization by setting the usb drive to "suspend mode followed by high TX and low RTS", and "awake mode followed by high TX and low RTS" after and before each write sequence; ie:

    HIGH pinMEMtx
    LOW pinMEMrts
    PAUSE 400

    SEROUT pinMEMtx\pinMEMcts, conMEMbaud, [noparse][[/noparse]$16, CR] ' awake mode

    (... read/write code)

    SEROUT pinMEMtx\pinMEMcts, conMEMbaud, [noparse][[/noparse]$15, CR] ' suspend mode

    HIGH pinMEMtx
    LOW pinMEMrts

    Hopefully sharing my experiences will help one of you! Best of luck.

    Frank
  • tabbotttabbott Posts: 26
    edited 2007-09-06 14:50
    I still have no luck getting my datalogger to work. I reheated all the joints and shortened the connecting wires to 2".

    My stamp doesn't stall during operation, I get: T 48 T 48 T 48 T 48 ... for as long as I have it powered (I set iodata to '0') with the code I listed above. But I will try Tintin's suggestion and see what that does.
  • ahendahend Posts: 4
    edited 2007-09-06 16:34
    Thanks Frank for the SYN, ACK power management trick. I will certainly give it a shot. Meanwhile I believe my baud rate is set improperly. The example code I’m working with defaults the baud mode to 84 (9600bps,8,N,TRUE on a BS2). Since I have a BS2sx, I need to use baud mode 240 to yield 9600bps,8,N,TRUE.
    Hopefully this will rectify the issue. I’ll give it a try tonight. ··
    Original code listing:
    Baud··········· CON···· 84············· ' Serial Baud Rate 9600 bps (BS2)··
    ·
    Andy
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-06 16:53
    It seems the more common problems are with the BS2sx. The baud rate values for the BS2sx are different than the BS2, so that would need to be changed before the code would work. As for the code stalling…It’s not that it is stalled…The SERIN has a timeout set and returns. The DO…LOOP will execute until index < 1. This is not happening which could indicate a problem. The only customer who has called in with this issue had not tried alternate I/O lines, and when they did it worked. Presumably the original had been damaged due to connecting TX/RX backward or something, so try alternate I/O pins to verify as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • tabbotttabbott Posts: 26
    edited 2007-09-06 16:59
    Oh! And as I have stated above, I did have the lines switched at one point. Guess I'll get another board and try again. *crosses fingers*

    Might want to add a note to the datalogger instructions that the RX/TX lines used in the code are NOT the same as the ones listed on the pin layout.

    And a list of LED meanings! Please?
  • TintinTintin Posts: 37
    edited 2007-09-06 17:12
    In reply to Chris's post, the "stalling" I am refering to is not due to the·SERIN timing out (I have a debug·statement that shows "timeout" every time this happens).· When timeout does occur, we simply return to the do-loop (again debug statements show this) and attempt to sync again.· What I have observed is several loops, then, when no sync occurs, a stall; as if the stamp is set to sleep.· As I said, toggling the power on the datalogger awakens the stamp and the sync loop resumes where it left off.· I am just mentioning this out of pure curiosity; I have already resolved my problem·but can't explain·this·issue.

    As for the led meanings:·red / green flash for 2 seconds = sync to logger monitor (at power on)
    ·································red·on / green off = usb drive present
    ································ red off / green off = no usb drive
    ·································green on / red off = initialization
    ·································red flash = sending·data to drive


    ································ Note if red / green flash keeps occuring, no sync is found

    These have·been extrapolated from the·chip datasheet on·Vinculum's website:
    http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.1%20Rev%202.pdf

    As an aside, is there a way to acess pin 38 (RI#) which can be toggled to waken the device after suspending monitor and clocks?· Also, is that function on the firmware of the devices used by Parallax?

    Best,

    Frank



    Post Edited (Tintin) : 9/6/2007 5:25:31 PM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-09-06 17:41
    Hi ,the RI# is pin 8 of the data logger. The logger flashes red/green on power up maybe 3 times then remains off. When a stick is inserted the light blinks red once then remains green. At the same time it examines the thumbstick (indicated by the thumbstick flashing) for a second or two. When the thumbstick stops flashing it is ready to read/write and the loggers light is green. During a write the green light blinks briefly.

    I have an example prog to test functionality, please note it does not use the RTS CTS flow control. The program works with RI# and RTS not connected and CTS hooked to VSS. The Stamp receive is Pin0 and transmit is Pin1. Download the program with the logger hooked up and the stick removed. At the DEBUG prompt insert the stick and let the logger read. When the logger has finished examining the drive try to write using the DEBUGIN.

    Jeff T
  • TintinTintin Posts: 37
    edited 2007-09-06 17:58
    Funny, my led behaviour is opposite; maybe the led color orientation was reversed for some units?· I am sorry about the RI# question, I guess I missed it on the parallax datasheet...

    Post Edited (Tintin) : 9/6/2007 6:03:25 PM GMT
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2007-09-06 18:07
    Sorry I should have said I was working with a Vdrive which is the same animal in a different package so the LEDs could quite possibly be reversed.

    once again sorry for any confusion it caused

    Jeff T.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-06 20:10
    tabbott said...
    Oh! And as I have stated above, I did have the lines switched at one point. Guess I'll get another board and try again. *crosses fingers*
    Might want to add a note to the datalogger instructions that the RX/TX lines used in the code are NOT the same as the ones listed on the pin layout.
    And a list of LED meanings! Please?
    Hello,

    ·· As the author of the documentation and code I cannot find any issues with the pins used.· The pins used in the code perfectly match the wiring diagram in the documentation.· Please tell me exactly where you see a problem and I will have the code and/or documentation revised to correct it.· Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-06 20:16
    Tintin said...(trimmed)
    As an aside, is there a way to acess pin 38 (RI#) which can be toggled to waken the device after suspending monitor and clocks?· Also, is that function on the firmware of the devices used by Parallax?
    The RI# Pin is listed in the documentation as being pin 8 when the device is in UART mode.· As for the firmware, it is the default firmware for the Vinculum chip (VDAP).· Nothing is customized about it.· I hope this helps.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • tabbotttabbott Posts: 26
    edited 2007-09-06 20:27
    Yes, the wiring diagram and code match correctly, what I am talking about·are the next pages. There it lists what the pins on the datalogger correspond to in UART and SPI mode. The RX/TX and CTS/RTS are reversed in the UART list (through correct from the datalogger's standpoint).
    As I was unable to follow the wiring diagram shown, I used that list to connect to the stamp. The RX pin·needs to connect to the TX variable and so on, just like in a standard serial pin layout. I of course, got them backwards!
    So a note on those lists reminding those of us who forget that the datalogger's RX/RTS is the stamp's TX/CTS would be very·helpful.
  • tabbotttabbott Posts: 26
    edited 2007-09-06 20:33
    Tintin said...


    As for the led meanings:·red / green flash for 2 seconds = sync to logger monitor (at power on)
    ·································red·on / green off = usb drive present
    ································ red off / green off = no usb drive
    ·································green on / red off = initialization
    ·································red flash = sending·data to drive


    ································ Note if red / green flash keeps occuring, no sync is found


    Thank you! That will help a lot. Also - the red/green constant flash may mean that the wires are connected wrong... oops!
  • ahendahend Posts: 4
    edited 2007-09-06 21:55
    Thanks for the input. I have a much better understanding of the data logging module now. My baudmode is now corrected (stupid oversight on my part) and the BS2sx is syncronizing and writing data.

    Chris, It might not be a bad idea to post a link to the Vinculum Firmware User Manual sited above in Tintin's post. I figured I had all the documentation I needed from the USB Datalogger page, another stupid oversight on my part.

    Thank you
    Andy

    Post Edited (ahend) : 9/8/2007 4:00:28 AM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-07 14:51
    Andy,

    That manual is linked on our website. Please see the second link on the product page below. This is also referenced in the manual. Take care.

    http://www.parallax.com/detail.asp?product_id=27937

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ahendahend Posts: 4
    edited 2007-09-07 21:21
    Chris,

    This is not the same document, that is why we can't find any reference to the LED's. The firmware spec (the link you indicate) is a 17 page brief. The link Tintin posted - http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.1%20Rev%202.pdf is a 63 page user manual, complete with LED specifications and much more.

    Andy
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-09-07 22:58
    I think at this point we’ll just add to the documentation we provide. Posting the full user manual would likely cause confusion since there are references to a lot of things not dealt with on this hardware, such as the parallel interface and pinouts of the SMD chip. The document posted is the Firmware Specification. The brief they have doesn’t have the commands. We’ll post an update this coming week. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.