Shop OBEX P1 Docs P2 Docs Learn Events
Data from stamp to PC — Parallax Forums

Data from stamp to PC

HermHerm Posts: 5
edited 2004-08-19 17:23 in BASIC Stamp
I'm an old newbie (renubie?) who has done a couple of stamp/stepper motor projects in the past.· I'm now interfacing a Honeywell ASDX DO pressure sensor with a stamp, using I2C protocol.·
That part of the project is going all right, but I'd·appreciate any advice on how to get data from the stamp into a PC (Excel?).· Am I missing something-is this a done deal or what?
I'm in the hobby mode with this project, so I can't afford hi buck solutions.· Would really appreciate any advice.· Thanks.···· Hermanator

Comments

  • AlWilliamsAWCAlWilliamsAWC Posts: 135
    edited 2004-08-16 13:42
    I have a few things on the Web that might help you. Have a look at http://www.awce.com/stampcom.zip

    Also, http://www.al-williams.com/npdaqax.htm·works great from Excel or C++ or VB. It is technically made to work with our NetPorter DAQ board, but the download is free for personal use and if you can make your Stamp output strings in the form of:

    V1=data
    V2=data

    Where V1 and V2 are any identifier you want and data is whatever the value you want, then it will work great. For example, you might write:

    Temp=33
    Level=100
    Status=1110011

    Regards,

    Al Williams
    AWC
    Add Floating Point to your Stamp (now with Macros)
    http://www.awce.com/pak12.htm

    ·
  • HermHerm Posts: 5
    edited 2004-08-16 17:19
    Thanks for the help, Al. I'll now decide which way to go VP, Excel,C++... and proceed. I may also want a floating point module if I'm successful with the data transfer. Later, Herm
  • HermHerm Posts: 5
    edited 2004-08-17 05:34
    Thanks kabojoe!!· Your·info is the stuff of which dreams are made.· hermanator
  • HermHerm Posts: 5
    edited 2004-08-17 05:37
    Cabojoe:
    Sorry about misspelling your name. Hermanator
  • scribbscribb Posts: 8
    edited 2004-08-17 12:47
    I used this to send raw data from 2 ADCs to a pc and store it in a text file.· Let me know if you need any clarification.

    '{$STAMP BS1}
    HIGH 5
    SYMBOL CS = 0
    SYMBOL CSA = 4
    SYMBOL AD = PIN1
    SYMBOL CLK = 2
    SYMBOL data = B0
    SYMBOL datb = B6
    SYMBOL i = B2
    loop:
    LOW 5
    PAUSE 1
    HIGH 5
    FOR B4 = 0 TO 39
    PAUSE 3000
    GOSUB conv ' Get the data from ADC 1.
    SEROUT 3,N1200,(B0)
    PAUSE 1000
    NEXT
    '************************************************
    FOR B4 = 0 TO 39
    'LOW 5
    'PAUSE 1
    'HIGH 5
    PAUSE 3000
    GOSUB convt···· ' Get the data from ADC 2.
    SEROUT 3,N1200,(B6)
    PAUSE 1000
    NEXT
    SLEEP 3280
    GOTO loop
    conv: LOW CLK···· ' Put clock line in starting state.
    LOW CS
    PULSOUT CLK, 1···· ' 10 us clock pulse.
    LET data = 0···· ' Clear data.
    FOR i = 1 TO 8···· ' Eight data bits.
    LET data = data * 2·· ' Perform shift left.
    PULSOUT CLK, 1···· ' 10 us clock pulse.
    LET data = data + AD·· ' Put bit in LSB of data.
    NEXT
    HIGH CS
    RETURN
    convt: LOW CLK···· ' Put clock line in starting state.
    LOW CSA
    PULSOUT CLK, 1···· ' 10 us clock pulse.
    LET datb = 0···· ' Clear data.
    FOR i = 1 TO 8···· ' Eight data bits.
    LET datb = datb * 2·· ' Perform shift left.
    PULSOUT CLK, 1···· ' 10 us clock pulse.
    LET datb = datb + AD·· ' Put bit in LSB of data.
    NEXT
    HIGH CSA
    RETURN

    ***************************************QBasic:
    DEFINT A-Z
    OPEN "com1:1200,N,8,1,CD0,CS0,DS0,OP0" FOR INPUT AS #1
    OPEN "c:\data.log" FOR OUTPUT AS #2
    CLS
    PRINT "Battery voltage logging (COM1). Press any key to stop."
    PRINT "File is located at c:\data.log"
    PRINT ""
    Again:
    temp$ = INPUT$(1, 1)
    PRINT ASC(temp$); CHR$(9); DATE$; CHR$(9); TIME$
    PRINT #2, ASC(temp$); CHR$(9); DATE$; CHR$(9); TIME$
    IF INKEY$ = "" THEN GOTO Again
    CLOSE
    END
  • HermHerm Posts: 5
    edited 2004-08-19 17:23
    Thanks to scribb for reminding me I can do the job with Qbasic.· I still have the box the QBasic came in, the three reference manuals and the two 5 1/4" floppies I bought long ago.··I use it occasionally.·
Sign In or Register to comment.