Shop OBEX P1 Docs P2 Docs Learn Events
New to the BS2p24 - one wire woes. — Parallax Forums

New to the BS2p24 - one wire woes.

pwillardpwillard Posts: 321
edited 2009-06-19 15:56 in BASIC Stamp
I'm looking for some guidance.

I have a part labeled DS1820. I've tried the code from the BS2P section of the BASIC STAMP EDITOR for owin owout examples... and I just get:


DS1822
10 C
50 F

No matter what.



I've verified that the Stamp finds the ROM ID with other methods (code samples from the forums) and the BS2p24 gets the right ID: 10 A5 C5 54 01 08 00 B7, but looking at the scratchpad after a temperature conversion command always returns the following 16 BIT values LSbyte: FF MSByte: 00. ALWAYS.

I'm stumped... Ive tried lots of code from the forums that seems to work for others... and I've tried multiple DS1820's. I know they work because they are fine in my weather station. I'm not going to trudge off to write my own code from scratch till I see it work once... make sense?

The BS2P24 just doesn't like my devices?

They are parasitic (DQ has a 4.7K resistor to STAMP Vdd and the GND and Vdd pins are tied together to enable parasitic mode on the sensor)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


There's nothing like a new idea and a warm soldering iron.

Comments

  • dandreaedandreae Posts: 1,375
    edited 2009-06-18 13:42
    Can you attach a couple of close-up pictures of your circuit?

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • pwillardpwillard Posts: 321
    edited 2009-06-18 17:38
    I'll need to take a picture and follow up, but here is how it's hooked up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.
    415 x 371 - 13K
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-06-18 18:19
    Are you sure the Stamp supports parasite power mode? I don't think so, but it would not be out of the question. In parasite power mode, the microprocessor has to switch to strong pullup within 10 microseconds of issuing the commands to convert the temperature or to write to the eeprom.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • pwillardpwillard Posts: 321
    edited 2009-06-18 18:42
    Whoa... Ok. I just assumed it supported parasite mode. That's a quick test I can do to see if it's the root cause.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.
  • Shawn LoweShawn Lowe Posts: 635
    edited 2009-06-18 19:37
    I did look at some documentation on one-wire on the p series. It didn't state it couldn't, but it didn't state it could either. Maybe someone from parallax can chime in?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-18 19:46
    If the Stamp does not support it, here's a circuit that might help:

    attachment.php?attachmentid=61653

    It relies on infrequent polling of the device and stores energy in the cap while the I/O line is pulled high. When the line is low, the diode blocks, keeping the cap from draining into the I/O line. The cap will have to be big enough to provide adequate hold-up time while the device is drawing its active current. This needs to be offset by the required charge time through the pullup resistor. A slightly stiffer pullup at the Stamp end may help in this regard.

    -Phil
    200 x 140 - 873B
  • pwillardpwillard Posts: 321
    edited 2009-06-19 01:45
    I like it. Thanks Phil.

    Ultimately, I plan to use the STAMP with my Dallas 1-wire weather unit, so if this modification works... it would make moving forward easier with the rest of the devices.

    I thought the 1-wire bus stays high with no data... data pulls it low... so if I DON'T write... it will charge the cap...right?

    ...or do I understand that wrong?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.

    Post Edited (pwillard) : 6/19/2009 1:51:51 AM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-06-19 02:07
    pwillard said...
    so if I DON'T write... it will charge the cap...right?
    Right.

    -Phil
  • YoshtiYoshti Posts: 108
    edited 2009-06-19 02:47
    Sorry newbie here,
    But a while ago I was trying to get the sensor connected to a BS2, and after posting and searching I found this:
    http://www.beescollc.com/MBENZ/MBSENSOR.htm

    At the bottom of the page there is a link for his design. Got in contact with the gentlemen and sure enough, I need better than a BS2 (soon to purchase a BS2P)
    and a 1 wire won't work.

    Just to let you know !

    Cheers
  • pwillardpwillard Posts: 321
    edited 2009-06-19 15:56
    Yes, I have the right device... my tests have just been flawed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.
Sign In or Register to comment.