Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Understanding serialclock

  1. Dec 22, 2005 #1
    http://www.sensiron.com/images/getFile?id=25
    I am reading the following datasheet for a humidity sensor. But what I don't understand is how to "lower the data line while SCK is high, then following a low pulse on SCK and raising DATA again while SCK is still high"
    SCK=serial CLock
    where can i read how a serial clock works?
    I am suppose to write a program for it, but i haven't taken any EE classes yet. :\
    any help is appreciated.
     
  2. jcsd
  3. Dec 22, 2005 #2

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    What you're describing is a two-wire interface called "I2C", or Inter-IC Communication. It's a standard, and was developed by Philips. The specification is not long, and is available on Philips' website. The following document is a little shorter than the spec, and will also answer any questions you might have:

    http://www.mcc-us.com/i2cHowToUseIt1995.pdf

    I can also answer any specific questions you might have about the interface.

    - Warren
     
  4. Dec 22, 2005 #3

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I should add that your assignment sounds like it might be fairly simple: the interface consists of two wires, one called SCK (serial clock) and one called SDA (serial data). To "lower" a wire is to drive it to a voltage near zero. A wire that is "high" is carrying a greater voltage, usually 2.5V, 3.3V, or 5V.

    - Warren
     
  5. Dec 22, 2005 #4
    in page2 of the humidity sensor pdf it states on the bottom:
    The serial interface of the SHTxx is optimized for sensor readout and power consumption and is not compatible with I2C interfaces, see FAQ for details.
     
  6. Dec 22, 2005 #5

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Okay, so it's not I2C, it's something else. It does, however, sound similar. "Lowering SDA while SCK remains high," in fact, is how one starts a transaction on an I2C bus.

    I'm still not sure exactly what sort of help you need. Can you clarify?

    - Warren
     
  7. Dec 22, 2005 #6
    Well, the lower of the sck stuff. Is this done physically? meaning, via a breadboard or some electronics? If so, where can i read on this? I apologize for not being clear.
     
  8. Dec 22, 2005 #7

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    You connect two integrated circuits together. Perhaps your sensor will be read by a microcontroller (a small standalone processor). The microcontroller will have output drivers that can drive the SCK wire either high or low, at the request of a program. You write your program to control those output drivers in the proper fashion.

    - Warren
     
  9. Dec 22, 2005 #8

    berkeman

    User Avatar

    Staff: Mentor

    What language are you writing in, and for what target processor? Are you writing for a particular microcontroller?

    From the specs, it looks like you will need to bit-bang two lines with your uC. Your uC code needs to take care of driving the two IO lines to create the waveforms for SCK and DATA, and also take care of tri-stating the DATA line when you are supposed to be reading data back in from the transducer. Your program writes data to the IO port where you've mapped SCK and DATA, in order to make the waveforms shown in Figure 5 of the datasheet.
     
  10. Dec 22, 2005 #9
    I plan on testing the humidity sensor using labview code. Platform? regular pc to test it out.
     
  11. Dec 22, 2005 #10

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    georgeh,

    But you haven't specified how you're going to connect your sensor to your PC. That seems to be the critical piece of the puzzle you're missing.

    - Warren
     
  12. Dec 22, 2005 #11

    berkeman

    User Avatar

    Staff: Mentor

    Agreed. Are you going to use a DIO card? Which one? What language are you going to be writing the code in? Labview CVI? I'm pretty sure that you will need to overlay an input with an output to get your bidir DATA signal, and I'm not even sure that you can tri-state a DIO output easily on the fly...
     
  13. Dec 22, 2005 #12

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    If I were doing it, I'd use a Cypress EZ-USB microcontroller to connect it via USB to my PC. But that's just me.

    - Warren
     
  14. Dec 22, 2005 #13

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    For the purposes of this low-speed project, however, you could also use your PC's parallel port, or perhaps, with some clever coding, one of its serial ports.

    - Warren
     
  15. Jan 6, 2006 #14
    Allright, so I got the details now. i am using a Ni-DAQ 6033-E card on a pc
    hooked up to a connector block. I plan on using labview 8.0 and g code to make to test the sensor out.
     
  16. Jan 6, 2006 #15

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I sure hope you didn't pay for that NI card yourself! I have little experience with LabView though, so I cannot help you with your program. I can help you with the digital logic, however, if you need more help.

    - Warren
     
  17. Jun 13, 2006 #16
    I wrote some LabView 8 code to communicate with the SHT15 with an NI USB-6008 DAQ device. I use the digital I/O lines. One line as SCK, two lines for DATA (one for writing, one for reading, both connected to the DATA line of SHTxx)
    I used the sample code for microcontroller written in C (found on the website of Sensirion) to write the LabView driver. In the llb-file is a main.vi and main2.vi as a sample program.
    The in the SubVi "DAQ_initialize.vi" you must change the "lines" to the lines you use in your DAQ-card (in the block diagram).
    You need DAQmx from NI for your DAQ-card, but i think you use it already.
    The maximum read-out rate with my DAQ-device is about every 660ms.
    I hope i can help you.

    *****RENAME the SHTxx_driver.m to SHTxx_driver.rar*******

    Tessar :smile:
     

    Attached Files:

    Last edited: Jun 13, 2006
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Understanding serialclock
  1. Not understand (Replies: 5)

  2. MOSFET understanding (Replies: 1)

  3. Unable to understand (Replies: 4)

Loading...