I2C timing Problem

I am implementing an I2C protocol on labview fpga. I am using cRio 9074 and digital I/O module 9401 for this purpose. Since SDA line is a bidirectional line, I am using a method node to set line directions and the node is taking around 100 us to get executed (as per below code in the figure).
I wanted the SCL speed to be 100 kHz, i.e 10 us cycle time for one bit tranfer. So how do I do it when this, when the method node is taking so much of time (nearly 10 times).
Attachments:
Picture 1.png ‏6 KB
Picture 2.PNG ‏2 KB

This is my code if it could help figure out what i needed. This code is for reading values from three devices simultanously (an accelemeter, gyro and magnetometer) using I2C protocol. 
Please check the code and help me figure out how to access element faster. The main mess is with the "set line direction" method node, which is taking long time to execute and stoping me to have a i2c speed of 100 kHz or 400 kHz.
Awaiting for a prompt response.
Thanks & Kudos in advance
Attachments:
I2C.zip ‏479 KB

Similar Messages

  • Can anyone help me with Labview/GPIB timing problems?

    I am trying to use a very simple VI (downloaded from the NI site) to control a Newport 1830C optical power meter.
    I have been spending most of my time trying to use the VI issue a command to read the current displayed power. When I run the VI normally, I get no response from the meter, and the VI simply terminates without any error message. (The "remote" indicator does light on the meter, though, so it seems to be receieving the command.)
    However, when I run the VI in the "highlight exectution" mode, everything seems to work just fine, and I receive a correct reading from the meter! Needles to say, this makes it really hard to debug the problem.
    My guess is that I have some kind of timing problem, and t
    he "highlight execution" feature fixes it by introducing delays. Is this correct? If so, how can I achieve the same thing by putting in delays by hand?
    thanks, Whitney White

    Whitney,
    I agree that this is very likely to be a timing issue. VIs run much slower in highlight execution mode, therefore your instrument may need more time to prepare the data you have requested. Try wiring a delay inline prior to the GPIB reads and/or writes, or try using Service Requests (SRQs) to give the instrument enough time to generate the data it needs to send back to the computer.
    Another possibility is that your instrument may not be IEEE 488 compliant. Some older instruments indicate that they are ready to receive data before they really are. Try changing the GPIB bus timing to the slowest setting (in the GPIB Configuration Utility). This only affects the time that the GPIB controller waits before valid data is on the bus and the DAV line i
    s asserted (a step in the GPIB handshaking that occurs each time a byte of information is sent to the device) so this may not be effective.
    Lastly, you may wish to try the instrument driver for your instrument. There is a contributed driver at this location: LabVIEW Traditional Instrument Driver: Newport Optical Power Meter 1830C. A 'contributed driver' means that someone outside of National Instruments wrote the driver and then submitted it for posting. This driver also contains a good example of adding a time out.
    Regards,
    Heather S.
    Applications Engineer
    National Instruments

  • Timing problems with AU Ivory Piano + ESB and Logic 7.2

    I have problems with Ivory and Logic 7.2:
    The Ivory (AU version 1.50) plays well in tempo, but when I want to bounce (export track as audio file) the Ivory plays totally out of tempo.
    Even when I touch the record button on audio tracks or when I want to record my mix on 2 audiotracks, the Ivory plays out of tempo.
    Even freezing the Ivory track gives the same problem.
    Then I need to go back to my last saved version.
    The same actions with Emagic, Native Instruments and Spectrasonics AU plugins, and everything works fine.
    I throwed away already the Ivory prefs, no positive results.
    My Ivory sample files are on a separate 400 GB internal disk, and my Audio I'm recording on a external Glyph disk.
    I think I have this problem since I've upgraded from Logic 7.1.1 to 7.2 but I'm not sure. I didn't worked long with Logic 7.1.1.
    I don't work in Protools, but I use the DAE and Direct TDM (no Core Audio)
    It happens in the most simple application: no DAE or AU plug-ins, only one Ivory AU plug-in.
    This is my configuration:
    Ivory AU (Audio object-Direct TDM-Instr) output ESB 1-2 -> input ESB1 2 (Audio Object-DAE) -> Output 1-2 of my digidesign interfaces
    Ivory becomes totally unusable for me this way. Is someone having the same problems?
    Suggestions?
    Wim Claes
    Setup
    Logic 7.2
    Protools 7.1cs4
    192, 2x96i, 1x 96 interface
    G5 dual 2,7   Mac OS X (10.4.3)   4 GB RAM

    I tried already a lot of things, but it is very clear:
    1. Instantiating Ivory as AU- Ivory plays in tempo
    2. Record enable an audio track in the arrange window - Ivory plays out of tempo
    This happens with the default song of logic, no other plugins or AU-instruments are instanciated.
    I can not find a way to convert my Ivory-midi to audio without the timing problems;
    Bouncing, freezing, record to audio, export as audio file: all those things result in timing problems.
    I tried this all with emagic plugins (ES2...) and Native Instruments plugins and then I don't have the tempo problem

  • [Q] Refreshing/Timing problem 21:9-monitor

    Hi fellas!
    I'm using a Macbook Pro 15" non-retina (Windwith GT-650Mtogether with my AOC q2963pm 21:9 monitor through HDMI. What I have encountered is what I think is a timing-problem. I cannot find the settings which works perfect.
    Either, the screen looks a bit grainy at the max resolution of 2560x1080 with the games working (this with Atomatic timing in NVIDIA settings),
    or I have a crispy display, but the games ends with a flimmering and black screen after I quit or Alt+Tab out of a fullscreen-game which causes the NVIDIA-driver to stop responding and restarting (using CVT Reduced Blank).
    I had to create a custom resolution in order to use the full 2560x1080 resolution instead of just 1920x1080. I tried to manually create something that should meet the requirements, but with no luck. Either, the display goes black, or I get the same problems as listed above.
    Here are the specs of the screen:
    Resolution: 2560x1080 @ 60Hz
    Scanning Frequency: H: 30-99 KHz / V: 50-76 Hz
    Pixel Frequency: 185.58 MHz
    Does someone know which settings I should use? The only thing I can think of to fix this is buying a Displayport-cable as "no one" ohters is experiencing this issue. Will this easy solution fix it?

    Try the Thunderbolt connection.
    <http://store.apple.com/us/product/MD861ZM/A/apple-thunderbolt-cable-20-m>

  • I2C Library Timing Problem

    I'm trying to create a module using the I2C Digital Waveform Reference Library:  http://zone.ni.com/devzone/cda/epd/p/id/6080
    The trouble I'm running into is programming the timing into the Init VI.  The timings I define in the input cluster from a particular IC's datasheet don't seem to hold; the coerced timings cluster shows all 0 for each timing value.  Has anyone gotten this to work?

    Hi Jeanius -
    1: You're right about the 6224: it can't tri-state its buffers in a single period of the sample clock, so it can't be used with the IDW in its native form. Changing the 'Z' states to '1' in the IDW waveform will make the waveform compatible with DAQmx devices, but remember that I2C is an open-drain bus and isn't designed for active-drive outputs. If you attempt to receive data from your slave device, you won't be able to see the message returned by the slave because your 6224 will be driving a '1' onto the bus instead of a Z. Likewise, you won't be able to address multiple slaves or listen for ACK/NACK conditions returned by the slaves. You'll essentially be "blind" as the bus master.
    2: Replacing the 'Z' bits in the IDW waveform after it's been generated is a slow and inefficient process. It's better to directly modify your copy of the IDW library instead, so it creates waveforms with '1" as the high state. Given the caveat I mentioned above, here's how to do it: Open each of the following VIs on your IDW palette and replace every instance of the constant 'Z' that you see with a '1'. (You can just click on the Digital Values Ring constant and select 1 from the menu.)
    - Add Start Condition.vi
    - Add Addr Byte.vi
    - Add Clocked Bit.vi
    - Add Stop Condition.vi
    - Interpret Data.vi
    Here's an example from Interpret Data.vi:
    I should also mention that I would have responded sooner to your question, but I don't actively monitor posts on this topic outside the IDW, SDW, and JDW forums. If you have any more questions about using the IDW, post in the forum that Misha linked above and I'll get a notification of your post. This guarantees you a timely reponse from me or someone else who knows the topic.
    Message Edited by David S. on 07-20-2009 10:01 AM
    David Staab, CLA
    Staff Systems Engineer
    National Instruments

  • Enhance Timing Problem

    Anyone notice that when Enhance Timing is applied to an audio track, that track takes a couple of seconds to start playback? I'm sure it has to do with the time it takes for the real-time processing to kick in, but it's a problem when trying to export the song to disk and that track doesn't start right away...

    That didn't seem to work. I locked the bass track, but there's still a pause before that track starts when I play the song from the start.

  • Possible memory timing problem

    Hello, I hope you all can help me.  I have been wrestling with this problem for about two weeks and have not been able to fix it.
    I recently upgraded my system by adding another gig of memory, setting up a raid array, and adding a X-fi Extreme Music card.  Before the upgrade my system ran smoothly for about 10 months.  After the upgrade it randomly freezes - the system locks up and won't take any more input from the mouse or keyboard.  The only way to recover is to hold the power button down for a few seconds.  After that it boots normally and runs perfectly until the next freeze.  The freeze can happen at any time, in any application, while the system is idle, or even during bootup.  I thought for a long time it was the sound card, but now I suspect my memory timings are off.  The problem is, I can't figure out how to adjust them in the BIOS.
    My system is this:
    CPU: AMD Athalon 64 3500+
    Motherboard: K8N Neo2 - Bios 1.B
    Memory: 4 sticks of Corair Value Select PC 3200 DDR-400 - 512 meg each
    Video: ATI Radon X800 Pro
    HD: 2X 74gig Raptors in a raid array (striping)
    The only PCI card is the soundcard: Creative X-Fi Extreme Music
    Power: Antec Neo Power 480
    OS: Windows XP, SP2
    I think that's everything, if I am missing something, please let me know.  I have run Microsoft's memory test utility overnight, and it has checked out.  The memory timing should be 3-3-3-8, but I can't figure out how to set that in the Bios.  Also, is there a change I should be making for going from two sticks to four?  I don't overclock or anything.
    I have been trying to figure this out on my own, but I am coming up short.  Any help would be appreciated.
    Thanks in advance
    Claudius

    Hi Claudius.  Welcome to the forum.  Here are a few tips that will make it easier for you to get help here.  Create a sig as described in the forum rules (hint-use profile button in sign-on screen) which will locate all the info about your system in a convenient place at the bottom of each post like I have.  It's the same info about your system that you posted in your first post, but having it there in each post makes everyone's life easier.  Also indicate whether you have AMD Venice 3500+ (which I think you have).
    Timings terminology.  It gets confusing because memory specs are listed in different orders when people refer to them, in bios and in post screen.  First number should be cas latency (Tcl). Then Ras# to Cas# delay (Trcd). Then Row Precharge Time (Trp). Min Ras# Active time (Tras) is last number although post screen puts it next to last.
    Tcl-cas=3
    Trcd=3
    Trp=3
    Tras=8
    That's what bios using serial prescence detect (SPD) should pick up under auto for your ram.  I doubt bios detected and used Tras 3 like you thought as it would not boot with Tras 3.
    Get CPU-Z online for a great tool that gives you a lot of memory info.  It shows a lot of info about your chip too.  I suspect timings were detected properly or else your machine would not have booted and run.
    After you added more identical memory (corsair value select) your machine apparently booted and ran with 2 gigs of ram, at least that is what appears from your post.  Microsoft's memory test said things are good.  (Don't know what that test is, and if you really want to test it you should use Memtest available online to make a bootable floppy and test memory for about 1 hour.)  However, it sounds like your memory is ok and you have some kind of sound card interrupt (IRQ conflict).  Did you disable on board sound in bios since you are using a sound card?  Try that if you can.  If you still get lockups with onboard sound disabled and sound card working, try removing sound card and seeing whether system still locks up.
    Good luck.
    Edit-  In re-reading your post, it may be that system detected Tras 7 instead of Tras 8.  You can manually set tras 8 in the bios if you want to, but use CPU-Z first and check CPU-Z memory tab (to see what system is using) and CPU-Z SPD tab (to see what your ram is telling your system to use).  I think you will find both are 3,3,3,8.  If not, you can always change Tras to 8 in bios and leave everything else on auto.  However, you could also change dramm voltage for memory in bios to 2.7 volts without doing anything any harm and this could help memory if you are really having a memory (as opposed to IRQ conflict) problem.

  • Labview timing problem

    I'm kind of stuck with a bit a problem in Labview 7 (base ed.). I've got a PCI-6036E that can sample at 200KS/s with a 24bit onboard timer.
    I've got to set up an experiment that monitors a current indirectly through a potentiostat (1A = 1V scale). The program needs to integrate the current/voltage with respect to time until it reaches a specific value and then tells the program to generate an analogue signal output (this will over and over)
    Surely it should be quite straight forward to read a voltage on one of the inputs, summing this value in a loop until this limit is reached, then outputting a voltage.
    The problem is I'm not quite sure how to approach this considering that I need a time interval of the loop to be ~1-10 microseconds.
    Many thanks,
    Paul

    The only way you're going to get microsecond loop speeds is to move up to the new FPGA board, currently only available for PXI.
    Under Windows, or any GUI OS for that matter, loop speeds and determinism get shaky in the double digit milli-second rates, and anything less than 10 mS is really not reliable. LabVIEW Real Time can get much better loop timing, but you're still limited to the milli-second rate as the CPU can't process any faster than that.
    Anything running on the FPGA is running in hardware and extremely fast and deterministic loop times are possible. I�ve run them in the nano-second range just doing some testing. Data from applications running on the FPGA can be accessed from La
    bVIEW Real Time, LabVIEW or both so you can control what�s going on.
    Your best bet would be to either call NI or your local NI rep and have them get you some more info.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • Timing problem for Playlists, etc.

    I'm not very good at going through the maze of info options to solve problems, particularly this one. Since installing a new hard drive, then software, etc., the timer at the bottom of all Playlist selections has changed.
    Instead of getting specific timing such as 53:12, I get readings such as 1.7 hours. I'd appreciate having someone explain how to get back to the specifics!
    Alan
      Windows XP  

    Hi,
    Welcome to Apple Discussions
    Just click on it. But before you do that read the notice at the top of this Forum.
    Next time you have a question please post in an appropriate Forum for a quicker response i.e. iTunes for Windows
    Regards,
    Colin R.

  • Smart Build - push - odd timing problem

    I'm using a push smart build with nine images. KN will show all nine, but only acknowledges the existence of eight and the timing is off... the last image is onscreen for too long even if I click to initiate a page transition.

    oaklandathletic wrote:
    Fixed it.Funny how explaining a problem for others helps you to work out the solution yourself, isn't it?
    Don't forget that if you decide on programming as a career.
    Winston

  • Timing problem with counting edges

    Hello!
    I use a NI PCI-6221 DAQ card with NI-DAQmx to count edges of TTL pulses for a spectrometric application.
    It is extremely important that I count the pulses for a well-defined period of time. Typically, I want to count the edges that reach the counter in the period of 400 milliseconds.
    Normally, this works quite well, when I use a WHILE loop that reads and restarts the counter every 400 milliseconds. Things change when the PC I run the VI on has other programs running in the background. Expecially computing-time intensive programs delay the 400 milliseconds of the WHILE loop for up to several 100 percent, resulting in an wrong counter read.
    I tried to use a timed WHILE loop but this din't change anything, regardless of the timimg source (onboard clock or PCI-6221 counter) I applied.
    Has anyone encountered similar problems and found a solution? Isn't there a possibility to control the counting time by hardware?
    Thanks in advance!
    EresthorMessage Edited by Eresthor on 04-07-2005 08:17 AM

    Hej Lynn,
    of course your idea works, thank you. It works extremely well this way, too.
    My problem with this approach is that I need both counters on the PCI-6221 to count data from my spectrometer simultaneously on two channels. That's why I would like to trigger the counter in a different way, for example with a clock.
    Is there no way to trigger the counter with the timebase of a hardware clock on the card? Or ist there another possibility without wasting a counter?
    Eresthor

  • Timing problem between XPS 14.4 x64 vs x86

    Hello all,
    I am using XPS 14.4 on a x64 machine and I have a design which is failing timing contraints. However, when using the same design on a x86 machine, I do not have the problem.
    How is that possible? Thank you for your answers.
    Kind regards

    You could try to run the 32-bit version of XPS on the 64-bit machine to see if you get the same results.  It's possible that there are differences in the random seed functions used for initial placement.  I don't know if it's easy to change in XPS, because I've always used ISE as the top level design, but you could also try changing the cost table placement starting value (-t command line option for map).  Running from ISE, I would normally use SmartXplorer to do this automatically.

  • KEN BURNS imovie clip timing PROBLEMS!!!

    I'm having some trouble adjusting the timing for pictures that I have put the Ken Burns effect onto, in imovie. I have selected all the clips to be 4 seconds long. Then I have selected the Ken Burns clips to be 4 seconds long as well, but they either have to be RENDERED in order to change the time (and this, I've heard messes up the quality of the pic making it "jagged") OR it only allows the picture to be set at it's pre-given RANDOM lower than 4 second time.
    Make sense? PLEASE HELP! I'm about sick of imovie with all the problems I've had.
    Thanks!

    Then I have selected the Ken Burns
    clips to be 4 seconds long as well, but they either
    have to be RENDERED in order to change the time (and
    this, I've heard messes up the quality of the pic
    making it "jagged")
    You may have misunderstood something important, Smiley, so I want to correct it. Ken Burns does NOT add jaggies to images. It actually INOCULATES the image from getting jaggies later.
    The jaggies are added when you press the Create iDVD Project button (in the iDVD tab). That's when iMovie offers to render any unrendered photos -- convert them to video clips. If you grant permission to render, the jaggies get added to those clips.
    Ken Burns renders images beautifully. The rendering routine iMovie uses later adds the jaggies.
    OR it only allows the picture to
    be set at it's pre-given RANDOM lower than 4 second
    time.
    The user interface for configuring Ken Burns settings is confusing and sometimes buggy. Until you figure it out, it sometimes appears to have a mind of its own. For what it's worth, I've never seen KB apply random durations to a group of images, and it's not a complaint we see here. So my guess is you're doing something inconsistent with how the Ken Burns user interface likes to do things, or you've bumped up against a bug.
    One bug is that the text boxes in Ken Burns are quite unreliable. It's best to use the sliders to set the duration and zooms instead of the text boxes. The duration slider is more reliable than your typing the duration in the text box at the end of the slider, for example. If you use the text box, remember to hit the tab key after entering the text. And, of course, be sure to use the sec:frame format, e.g. 4:00 or 4:22. If you type the numbers differently, iMovie will probably do something unexpected.
    One of the interface anomalies occurs when the Ken Burns checkbox is on when you select a photo in the iPhoto list.Then Ken Burns does a preview dance in its little thumbnail image, with animation. As that animation runs, changing any Ken Burns settings will almost certainly fail. You will probably accidentally set a feature you didn't intend.
    Here's why: As the animation progresses, Ken Burns switches from the Start position to the End position. If you click on a photo in the list, then reach up to set the Start position, you'll probably unintentionally set the End position. So always wait for the preview to finish before setting anything.
    Another confusing (but useful) feature is that Ken Burns always applies the features of your last-clicked-on Ken Burns clip to the upcoming import. So if you pre-set your Ken Burns features, THEN click on a previously-imported Ken Burns clip, the Ken burns settings will change from YOUR settings to the settings for that clip. (That's immensely useful, for it lets us apply the settings of a clip we like to one or more photos we want to import, but it can be very confusing.) So if you have manually configured some settings for the next import, do NOT click on a clip before importing that image.
    Another bug: if the Ken Burns checkbox was OFF when a photo was imported, clicking on that clip does NOT correctly re-display the settings for that clip. Ken Burns doesn't correctly show the pan or zoom. If you Update the clip with a new duration, the pan and zoom of the new clip won't be correctly applied.
    I don't know if any of that helps you figure out what's going on there, but hopefully so. If not, describe EXACTLY the steps that cause the problem to occur so others can test it.
    Karl

  • Myrio timing problem

    Hello,
    I'm new to myRIO and currently trying to use the PWM output to modulate a sinusoidal signal. See the attached code derived from this post: frequency matching problem with myrio!!
    The PWM frequency is set to 40 Hz, the frequency of the sinusoidal signal is 1 Hz.
    When I run the VI (as far as I understand thats the so called interface mode with the front panel displayed on my desktop), the code works well. Also deployed and run standalone there is no problem.
    As I would also like to generate higher frequent signals, I then changed the dt of the timed loop to 10, which means it should run at a rate of 100 kHz.
    Run with these parameters, the signal still doesn't look right anymore, and after a few seconds, the connection to the myRIO is lost. I then need to power cycle the myRIO in order to connect again.
    I thought this might have to do with the code running in interface mode, creating so much overhead that the loop cannot run as fast as intended.
    But when I deploy the code to the myRIO, it doesn't resolve the problem.It's even worse:
    When the code is set to run at startup, it's not possible to connect to the myRIO again. It seems to me that the code uses all of the processors resources so that it cannot communicate with the desktop pc anymore.
    Does that mean that the myRIO isn't capable of running the loop at a rate of 100 kHz at all? If so, are there possibilites to increase the loop rate?

    The problem here is that using that ExpressVI you send data to the fpga, to a compiled fpga file which does the tasks you ask for. All this is done in the express-vi. Ofcause beeing a express-vi, this takes some overhead. This express VI simply takes longer, than the time you gave it to finish. If you connect the output finish late, you will see the result. You have a lot of finished late loops. Because the loop has a higher priority, than the systemconnection to the net, you loose connection.
    Here yeah, it is unlikely you could programm a loop that fast in Realtime.
    Fortunaltely you can programm the FPGA yourself!
    So what you could do, if you want to create a pwm there, create a FPGA file which outputs exactly what you want, and just start it once. And it runs, as fast as the fpga is able to. Please refer to the examples in the sample projects how to programm the FPGA.

  • Timing problem when doing hourly rate

    Note:
    There are two problems:
    1)Usually each passed test takes more than 1 minute, thus incrementing Track no. But what if the 2nd failed test completes in less than 1 minute, track no cannot be incremented, leading to wrong result in hourly rate.
    2) For hourly rate, it needs to be calculated after each hour. The problem if the test lapses more than one minute, the same minute skips,
    Therefore, hourly rate cannot be calculated at each hour. Using more than or less than function won't work as the hourly rate will be calculated twice or more in each hour.
     See the red box in the bloick diagram
    See my attached.
    I am using Labview 7.1
    Pls advise I will grateful to your generous help
    Attachments:
    timing.vi ‏108 KB

    Hi Englund,
    Thanks
    Ya I know. I am trying to test whether the function is working  for my main program and test machine. Sometimes, in case of of failed test, the whole test will take less than 1 minute to complete. For the passed test, of course the teat machine will continue to test on more stages. But when the test fails in  first or earlier stages, the track number cannot be incremented.
    What's more I want the to calculate the hourly rate, so if it misses 60 minute mark, Hourly rate won't  be calculated. I can use the equal sign but the minute tracker cannot possibly detect every minute becos the test takes 1 minute, more or less, missing the mark.
    I have checked the function (wait until next ms multiple) as u suggest and found that this is not function I am looking for.
    If you think that I missed out. Maybe post your small example  on how it works.
    Clement

Maybe you are looking for