Setting LM3S8962 as I2C slave

Hi,
Im using the LabVIEW embedded module for ARM microcontrollers upon the LM3S8962 in order to create I2C communication between two devices, the other being a MCF51JM128 Coldfire microprocessor. I've been able to set the LM3S8962 as the master device and write data to the Coldfire as well as read data from the Coldfire, whilst the coldfire is the set as the slave device.
Now, for the purpose of potentially communicating among several LM3S8962 boards, is there any way to set the LM3S8962 as the slave device? It appears that the LM3S8962 is inherently set as a master device which adresses other slave devices. Is it possible to have the LM3S8962 adressed as a slave?
Kind Regards  

Yes this is possible.  The LM3S8962 hardware supports both Master and Slave Mode I2C according to page 385 of the data sheet below.
LM3S8962 Microcontroller Data Sheet
http://www.keil.com/dd/docs/datashts/luminary/lm3s​8962.pdf
“The Stellaris® I2C module supports both sending and receiving data as either a master or a slave, and also supports the simultaneous operation as both a master and a slave.”
So this confirms that the hardware supports slave mode.  To determine if we exposed this in LabVIEW I created a project with the LM3S8962 as the target device.  The ARM palette has an SPI and I2C sub palette.  These are the cross platform SPI and I2C functions, i.e. they should work on all supported ARM chips.  This is why they don’t provide much functionality; all supported ARM devices need to support these functions.  There is a more advanced I2C palette specifically designed for the LM3S8962.
You can find the ‘Advanced’ I2C palette in ARM>>EK-LM3Sxxxx >>Stellaris Ware>>I2C.  This palette provides much more functionality, including things like I2C Slave Enable, I2C Slave Init etc.  The help files on these Vis are only mildly useful, but this is how you enable I2C slave mode on the LM3S8962.
I want to know what those I2C VI are doing to confirm that they are actually enabling I2C slave mode.  If you open the VI you will find a call library function node that is not pointing to any code.  This would break in the desktop environment, but has been overloaded in LV Embedded and basically acts like an in line C call.  There is a comment on the block diagram with the function call to I2CSlaveEnable.  To find where this is coming from we can use an awesome feature in Visual Studio to search for text in side files in a given directory.  Hit Ctrl+Shift+F in visual studio gives us  the Find and Replace in Files and Folders dialog.  From there I searched for I2CSlaveEnable in C:\Keil\ARM. I really want the C and H files containing this function and luckily the search found them at C:\Keil\ARM\RV31\LIB\Luminary\SRC\i2c.c, and C:\Keil\ARM\INC\Luminary\i2c.h.
The header file doesn’t tell us a whole lot, but the C file includes a nice comment on the function:
//! Enables the I2C Slave block.
//! \param ulBase is the base address of the I2C Slave module.
//! This will enable operation of the I2C Slave block.
//! \return None.
So now we know that we are actually calling code to enable the I2C device in slave mode.
-Michael
AE-NIC
Regards,
Mike S
NI AE

