Shop OBEX P1 Docs P2 Docs Learn Events
ASDX Series Pressure Transducer — Parallax Forums

ASDX Series Pressure Transducer

jbirdmanjbirdman Posts: 9
edited 2011-08-26 21:43 in Propeller 1
I have a Honeywell ASDXRR001PD2A5 (quite the mouthful for just a cheap little pressure transducer) that I'm trying to get to talk to my propeller. Problem is, I can't seem to read data from it. I can't find any reference to internal registers in it's documentation (http://sensing.honeywell.com/index.cfm/ci_id/155937/la_id/1/document/1/re_id/0) so I was trying the method suggested here (http://forums.parallax.com/showthread.php?106998-How-to-use-I2C-without-a-register-address-and-read-sequential-FIFO) combined with what few random thoughts I had after reading about the i2c protocol (basically it turned out to be trial and error). In the end, here's what I've ended up with (I'm using the Basic_I2C_Driver):
i2c.Initialize(23)
  repeat 1
    waitcnt(cnt+clkfreq)
    i2c.Start(23)
    Debug.str(string(10,"--------"))
    temp := i2c.Write(23,$51)
    Debug.str(string(10))
    Debug.bin(temp,8)
    repeat 5
      waitcnt(cnt+clkfreq)
      pressure := i2c.Read(23,1)
      Debug.str(string(10))
      Debug.bin(pressure,8)
    pressure := i2c.Read(23,0)
    Debug.str(string(10))
    Debug.bin(pressure,8)
    'Debug.dec(counter)
    i2c.Stop(23)

I get a %0 acknowledging the first write to the device address, and then %0 when attempting to read the data on it. I've been fighting this thing for a few days now and I'm pretty much at my wits end (though admittedly I'm still in a nearly vertical part of the microcontroller learning curve) so any help would be appreciated.

Thanks,

~Bird

Comments

  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-06-08 08:40
    It's too bad that data sheet doesn't show the I2C exchange.

    [Edit] After doing a bit of research (I have a need for a pressure sensor so this interests me) I found that the exchange is not standard, that is, it doesn't work quite the same as other devices. Other programmers suggest this is the exchange (edited for Honeywell 7-bit addresses).
    pub get_pressure(slaveid) : pressure
    
      i2c.start
      i2c.write((slaveid << 1) | 1)
      pressure := i2c.read(i2c#ACK)
      pressure := (pressure << 8) | i2c.read(i2c#NAK)
      i2c.stop
    

    Putting it into a method (as above) allows you to isolate that code from your application, as well as adjust the value returned for the scale of the component you're using.

    Note: I have my own I2C routines that are very simple (clean); I've attached in case you want to give them a try.
  • jbirdmanjbirdman Posts: 9
    edited 2011-06-08 16:29
    Thanks for the reply, but I'm still having trouble. Trying that exchange with both your routine and the one I was using before just returns zeros from the sensor (just for kicks I disconnected the sensor and ran it - same return). Here's what I've got now.
    temp := i2c.init(24, 23)
      repeat 5
        waitcnt(cnt+clkfreq)
        temp := get_pressure($28)
    

    Where 24 is SCL, 23 is SDA, and get_pressure looks like this:
    PUB get_pressure(slaveid) | pressure
      i2c.start
      i2c.write(slaveid | 1)
      pressure := i2c.read(i2c#ACK)
      pressure := (pressure << 8) | i2c.read(i2c#NAK)
      i2c.stop
    

    Any ideas what I could be doing wrong? I'm pretty sure I've got the thing wired right, I'm 99+% sure the pins are right and I have 10Kohm resistors between 5V and both SCL and SDA.
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-06-08 18:01
    The datasheet you provided a link to does not explain the I2C exchange. If you can find that in documentation it should be very easy to sort out; I2C is one of the easier protocols to implement.
  • jbirdmanjbirdman Posts: 9
    edited 2011-06-09 17:03
    I emailed Honeywell and got a data sheet from them. I think I had an error in the device address - instead of
    i2c.write(slaveid | 1)
    
    now I use
    i2c.write(slaveid << 1 | 1)
    
    and now I can get an ack from the device when I send it the initial write statement. Reading data still continues to baffle me, I just get a sequence of zeros off of it. I thought maybe I just didn't have a measurable pressure (it is a differential sensor, but applying a pressure didn't help) I tried the full four-byte read and couldn't even get the temperature data. So, progress - but incremental and still frustrating progress.

    Honeywell's i2c explanation attached.I2C Application Note 7-20-09[1].pdf
  • JonnyMacJonnyMac Posts: 9,208
    edited 2011-06-09 18:39
    Other than the correction for the 7-bit address provided by Honeywell, the code above is correct as far as order of bytes and the sequence. If you compare the method I wrote to their 2-byte read diagram you'll see that it's a match. Hmmm.....

    Where can I get one of these sensors? I'm interested.
  • pgbpsupgbpsu Posts: 460
    edited 2011-06-10 06:51
    JonnyMac-

    I too am interested in these devices. I used the honewyell site inventory search to find this:

    http://www.newark.com/honeywell-s-c/asdxrrx030pdaa5/silicon-pressure-sensor/dp/34R2769?CMP=AFC-HEARST

    $30 each for the +/- 30psi differential I2C version.

    p
  • magdropmagdrop Posts: 13
    edited 2011-06-10 07:30
    We had problems talking to these Honeywell devices.

    Page 5 of the datasheet shows that it is looking for a 4.5V logic high, so we had to put a very hard pullup on the I2C lines.
  • jbirdmanjbirdman Posts: 9
    edited 2011-06-10 17:52
    Hmm, well I'd say then that the problem probably rests in the idiot plugging things into the breadboard...

    How hard of a pull-up did y'all have to use? After rereading the specsheet I noticed that they recommend 1k pull-ups so now I have 1k pull-ups going to my 5V source...still just an ack is all I get from it....maybe I let the magic smoke out when I was fiddling with it or something.

    Anyway I got mine at mouser, looks like it'd be a nice little sensor if I could ever get it talking to me...I think it has been superseded now by the ASDX-DO though.
  • jbirdmanjbirdman Posts: 9
    edited 2011-06-13 19:16
    Well I never did figure out what the issue was, but in the process of getting a compass working I ended up getting the transducer working as well. I've attached the code in case anyone else has one and wants it, it's a modification of the parallax HMC6352 magnetic compass code. It only reads in the two-byte pressure data right now, but reading in the other two bytes would be easy enough to change.


    ~Bird

    ASDX.spin
  • master1master1 Posts: 1
    edited 2011-07-06 10:25
    Hi Jbirdman, I was wondering what is your clock rate? I could not comunicate with the device
  • jbirdmanjbirdman Posts: 9
    edited 2011-08-26 20:21
    Sorry for the (very) delayed reply.

    I'm not experienced enough with the propeller/microcontrollers in general to know exactly what you are asking. The clock rate I was running the propeller at was the full 80MHz if that answers your question.
  • kwinnkwinn Posts: 8,697
    edited 2011-08-26 21:43
    I think master1 is asking about the I2C clock rate. After reading the thread it sounds like it may have been a timing issue that was solved by the addition of the compass code.
Sign In or Register to comment.