Shop OBEX P1 Docs P2 Docs Learn Events
Datalogger issue — Parallax Forums

Datalogger issue

TCP71TCP71 Posts: 38
edited 2011-06-20 08:08 in Propeller 1
I have the USB datalogger (#27937) attached to my prop via the SPI connections (with 1k resistors in the 4 data/control) lines. When I power up the board, the red and green LEDs flash for a second or two, then stop. This seems to be the regular boot sequence. After that it does nothing. It doesn't react when a stick is inserted, when I attempt to access it from the prop in any way. I've confirmed the pinouts are in the correct for SPI Mode, the jumper is set for SPI and the unit has clean 5V power. My code is below. Could it be a firmware issue on the datalogger board? Why wouldn't it even light up the LED when the stick is inserted? The Stick I'm using has been used with the datalogger previously in UART mode, so seems to be compatible. Again, any help or suggestions appreciated.

Pertinent Code:
CON

  _clkmode = xtal1 + pll16x
  _xinfreq = 5_000_000

  LoggerSDO = 0                 'Datalogger Data out pin
  LoggerSDI = 1                 'Datalogger Data in pin
  LoggerCLK = 2                 'Datalogger Clock pin
  LoggerCS = 3                  'Datalogger Chip Select pin

OBJ

  Log :         "DataloggerSPI"

Pub init

  pst.start(115_200)
  P2P.start(Data1Rx, Data2Tx, 0, 19200)                                         'Set up communication between props
  Card.FatEngineStart(CardSDO, CardCLK, CardSDI, CardCS,-1,-1,-1,-1,-1)         'Set up Card functions
  Log.DataloggerSPI(LoggerCS, LoggerCLK, LoggerSDI, LoggerSDO)                  'Start Datalogger

Pub DumpUSB | CC

  repeat
    CC := P2P.rxcheck
    log.receivePromptOrError(2000)     ' get unsollicited message from datalogger
    if log.diskPresent
      pst.str(string("Disk recognized"))
      pst.char($0D)
      P2P.tx("P")
      StickIn := "P"
      quit
    else
      pst.str(string("No disk present."))
      pst.char($0D)
      waitcnt(clkfreq+cnt) 'wait 1 second
      P2P.tx("N")
    if CC == "Q"
      pst.str(string("Quitting Stick"))
      pst.char($0D)
      quit
  waitcnt(clkfreq*4 + cnt)

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2011-06-17 10:11
    Hi TCP71,

    please take a look into this thread which explains how post code and keeping the indention and displaying the code in a constant size font
    http://forums.parallax.com/showthread.php?129690&p=978076&viewfull=1#post9780%2076

    best regards

    Stefan
  • TCP71TCP71 Posts: 38
    edited 2011-06-17 10:24
    thanks. done
  • WBA ConsultingWBA Consulting Posts: 2,935
    edited 2011-06-17 11:45
    It's been a few years, but I had a similar issue and it ended up being that my memory stick was not compatible for some reason in other modes. After hours of messing with code, I tried a different stick and everything worked perfectly. So, I would recommend trying another stick even though it works in UART mode.

    Here are some notes from when I was using the datalogger and having troubles:
    1) Jumper Setting
    2) Pinout:
    1 Vss Connects to System Ground
    2 SDO Serial Data Output
    3 Vdd Connects to +5V (Regulated)
    4 SDI Serial Data Input
    5 SCLK Serial Clock Input (12 MHz Max)
    6 CS Chip Select Input
    7 NC No Connection
    8 NC No Connection
    3) 5v versus 3.3v
    4) Verify Power On LED sequence:
    Green LED and Red LED flash
    alternately for 2 seconds Repeated
    until monitor connects
    Have you read the reviewer's comment posted on the OBEX page for the Datalogger SPI object? Here is part of it:
    I also added the following code to get things started during initialization. This is only called in my program 1 time after power up. PUB flush 'very important to have this section in the code for logger to work on power up waitcnt(clkfreq/1000 + cnt) repeat if readByte <> -1 'if new data read waitcnt(clkfreq/1000 + cnt) else quit Overall it worked great.

    Good luck!
  • TCP71TCP71 Posts: 38
    edited 2011-06-20 08:08
    It's been a few years, but I had a similar issue and it ended up being that my memory stick was not compatible for some reason in other modes. After hours of messing with code, I tried a different stick and everything worked perfectly. So, I would recommend trying another stick even though it works in UART mode.

    Here are some notes from when I was using the datalogger and having troubles:
    1) Jumper SettingSet to SPI
    2) Pinout:
    1 Vss Connects to System Ground
    2 SDO Serial Data Output
    3 Vdd Connects to +5V (Regulated)
    4 SDI Serial Data Input
    5 SCLK Serial Clock Input (12 MHz Max)
    6 CS Chip Select Input
    7 NC No Connection
    8 NC No Connectionpinouts seem correct and correct pins. I have a 1k resistor inline with the 4 data/clock/control lines. Maybe they should be 4.7k?
    3) 5v versus 3.3v definitely 5V from my power supply
    4) Verify Power On LED sequence:
    Green LED and Red LED flash
    alternately for 2 seconds Repeated
    until monitor connectsThis is a bit confusing yet. On power up the, the leds flash red/green for 1 to 1.5 seconds, then stop. I assume this means that the monitor is connecting properly?
    Have you read the reviewer's comment posted on the OBEX page for the Datalogger SPI object? Here is part of it:


    need to check this a bit more. I don't have this code in place at initialization. Should I just run in after calling the dataloggerSPI object?Good luck!
Sign In or Register to comment.