Shop OBEX P1 Docs P2 Docs Learn Events
What WORKS?? BS2 and — Parallax Forums

What WORKS?? BS2 and

Terry KingTerry King Posts: 12
edited 2006-02-17 10:32 in BASIC Stamp
I found various discussions about this. Can PARALLAX give us a definitive answer / pointer to HowTo??

There are many attractive devices that connect with 1 wire, such as the DS1820 thermometer from Dallas/Maxim.

BS2 apparently cannot connect to these directly because of timing issues.
BS2p HAS specific One-Wire commands.

I would really like to connect a classroom full of BOE's to the DS1820 and similar devices.

I understand that the Dallas DS2480 is a serial In/Out chip that connects to 1-Wire devices.

I have looked over the DS2480 and the Appnotes. It looks workable.

Has anyone at PARALLAX or these forums actually found a workable solution to 1-Wire with BS2 ??

Promise to post What Works if I get it working!!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards, Terry King ...On The Mediterranean in Carthage, Tunisia, North Africa
American Cooperative School of Tunis
terry@terryking.us

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-16 15:18
    Good questions, and a very interesting One-Wire device.
    I believe that Parallax has an Education Co-ordinator that will want to talk to you more directly and in depth.

    Forgive me for asking one of my own.
    Why do you want to attach a serial in/out device to a BS2 that already has 16 serial I/O pins?

    Having said that, I suspect that the areas of concern are two fold.

    First is that you will have to do quite a bit of code about Serial In and Serial Out in the BS2. I don't know if the memory is up to all of it.· It may be that is not enough as One-Wire depends on detecting transistions on both the leading and the following edge.

    Second is that you may struggle with enough speed.

    The BS2 was built with a PIC microcontroller and Parallax moved on the the SX-Ubicom [noparse][[/noparse]now it is the·SX-Parallax] because the limitations were evident both in terms of speed and memory. Just moving to the new chip doubled the RAM.

    I do know that many of PBasic features for later chips [noparse][[/noparse]like the LCD support] can be done on earlier chips by writing a detailed program.

    So it may be that there never seemed to be a reason to retroactively fit the One-Wire to the BS2.

    Personally, I think ONE-Wire gets a bit too complicated for new learners. There are many good SPI and I2C devices that can do as much. Maybe I am wrong, but I think there are more. After all, you have many vendors versus one proprietry technology.

    Food for thought -·
    Why limit to One-wire?· It seems like you are 'trying to teach music in all one key'.

    Why doesn't Parallax make an up-graded BOE/Homework using an SX chip [noparse][[/noparse]as they now own it] rather than support a competator's product.

    More shall be revealed.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/17/2006 7:44:50 AM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-16 15:32
    I know of one of our customers in Australia who once use the BS2sx and the DS2480 in 1-Wire applications; he ultimately changed to the BS2p to simplify his design and gain other features. The trouble with the DS2480 is that it doesn't come in an experimenter-friendly package.

    Are you absolutely committed to 1-Wire? You can do I2C with a standard BS2 and there are far more parts available using the I2C protocol than the 1-Wire protocol.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Terry KingTerry King Posts: 12
    edited 2006-02-16 20:12
    Thanks for the comments...

    The Stamp 2p has built-in commands specifically for 1-wire devices, and you can work at (or have students work at) a higher level where they send commands to a 1-wire device, and get data back. This fits with what programmers know, and students need to learn, that well-written code is reuseable by others.

    We are aiming at a project to built an Automatic Weather Station. Again, we can buy off-the-shelf finished parts (like the again-available 1-wire-weather-station), but I want students to understand the sensors (Potentiometer for wind direction, Pulse train for wind speed ) and so on. There are lots of temperature solutions, like the DS1620 which is SPI and which works fine with Serout/Serin. But it's a short-range wired protocol. The 1-wire devices have two significant advantages: operation over twisted pair (think CAT5 has conductors for a whole weather station), over a few hundred feet. AND, you can put multiple thermometers on a single pair, because each has a unique address. We want/need that temperature measurement capability.

    We can do this with a BS2p for a final project, or a Dios or another micro, and we likely will. I was trying to put together a class where we could have students write code individually for 3 types of sensors, including 1-wire.

    If the Stamp2 in the BOEs won't do the timing, even thru a DS2480, which offloads the 1-wire timing, then we'll punt and do the project with the temperature stuff as a separate part. I realize I'll have to mount the DS2480's on a DIP platform or on a separate breadboard...

    I'd just like to know if anyone has seriously tried, or failed, to use the DS2480 interface chip on a Stamp2 to talk to a DS1820 thermometer chip. If so, I'll go with their experience.

    Thanks for listening, and I will appreciate any pointers or comments!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards, Terry King ...On The Mediterranean in Carthage, Tunisia, North Africa
    American Cooperative School of Tunis
    terry@terryking.us
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-02-16 22:14
    Terry -

    Just a small correction to your last post. Asynchronous serial communication (RS-232) is done with the SERIN/SEROUT commands on the PBASIC Stamp. Synchronous serial communication (SPI, Microwire, etc) is done using the SHIFTIN/SHIFTOUT commands.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-17 04:40
    Sorry if I wasn't clear, Terry, when using the DS2480 you can do 1-Wire with any non-"p" BS2 module. SERIN and SEROUT provide the interface to the DS2480.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-02-17 07:52
    Terry.
    I didn't realize that one-wire was so useful for long-distance.· It does eliminate the need for two BasicStamps in some cases.

    If you can use a PC as your Base Station and convert a RS-485 to RS-232 for its input, you still have only one Stamp involved.·

    RS-485 driver chips will give you all the distance you need {1000meters} and without having to add +12/-12 volts.

    They are also very cheap compared to the MAX-232 series. And they are very robut in regards to things like a lightning strick.

    It would significantly enhance the students knowledge of twisted-pair transmission too.· Pure digital over twisted-pair is somewhat of a mis-use that slows speed.

    All this while allowing you to work both with more diversity and less expensive chips.

    I am sure you know, the Students have a habit of learning whatever they want to rather than what you think is best for them. I keep running across this everyday with teaching ESL. Sometimes I feel like a mother that cooks a great meal and they just want to eat and run.

    Still being their 'mother' I try to make sure they get enough of the good stuff while keeping their appetite for knowledge intact.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan

    Post Edited (Kramer) : 2/17/2006 7:57:54 AM GMT
  • Terry KingTerry King Posts: 12
    edited 2006-02-17 10:10
    Jon Williams (Parallax) said...
    Sorry if I wasn't clear, Terry, when using the DS2480 you can do 1-Wire with any non-"p" BS2 module. SERIN and SEROUT provide the interface to the DS2480.

    Thanks, Jon, that was what I hoped was the case!

    IsThere and example code around??

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards, Terry King ...On The Mediterranean in Carthage, Tunisia, North Africa
    American Cooperative School of Tunis
    terry@terryking.us
  • Terry KingTerry King Posts: 12
    edited 2006-02-17 10:32
    Kramer said...
    If you can use a PC as your Base Station and convert a RS-485 to RS-232 for its input, you still have only one Stamp involved. RS-485 driver chips will give you all the distance you need {1000meters} and without having to add +12/-12 volts.
    Thanks, Kramer. I hadn't thought of locating the Stamp right at the sensors...

    At this point, I think we can locate the Stamp near a PC inside: A CAT5 cable can supply +5 at small current for the Hall effect switch in the Anemometer, Pulses coming back to be counted, The Wind Direction indicator is a 10 K Pot, with +5, Ground and signal coming back on a CAT5 pair, and +5 to (one or more) DS1820's, with their data pins coming back on another CAT5 pair.

    Dallas makes a specific transient suppressor for 1-wire, which we plan to use. Typical "Phone line" suppressors are used in the
    Wind Energy industry on the Wind Direction indicator.

    OK, I can use this whole thread as an example of "I didn't know how to do this when I started, but I got some good advice, asked the manufacturer for help, looked at some examples of what other people have done, and figured it out". "Now we'll experiment and breadboard this and write some code and debug that, and then we'll make a more permanent circuit board with the interface to the instruments on one side, and the connections to the microcontroller on the other."

    Then we just have to write code to pretend to be a Radio Shack WX200 or something so we can send results to some free complex PC software like FreeWX so we can send weather Emails and update our website...

    So, this becomes part of an introduction to "The Engineering Design Process", which is what I wanted...

    I'll get an order out to Digikey today, and if I get it carefully through the Diplomatic Pouch (Shh...!) it'll pop out here in Africa in about 14 days, and we'll get started.

    Thanks for all the help. This is a great era in which to be Far From Home...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards, Terry King ...On The Mediterranean in Carthage, Tunisia, North Africa
    American Cooperative School of Tunis
    terry@terryking.us
Sign In or Register to comment.