Similar Messages

  • Setting the I2C Slave Wait for Event on the USB 8452

    Hi,
    I just ordered my USB 8452 and have configured my 8452 to act as Slave. Few questions arises:
    1. How can I configure my Wait for Event time to be about 210us? This is the time period for which my master device (LTC1760) write a command to the slave
    2. What other slave address can I use other than the default, 0?
    Thanks for your answers.
    Regards,
    Stan.
    Attachments:
    Block-Diagram.jpg ‏145 KB

    I have been able to solve the problem I posted early. Another thing I find as a road block is that I am only able to execute one read write from and to the master device. My master device in my project is the LCT1760 which constantly send commands to the Smart Battery which in my case is the USB-8452. My question is, how can I enable my code to run continuously for a given time and extract the commands being sent by the Master device (LCT1760) so that I can write response back to the Master?
    Any suggestion would do.
    Regards,
    Stan.

  • Problems writing to network published shared variable hosted on rt (set as modbus slave for crio)

    Hello Ni Forums
    This is my first post on this forum and I have been using labview for about 8 months now
    I have a problem regarding writing data to modbus registers through an i/o server set as a modbus slave for my 9074 hardware.After I have completed building project and deploying the variables and following instructions from here , it yields no result but a line zeros. I have the Ni DSM open and modbus master setup to see whether the data is actually being read/written from the respective sides which both yield the same line of zeros as well.  What I am actually trying to write to is an array of single precision floating data. The registers are structured from ranges F40000-F46534 for 10 elements or have them for range AF40001L1-AF46534L1 of item AF40001L10 where it is an array of length 10. (Referenced ranges here)
    I know 1 thing for sure, the modbus connection works and is ready for data requests, I tested this through NI DSM and manually set data for and my master received them . 
    System and Project specifications
    Windows 7 OS
    Labview Full Development System 2011
    No Labview DSC module but I am using the real time module as referenced by one of the documents
    This project is a real time application with fpga mode (not scan interface mode)
    The master and slave are the same subnet and network
    Modbus Connection Type: TCP
    9074 compact rio 8 slots
    9234 module x3 
    9221 module x1
    9472 module x1
    Shared Variable Engine service running on windows os and rtos system 
    Used this  guide to learn about the modbus protocol as I searched all over the internet to learn about modbus 
    I already having Modbus IO Server software installed on the crio through ni max version 1.8 for NI RIO 4.0
    attached file(s)
    Image of Crio software specifications
    Image of the Data being written into variable in rt block diagram
    Short Version of the problem: Why is the io variable not being written into with properly converted data?

    The data can have zeros but not all of them will be zeros and I have another program (on local computer for database storage)that is recieving the same data through TCP and they are not zeros. 
    If a machine is running and is active then the data that will be collected should not be zero , it should infact  be some analog value > 0.
    I will look into the function you described
    How do you view the errors in the IO server subfolders ?
    Is it the modbus register called error status that returns an error code if so that value is currently 0 
    Regards mzamstl
     

  • I2C Write/Read Error

    Error -301742 occurred at NI-845x I2C Write Read.vi
    "Possible reason(s):NI-845x:  The slave did not acknowledge an address+direction byte transmitted by the I2C master. Reasons include the incorrect address set in the I2C configuration or the incorrect use of the 7-bit address. When entering an address to access a 7-bit device, do not include the direction bit. The NI-845x Basic I2C API internally sets the direction bit to the correct value, depending on the function (write or read). If your datasheet specfies the 7-bit device address as a byte, discard the direction bit (bit 0) and right-shift the byte value by one to create the 7-bit address."
    We have connected the pull up resistors on the SDA and SCL line.
    The error seems to be strange in our case,
    We have two setup
    1. Using a push button to power the device and wires through the pull up resistor.
    2. We are trying to communicate using a NI 2569 for the SDA and SLC and the Power supply to the device.
    We do not observe the error in case 1,however, in case 2 we do observe,attached are the waveform pics for the same.
    Noted that we have the clock signal rise delay in case 2, is this because of the relay 2569?
    Any help will be highly appreciated.
    Regards,
    Naru 
    Attachments:
    Case 1.jpg ‏302 KB
    Case 2.jpg ‏302 KB

    I don't quite understand your setup, and I'm not sure what I'm looking at with the figures you posted. What does the 2569 have to do with the 8451? You also said
    1. Using a push button to power the device and wires through the pull up resistor.
    I have no idea what this means.
    It's hard to tell from the pictures, but for the Case 1 figure, it appears that you are generating a correct start condition. It's also indicating that are sending a read transaction. You didn't indicate what device you're talking to, so we can't say for sure if this is correct. 
    In the second case it also appears that you generating a correct start condition. The slow rise times that you are seeing in the clock is probably due to extra capacitance on the bus, or weak pullups, or both. This transaction appears to be a write transaction, but with no data.
    At this point, without knowing what device you're talking to, a better explanation of your setup, and the code itself, I'm not sure how much help we can be. 

  • I2c debugging help needed with an oscillascope

    Hello,
    I am trying to debug my i2c slave device and was hoping that someone could explain how to use an oscillascope to debug it and how to set up the vi to use the oscillacope to test my scl and sda values.
    Thanks,
    rbme

    Hi rbme,
    Depending on the oscilloscope you are using to debug your i2c device, there might be an instrument driver located at ni.com/idnet. The instrument driver will allow you to control the oscilloscope with a set of software routines reducing software development time.
    Regards,
    Andy L.
    Applications Engineer
    National Instruments

  • Usb-8451 i2c developement

    Generated a simple program to talk to i2c on NSE5310 using usb-8451.  I get the following error.
    Error -301742 occurred at NI-845x I2C Write Read.vi:1
    Possible reason(s):
    NI-845x:  The slave did not acknowledge an address+direction byte transmitted by the I2C master. Reasons include the incorrect address set in the I2C configuration or the incorrect use of the 7-bit address. When entering an address to access a 7-bit device, do not include the direction bit. The NI-845x Basic I2C API internally sets the direction bit to the correct value, depending on the function (write or read). If your datasheet specfies the 7-bit device address as a byte, discard the direction bit (bit 0) and right-shift the byte value by one to create the 7-bit address.
    I do have pullup resistors of 1.5k on both SDA and SCL.  I've attached the data sheet for the device and a sample program. 
    THANKS FOR YOUR TIME.   Happy Holidays.............................
    Attachments:
    NI-8451 Testing ver2.vi ‏13 KB
    NSE-5310_Datasheet_v1_0.pdf ‏1569 KB

    You are providing the wrong address. As the error message says, you must provide the 7-bit address, excluding the read/write bit. . You are providing the full value of the first byte, including the read/write bit. In other words, you are doing the exact opposite of what the error message tells you to do. If you've set the user-bits to 0 then the correct address is 0x40.
    Side-note: When you set a front panel numeric control to hex display you should also display the radix so that others know that it refers to "81" hex, and not "81" decimal, which are two different values.

  • Dynamically Setting a Variable from a Connection String that has been set by a Config File

    Hi Guys
    I'm setting up a Master / Slave (Parent / Child) dtsx environment but I'm unable to work out how to dynamically set a variable in the Master dtsx from a connection string that has had its value set by a config file. I'm sure it's possible.
    Below is the what I'm hoping to achieve. I've set up everything apart from the highlighted section.
    Any ideas?

    First, what version of SQL Server are you using?
    You could switch the problem around.  You could set the value of a variable from the config file, then it is easy to use that variable as the connection string source for your connection manager.  At the same time you can use a parent variable
    configuration to map that variable to variables in your child package.
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • I2C interface (Sensor Data Acquisition) LabVIEW

    Hi all!
    Hope you are doing great!
    Well I have a question which is more about asking all you for an idea!
    The Situation:
    I have a circuit board which has an On-Off Valve, Digital pressure sensors (manufacturer AMD) and Humidity/Temperature Sensors (make- IST Hygrosens). On the board all the sensors communicate as I2C slave devices and all the data from the sensors is read into an I2C --> USB adapter chip which further connects to the PC via normal USB cable.
    Additional to this board, There is a Relay circuit with a simple 1-pole relay which controls an on-off valve on the above Circuit board. This valve is controlled totally separate via a coaxial cable from the relay directly to the Valve. But the relay board has a I2C interface and it also acts as a slave device. The relay board has the same I2C --> USB adapter chip.
    Both the Relay board and Sensor board connect via USB to the PC which I suppose is the Master device.
    The software code written for this arrangement and Sensor data acquisition is too old and there are a lot of problems coming. I have almost given up troubleshooting..
    I now want to translate this automation system onto LabVIEW. I searched the NI website where there is a DAC card called - USB8451 which supports I2C interface... I am a beginner in LabVIEW and cant really make sense out of how should I go about implementing this system on LabVIEW..
    If you guys can please help me out to atleast start (like what all hardware I would need etc..), to have a clear picture, it would be great help!!
    Looking forward to your inputs and Thank you so much in advance!
    Cheers!
    Pramit

    NI provides a LabVIEW API for the USB8451.  If you use the USB8451, you would use the provided API to write a program that controls the USB8451 and you would do all of the I2C communication in your program.  This would mean using functions / SubVI's to connect to the USB8451 and then perform I2C operations through it.
    If you use USB already on your device, then you would probably use NI-VISA as the driver and have to get / write your own API to talk to the specific device.  The manufacturer may have a LabVIEW (or other) API available for talking to the device that you could get.  If not, then you would have to understand the details of how to communicate with the device and then write an API using NI-VISA serial functions.  This would mean making NI-VISA be the assigned driver for the device and then using VISA Serial functions / SubVI's to send the messages and receive the responses.

  • Using Oracle as an LDAP slave???

    Hello.
    I'm not sure this is the right place for my problem and if it isn't it would be very nice if someone could tell me where to post this question.
    The thing is that I have a product which is built on top of an Oracle database. I'm currently in the process of integrating our product to another companys user registration system. They are using LDAP to register their users and what I'd like to do is replicate the data from their LDAP to specified tables and fields in our Oracle (this is done because our product relies on the Oracle DB but their system relies on the LDAP but we still need the same data to be in both datastores, e.g. a user should have the same password whichever he/she is using...).
    My question is: Does anybody know of a convenient way to replicate data between the LDAP and the Oracle DB? We are currently looking at using plugins to the Netscape LDAP server which would register the information to our Oracle. The Netscape LDAP would then have to be set up as a slave to the master LDAP they are using and so on... But wouldn't it be nice if I could just set up our Oracle to be an LDAP slave? And I would be able to specify which column in which table each LDAP entry corresponds to... or something like that!
    Well.. I've taken up enough of your time... I hope someone can help me with this... or at least tell me where I might be able to find information about this.
    Kind regards from Iceland,
    Stefan

    Dear Stefan
    (Please send the King of Iceland my regards)
    We have just undertaken a similar project - but in reverse - i.e. synchronising an LDAP server from Oracle.
    Our challenge was a little simpler in that we could use triggers to instigate an LDAP call on update/delete/insert.
    We originally tried using the Oracle JVM in conjunction with the Netscape's LDAP JSDK, but this proved too flakey, and we have reverted to calling an extproc which inturn calls some java code to update LDAP.
    Working the other way would be more complex and I'm not sure how you could get LDAP to invoke a command to update Oracle.
    However, if you managed the process from within Oracle you could maybe use LDAP groups to maintain a list of those users that were in sync, and those that required synchronising.
    Good luck
    Andrew

  • How to add i2C device to emulator for temperaturesensor in lesson2

    I am running the course without the hardware sensors and am using a raspberry pi emulator with correct pin settings. This works fine but now I have arrived at the TemperatureSensor project in lesson2 and want to add the i2c device to the emulator. I think this needs to be done with the custom device editor. I clicked the i2C tab and managed to locate a jar file called TemperatureSensor. Is this the correct way of adding the device and what should the implementation class name be in this case? I tried the obvious name TemperaturSensor but that does not work.
    Thanks,
    Willem

    It should be full qualified class name of the temperature sensor implementation located in the given JAR file.
    Also, you have to specify required I2C slaves on this tab.
    Note, also that your temperature sensor implementation must be compatible with the MESDK you use (e.g. sensor implemented for MESDK 3.3/3.4 will not work on MESDK 8.0 or 8.1). See API docs to implement emulation of your I2C bus at <MESDK>/docs/api/embedded-support-api.zip

  • Write to i2c Register from java

    My setup: Java 1.5, SUSE Linux 10.2
    I'm trying to set registers over i2c.
    From command line this can be done using "i2cset [options] [bus_address] [chip_address] [register] [value] b".
    I'd like to do this without using the command line, directly from java (may be using JNI and some native libraries).
    I searched google, tried to find some examples at koders.com - but no luck.
    I hope someone can point me in the right direction... Any hint on this subject is highly appreciated!

    Yes, as I described, i don't want to use Runtime.exec().
    There are many registers which have to be set alternating, so i2cset has to be executed over 4 times a second - which is bad.
    I'm currently doing this in my application:
    ProcessBuilder pb = new ProcessBuilder(new String[] { I2C_SET_CMD, I2C_OPTION_NOQUESTIONS, I2C_BUS_ADRESS,
              I2C_CHIP_ADRESS, register, value, "b" });
    Process p = pb.start();
    int exitCode = p.waitFor();The problem is, that there are Filehandles left open (by i2cset?? I think so...) and that crashes linux after some hours of operating (to many open files).
    That's the reason, why I'm looking for a solution without Runtime.exec() and especially without using ic2set.
    At the moment I don't have native libraries or even native code to do this. Is there a native library which can be used from within java to set i2c Registers?
    Or is it somehow possible to do address i2c registers directly from java (whitout using native code)?

  • Setting parameters for synching pci-6534 cards via RTSI bus

    I have been performing high-speed,
    buffered, looping output with one pci-6534 card.  I am now adding
    a second 6534 card that I need to sync to the first card via the RTSI
    bus.  I have successfully used the RTSI bus to see the master REQ1
    and ACK1 signals on those channels of the slave (seen at a connector
    block), using the "RTSI control" vi.  I simply set the master and
    slave as transmitter and receiver, respectively, over the RTSI bus.
    The question is: Once I have used the RTSI control vi to share the
    necessary signals, do I need to do anything in my "dio config," "dio
    write," or "dio start" vi's in the looping output code for the 2nd 6534
    card to let it know that its REQ, ACK, STPTRG, and CLK signals are
    coming from the bus?  For example, in the buffered pattern looping
    output vi, the "dio start" vi has choices of "internal" or "RTSI
    connection" for its clock.  My master board's code simply uses the
    internal.  Does my slave need to be set to RTSI connection, or,
    once I have shared the clock signal over the RTSI bus, is that
    effectively the internal clock for my slave too?
    I apologize it this question is confusing.  Unfortunately, so is the issue.

    Hello bwz,
    When you are performing synchronization across the RTSI bus you need to specify that the slave device should get its clock signals from there.  You would use the digital clock config VI to do this.  If you look in the example finder, you will find synchronization example VIs that do the same kind of thing for analog input.  To find the examples, open the example finder by going to Help >> Find Examples >> Hardware Input and Output >> Traditional DAQ >> Multiple Device. 
    If you are just getting started developing your application, you may want to consider using DAQmx.  There are many more examples available to look at for this type of synchronization.  To find these examples in the example finder go to Hardware Input and Output >> DAQmx >> Synchronization >> Multi-Device.  To use your PCI-6534 with NI-DAQmx, you must have version 7.4 or later.  The newest version is DAQmx 7.5.  You may also want to look at this tutorial about synchronization with DAQmx. 
    I hope this helps!
    Laura

  • Canon Speedlite 430 EX ii slave for Canon Powershot SX 60 HS, How ?

    Without purchasing any wirelss flash transmitter Can I use my Speedlite 430 EX ii as a slave external flash to work remotely ?
    My target is I do not want to attach the flash unit directly into the hotshoe of camera but it should work remotely, How ?
    Is it possible with Canon Powershot SX 60 HS ?
    Details instruction needed. I tried to set the flash Channel 1, Slave A. But while shooting only pop up flash working not the external flash.
    Camera ---------> Flash unit seperated-----> while shooting it must work, How possible ?

    Metal wrote:
    Yes I checked my SX60 HS no seperate menu for controlling external flash only little thing like red eye correction. I clicked zoom button of 430ex ii to set the flash as slave but my camera pop up flash doesn't trigger remotely. I am really sad a premium range bridge camera with a multihotshoe camera doesn't have this function built in. Can any expert check the matter in more details if I am not doing it in proper way/method pls. 
    Ok about 3rd party device like yongnuo YN622 wireless ETTL flash trigger receiver transmitter transceiver woyld work? How to be sure before purchasing?  
    Yes, the YN622C transceivers should work.  I used the YN-622C's with my G1x and they performed well. These transceivers fool the camera into thinking the flash is actually attached to the camera when it is not. 
    The basic optical slave in the link above will not work for two reasons. 
    1) Your camera has an ETTL flash and the ETTL preflash will cause the slave to trigger at the wrong time.
    2) The Canon 430EX II has some circuitry that is incompatible with these types of optical triggers. They will fire once and then the flash will no longer respond. 
    Mike Sowsun
    S110, SL1, 5D Mk III

  • 975X PowerUp--setting up PATA RAID0 and 2 optical drives (Problem Solved)

    Hi, all.  Revamping my existing system extensively and need some help. 
    I have 2 optical drives and 2 hard drives.  I want to have the optical drives set up as master/slave on one IDE cable and the 2 hard drives set up as a RAID array on a second IDE cable.  I did it on my old mobo but is this possible with the 975X Platinum PowerUp? 
    The manual says that IDE1 can support a master and slave, but that IDE2 only supports a master.  However, I know this to be false because IDE2 is the slot that the JMicron RAID controller governs.  I can manage to set up a RAID0 array with both HDDs master/slaved and plugged into IDE2.  However, the optical drives in IDE1 are not recognized if I do this.  I can get the system to recognize the optical drives if I plug them into IDE2...  They work, but are incorrectly recognized by the JMicron portion of system post as a RAID array.  I can't install Windows on the RAID array because so far the system won't access the optical drives without them being on IDE2--which I need for JMicron to control the RAID array.  You can see how this would cause trouble.    Is there some way that I can go into the BIOS and tell the system that IDE1 is the optical drives?
    I have looked in the manual and on websites.  Nobody seems to have the same problem.  I know that I am a bit behind the times by not having a CD-RW/DVD-RW combo drive, but even having only the one device would not solve the problem of devices on IDE1 not being recognized by the system.  This sounds like it should be possible to set up correctly, but because of the unfamiliarity of the motherboard and the complexity of the BIOS in relation to my last one, I know I am not doing something right.  I hope I've made the situation clear enough to make sense to other people!
    Any suggestions? 

    Since it is a fresh install, the only drivers that are installed are the ones that came on the Windows XP SP2 CD and the JMicron RAID drivers that I slipstreamed in.  However, the directory structure and instructions for use weren't very clear in the .zip file that the RAID drivers came in.  It says:
    "For floppy install:
    Please copy all the directories and files in the "floppy" folder to the root directory of a floppy disk to create a pre-install disk for Win2K/WinXP/Win2003/WinXP 64bits/Win2003 64bits.
    For example,
    A:\amd64
    \x32
    txtsetup.oem"
    Well, my power supply does not have a connector for a floppy drive, which is why I was installing the RAID drivers with a slipstreamed XP CD.  However, in the actual .zip file, there is no "floppy" folder!  There are 4 subdirectories:  Application, Driver, Floppy32 and Floppy64.  The Driver directory has 2 subdirectories:  amd64 and x32.  I didn't understand whether I was supposed to use the files in the Driver/x32 folder, or the ones in the Floppy32 folder. 
    I ended up slipstreaming the files from the Floppy32 folder because it seemed to make the most sense according to the instructions.  However, I noticed both in nLite and when Windows was actually preparing setup that multiple RAID drivers were found in and loaded from this directory, whereas in the Driver/x32 folder, nLite detected only one set of RAID drivers.  Did I use the wrong directory to get the JMicron RAID drivers when I made the slipstreamed XP CD?  Or do you think there is a different problem?

  • HELP - Slave Router Video Buffering

    FIrst, thanks to all for any help and suggestions.  I am technical enough to be dangerous.  Here's my problem.
    Primary wireless router is E2500, everything ran fine except wireless laser printer in far end of the house would not connect.  Bought an E1200 and set it up as slave.  Printer works well.   However connecting any laptop to that router (great connection 5 bars), get excessively choppy playback, constantly "buffering", also slow internet searches with lots of "waiting".   If I reconnect laptop to the masterE2500 which is at the other end of the house (only 2 bars vs. 5 with the slave router), video playtback and internet searching is smooth.  Clearly something in the interaction of the two routers is slowing down internet performance at the slave router.
    Here's where my technical skills stop being helpful.  But some guesses?   SHould I turn off firewall at the slave?  IS the primary still the firewall for the "home network"?  Are there buffer settings between the routers?  
    Again...thanks to all!!!!

    Check to see if you have them cascaded properly with the right ip addresses and settings.  If your E1200 supports bridge mode, then use bridge mode.  (I'm pretty sure it does.)   Update both to latest firmware before you begin.
    http://kb.linksys.com/Linksys/GetArticle.aspx?docid=28cee6a2fb0d4176a2210942d1d5836c_Setting_up_the_...
    http://kb.linksys.com/Linksys/ukp.aspx?pid=80&vw=1&articleid=3733

Maybe you are looking for