Shop OBEX P1 Docs P2 Docs Learn Events
VTI Pressure sensor Demo — Parallax Forums

VTI Pressure sensor Demo

James LongJames Long Posts: 1,181
edited 2010-03-05 00:49 in Accessories
Ok....I have a gripe....which for Parallax is uncommon.

The source code for the VTI is a bin file.....which the Propeller tool can load, but the code is not available.

I would like to have the code for my own uses.

Would it be possible to get the spin/asm file of the demo?

James L

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer

Lil Brother SMT Assembly Services

Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-10-09 17:05
    James, this should be taken care of by Monday...that was my mistake.· It is not even the correct demo code.· My apologies.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • James LongJames Long Posts: 1,181
    edited 2009-10-09 17:51
    Chris Savage (Parallax) said...
    James, this should be taken care of by Monday...that was my mistake. It is not even the correct demo code. My apologies.

    OK,

    I'll let you slide this time....... smilewinkgrin.gif

    I understand these things happen.......

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-10-09 18:00
    James, thanks for understanding...I have been working on code for four products at once. Somewhere along the way the lines get blurred sometimes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • James LongJames Long Posts: 1,181
    edited 2009-10-09 18:12
    Chris Savage (Parallax) said...
    James, thanks for understanding...I have been working on code for four products at once. Somewhere along the way the lines get blurred sometimes.

    Well...to be honest....I can't gripe too much. I didn't buy my sensor from Parallax.........so I have no room to point fingers.

    I was just going to take a peek at how you guys did the code.

    James L

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer

    Lil Brother SMT Assembly Services

    Please note: Due to economic conditions the light at the end of the tunnel will be turned off until further notice. Thanks for your understanding.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-10-09 19:37
    Nonetheless, it is in error...our example/demo code is always available to our customers in source format. I just have to pay more attention to what package I ask to be published on the web. =)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • phil kennyphil kenny Posts: 233
    edited 2009-10-15 18:20
    I'm in hope when the Parallax demo code is finally released in source format that
    it will also include how to access and display the temperature monitoring feature
    of the VTI SPC1000 and not just the pressure readings.

    Source code for the Basic Stamp would be very desirable as well.

    phil

    Post Edited (phil kenny) : 10/15/2009 6:25:39 PM GMT
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-10-15 21:08
    Phil,

    I just responded in another thread that BASIC Stamp code would be available as well as updated Propeller code. I plan on including the temperature as well. I apologize for not meeting my timeline. I am trying to allocate some time to Propeller objects that need to be done. I am thinking next week will be possible. I will follow up on these threads as soon as I have something though. Rest assured.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • kberckkberck Posts: 10
    edited 2009-10-31 20:33
    Appreciate it Chris, we know they are working you hard! [noparse]:)[/noparse] Thanks in advance!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-11-02 22:52
    Okay, so as an update there were a few hang-ups I hit on the code...These are due to short-comings of my own which I will be addressing with our master programmer. Seems I need to get caught up to date on some stuff. So bear with me while I further my Propeller Education a bit and wrap these objects. The BASIC Stamp code just needs a schematic on the connections since it's a 3.3V --> 5V connection. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • StroudljStroudlj Posts: 2
    edited 2009-11-06 16:45
    Chris, you stated that "The BASIC Stamp code just needs a schematic", does that mean that you have a .pdf for it, just waiting on the schematic or are you saying that all the BASIC Stamp users just need the schematic and not code?

    Not sure if I am comunicating what I am asking... If the .pdf for the BASIC stamp users is complete, could you post a link to it?

    Larry Stroud
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-11-08 07:45
    Larry, sorry for the delay...I have actualy been brushing up on some SPIN and PASM myself recently. We have BASIC Stamp code, but you cannot connect the sensor directly to the BASIC Stamp as it is 3.3V and the BASIC Stamp module is a 5V device. I have been working on a schematic that will use readily accessible parts that the average customer can use for the interface so they don't need a specialized interface IC. I will have something soon. Right now I want to wrap the SPIN code but I needed to get caught up as I have been working on so much hardware I haven't really done much programming in a while and found myself a little rusty. =) It happens to the best of us.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Engineering
    50 72 6F 6A 65 63 74 20 53 69 74 65
    ·
  • JaimeJaime Posts: 16
    edited 2010-01-26 01:44
    Chris: I am also very interested in the code to interface this sensor with the Basic Stamp2. If you· have an advance with the code that you could post would be very useful, in the meanwhile I could find out how to develop the hardware to connect the components. If you have something pass it on.. I understand the hard·work you have been doing on it.. Thanks a lot Chris..·
  • WildatheartWildatheart Posts: 195
    edited 2010-01-26 04:24
    Chris, I too would like to have your proposed interface diagrams for the BS2 as well as the experimental source code. I'm interested in using the sensor to monitor the cabin pressure of my submersible.
  • JDJD Posts: 570
    edited 2010-01-28 01:25
    Wildatheart,

    My apologies, it turns out the firmware for that module is not available to the public; so only the binary files can be used

    I hope this helps,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com

    Post Edited (Joshua Donelson (Parallax)) : 1/29/2010 7:42:53 PM GMT
  • Sal AmmoniacSal Ammoniac Posts: 213
    edited 2010-02-01 21:11
    Here's some Spin code that reads the sensor temperature and pressure information in a loop:

    '' SCP1000 Driver
    ''
    '' Pin assignments (relative to 'Pin' parameter passed to SCPInit):
    ''
    ''      0   SCK  (output)
    ''      1   MOSI (output)
    ''      2   MISO (input)
    ''      3   CSB  (output)
    ''      4   DRDY (input)
    ''
    ''
    
    CON
    
      SCK = 0                                               ' Clock
      MOSI = 1                                              ' Master Out, Slave In
      MISO = 2                                              ' Master In, Slave Out
      CSB = 3                                               ' Chip Select
      DRDY = 4                                              ' Device Ready
    
    
      AltCor = 1920                                         ' sealevel altitude correction (in mb * 100)                        
    
    
    VAR
    
      long Pin
      long status
      long rawtemperature, pressureH, pressureL
      long Temperature, Pressure
      long Stack[noparse][[/noparse]64]
      byte Cog
    
    
    
    PUB Start(PinStart) : okay
    
      Stop
      okay := (Cog := cognew(SCPInit(PinStart), @Stack) + 1)
    
    PUB Stop
    
      if Cog
        cogstop(Cog~ - 1)
    
    PUB Active : YesNo
    
      YesNo := Cog > 0
    
      
    PUB SCPInit(PinStart)
    
      waitcnt(clkfreq/10 + cnt)                             ' wait 100 msec for SCP1000 to initialize
      Pin := PinStart                                       ' save starting port pin number
    
      dira[noparse][[/noparse]PinStart..(PinStart+DRDY)] := %11010               ' set port direction bits
    
      CSB_HI                                                ' set CSB high (inactive)
      SCK_LO                                                ' set SCK low
    
      SCPWriteRegister($3, $a)                              ' select high-precision mode
      SCPReadRegister8($1f)                                 ' dummy read of pressure register to clear DRDY
      SCPReadRegister16($20)
    
      SCPLoop                                               ' kick off processing
    
    
    PUB SCPLoop | TempC, TempF
    
    
      repeat
        waitpeq(|< (Pin+DRDY), |< (Pin+DRDY), 0)            ' wait for DRDY to go high
        status := SCPReadRegister8($7)                      ' read status register
    
        rawtemperature := SCPReadRegister16($21)            ' read temperature register
        pressureH := SCPReadRegister8($1f)                  ' read pressure register (high bits)
        pressureH &= $7                                     ' only lower 3 bits are significant
        pressureL := SCPReadRegister16($20)                 ' read lower bits of pressure
        pressureL := (pressureH << 16) | pressureL          ' merge pressure halves
       
        TempC := rawtemperature * 10 / 2                    ' compute temperature in °C x 100
        TempF := TempC * 9 / 5 + 3200
     
        pressureL /= 4                                      ' convert raw pressure to mb x 100
        pressureL += AltCor
        
        Temperature := TempF
        Pressure := pressureL
    
    
    PUB SCPTemp
    
      result := Temperature
    
    PUB SCPPressure
    
      result := Pressure
    
      
    PRI CSB_HI
      outa[noparse][[/noparse]Pin+CSB]~~                                       ' set CSB high (inactive)
    
    PRI CSB_LO
      outa[noparse][[/noparse]Pin+CSB]~                                        ' set CSB low (active)
    
    PRI SCK_HI
      outa[noparse][[/noparse]Pin+SCK]~~                                       ' set SCK high
    
    PRI SCK_LO
      outa[noparse][[/noparse]Pin+SCK]~                                        ' set SCK low
    
    
    PRI SCPWriteRegister(reg, value)
      reg <<= 2
      reg |= $2                                             ' set bit to indicate write
    
      CSB_LO                                                ' set CSB to enable sensor
      SCPSend(reg)                                          ' write register address
      SCPSend(value)                                        ' write register value
      CSB_HI                                                ' disbale chip select
    
    
    PRI SCPSend(value) : rbyte | tmp, i
      tmp := value >< 8                                     ' reverse order of bits
      repeat i from 0 to 7
        SCK_LO                                              ' set SCK low
        outa[noparse][[/noparse]Pin+MOSI] := tmp & 1                           ' write bit out to sensor
        tmp >>= 1
        SCK_HI                                              ' set SCK high    
        rbyte := (rbyte << 1) | ina[noparse][[/noparse]Pin+MISO]               ' accumulate incoming data
    
      SCK_LO                                                ' lower SCK
    
    
    PRI SCPReadRegister8(reg) : rbyte
      reg <<= 2
      reg &= $fc                                            ' clear lower two bits to indicate read command
    
      CSB_LO                                                ' enable sensor
      rbyte := SCPSend(reg)                                 ' send register address to sensor
      rbyte := SCPSend(0)                                   ' write dummy byte to allow sensor to respond with 8 bits of data
      CSB_HI                                                ' disable chip select 
    
    
    PRI SCPReadRegister16(reg) : rword | wordH, wordL
      reg <<= 2
      reg &= $fc                                            ' clear lower two bits to indicate read command
    
      CSB_LO                                                ' enable sensor
      wordH := SCPSend(reg)                                 ' send register address to sensor (and ignore return value)
      wordH := SCPSend(0)                                   ' write dummy byte to allow sensor to respond with 8 bits of data (MSB)
      wordL := SCPSend(0)                                   ' write dummy byte to allow sensor to respond with 8 bits of data (LSB)
      CSB_HI
      rword := (wordH << 8) | wordL                          ' return 16 bit result         
    
    
  • JDJD Posts: 570
    edited 2010-02-03 20:20
    Thank you Sal

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • JaimeJaime Posts: 16
    edited 2010-03-04 22:54
    Do any of you guys, know if there is some code example of how to interface the VTI SCP 1000 sensor to the BS2 (basic Stamp)? Your feed back will be greately appreciated.

    Best Regards

    Jaime... microwaveteach@hotmail.com
  • hover1hover1 Posts: 1,929
    edited 2010-03-05 00:49
    Yup, It's long over due.
Sign In or Register to comment.