Shop OBEX P1 Docs P2 Docs Learn Events
TSL1401 & MoBoStamp-pe text file output — Parallax Forums

TSL1401 & MoBoStamp-pe text file output

mclparkermclparker Posts: 15
edited 2010-12-13 11:20 in Accessories
Hi all,

I'm struggling with trying to get a text file output from my MoBoStamp-pe with TSL1401 pixel number and volts bit value. I am running windows xp pro on a dell t3400.

Can anyone help out this inexperienced programmer with hints or code examples.?

Thank you,

mike

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-03 18:41
    Hi Mike,

    What have you tried so far, and what problems has it presented?

    -Phil
  • mclparkermclparker Posts: 15
    edited 2010-12-04 13:24
    Hi again Phil,

    I was hoping you would find this post. Thank you for taking the time to respond.

    Actually, I have not tried anything except:

    a] hooking everything up and playing with the tsl1401 monitor program

    b] reading the basic stamp programming material [including a bunch of your material] that I downloaded for the tsl1401 & mobo.

    I am old fortran/basic dude so i was looking for a "write command" and could not find it or anything similiar.

    I am [hopefully] going to use the tsl1401 & mobo for an inexpensive spectrometer I'm building.

    Via cheap optics, I beam various LEDs to a grating and then to the tsl1401. I liked your clever stacking scheme (TSL1401-DB document) so I plan to use it.

    My objective for mobo is for it to beam a text file with pixel number, pixel volts, pixel line number, and a time stamp to my puter.

    From that text file I can then use some math to get me what I'm really after...wavelength Vs. amplitude.

    I think all I need is for someone to point me at the commands that do these operations. Code snippet examples would be a delightful surprise.

    mike
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-04 13:56
    Mike,

    Look up SEROUT and DEBUG in your PBASIC manual for info on outputting data to your computer. I would recommend using the fastest possible baud rate (38,400) and the absolute briefest data format (raw binary or hex) for transmitting pixel data to the PC. Forget sending a timestamp and pixel numbers: your PC program can fill that in. The reason I say this is that grayscale pixel data are received from the AVR as they're being clocked out from the sensor. You don't want to slow this process down by interspersing it with wordy ASCII. Otherwise, you risk the "pixel droop" phenomenon explained in the TSL1401-DB manual.

    Good luck with your project. It sounds like an interesting one!

    -Phil
  • mclparkermclparker Posts: 15
    edited 2010-12-06 20:52
    Hi Phil,

    At the expense of trying your patience, I have a related question. I read your material on Pseudo-analog Pixel Acquisition. I can stumble through the basic stamp code...but I don't know the limits of the stamp memory. Is there a way [tricky or otherwise] to get analog volts out for each pixel in a single cycle?

    mike
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-06 23:10
    Mike,

    If you're using the MoBo, you don't need to go through that rigamarole. The TSL1401 AVR firmware does the A-to-D conversion for you. You just need to load the firmware into the AVR using the LoadAVR program downloadable from Parallax and follow the examples in the TSL1401-DB documentation. Neither the BS2pe nor the AVR have enough RAM to hold an entire gray-level scan at once. That's why I suggested that you need to get the data out to the PC as fast as possible as it's being read out of the sensor via the AVR.

    -Phil
  • mclparkermclparker Posts: 15
    edited 2010-12-13 10:25
    Mike,

    If you're using the MoBo, you don't need to go through that rigamarole. The TSL1401 AVR firmware does the A-to-D conversion for you. You just need to load the firmware into the AVR using the LoadAVR program downloadable from Parallax and follow the examples in the TSL1401-DB documentation. Neither the BS2pe nor the AVR have enough RAM to hold an entire gray-level scan at once. That's why I suggested that you need to get the data out to the PC as fast as possible as it's being read out of the sensor via the AVR.

    -Phil

    Thank you again Phil,

    I don't know if I am lame or what, but I cannot find any discussion or code examples on how to send TSL1401-DB (using 2pe mobo) voltage data to a data file [e.g., volts.dat] on my computer. All the examples send the data to the screen monitor. Help!

    Also, Phil, what is supposed to be done with TSL1401_DB connectors (J1 & J2)? I can't find any discussion in your user manual for the 1401 db.

    Thank you again for any help you can give me.

    mike
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-12-13 11:20
    mclparker wrote: »
    I cannot find any discussion or code examples on how to send TSL1401-DB (using 2pe mobo) voltage data to a data file [e.g., volts.dat] on my computer.
    There is no way for a PBASIC program to specify that data be written to a file on the PC. That has to come from a program on the PC side that captures data from the serial port and stuffs it into a file. Typically, such a program would send a command to the MoBo to capture a new frame, and the MoBo would send 128 bytes of data back to the PC, which would be intercepted by the program and saved in a data file. You might also take a look at PLX-DAQ, which can import serial data into an Excel spreadsheet.
    mclparker wrote: »
    Also, Phil, what is supposed to be done with TSL1401_DB connectors (J1 & J2)? I can't find any discussion in your user manual for the 1401 db.
    J1 is an accessory socket. As yet, there are no accessories available for it. J2 can be jumpered to provide a triggering pulse (e.g. for a strobe) to another daughterboard plugged into the MoBo.

    -Phil
Sign In or Register to comment.