From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement an I2C Bus with Lanbview embedded?

Hello,

 

I want to implement an I2C Bus with Labview embedded for ARM Microcontrollers. I use the stellaris LM3S8962 evaluation kit. As I am really not sure how to use the given I2C VIs, it would be great if there were some examples. Has anybody already used the I2C VIs in Labview embedded and can post an example? That would be very nice!

Thank you in advance!

 

Best,

Helge 

0 Kudos
Message 1 of 27
(7,616 Views)

Hi Helge,

 

There are some examples in the LabVIEW Example Finder. This can be found by going to  Help-> Find Examples and searching for I2C. There are also some examples on www.ni.com that deal with I2C with LabVIEW FPGA. There is more information here

 

Hope this helps!

 

Thanks,

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 27
(7,591 Views)

Hey Karunya,

 

Thank you for the fast reply! Perhaps these examples will help me! If you have any examples for the special ARM I2C Vi's, I would be very grateful if you could post them!

These VIs are:

 

ARM I2C Create Configuration Reference VI

Owning Palette: SPI and I2C VIs
Installed With: Embedded Module for ARM Microcontrollers

Creates a reference to the I²C device with the configuration you specify.

ARM I2C Create Configuration Reference

 

ARM I2C Write Read VI

Owning Palette: SPI and I2C VIs
Installed With: Embedded Module for ARM Microcontrollers

Writes and reads an array of data to and from an I²C slave device.

ARM I2C Write Read

 

 

ARM I2C Close Reference VI

Owning Palette: SPI and I2C VIs
Installed With: Embedded Module for ARM Microcontrollers

Closes an I²C device. Data transmission to the device stops, and the device returns to an idle state.

ARM I2C Close Reference

 

 

I am especially interested in what each of the Vis does. For example:

Do I have to send a start condition via the Write/Read Vi or is it sent automatically?

Is it necessary to send the adress of the slave or is that done automatically?

The problem is that the reference is some kind of short for these new VIs....

 

Thank you in advance,

Helge

0 Kudos
Message 3 of 27
(7,577 Views)

Hi Helge,

 

I will have to look into what I can find and post back.

 

Thanks for your patience.

 

 

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 4 of 27
(7,549 Views)

Hi Helge,

 

The source code of the VIs are located at C:\Program Files\National Instruments\LabVIEW 8.6\Targets\Keil\Embedded\RealView\Drivers\ARM\I2C in your computer. This source code will give you more information on how the drivers work. The slaveaddress and more information is there. I will try to figure out what I can looking at the back end code.

 

Hopefully, this is a bit more helpful!

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 5 of 27
(7,525 Views)

Hello HelgeKniep,

 

did you get these VIs in work? I am trying to use them since more than one week.but there is no improvment.

 

Thanks in advance

 

 

0 Kudos
Message 6 of 27
(7,216 Views)

Hi Amd1480,

 

What evaluation board are you using?  (And what version of what software?)

Have you implemented the pull-up resistors in hardware in order for I2C to work?

 

Kevin S.

Applications Engineer

National Instruments

0 Kudos
Message 7 of 27
(7,179 Views)

Hello Kevin,

 

I am using LV8.6 with LV for ARM-embedded software. the evaluation board I use is MCB2300 with LPC2378 on board.

the  I have already implement the pull-up resistors, but also there is no succes!

it seems if these 3 VIs for I2C have no functions even I2C clock dose not work.

one more thing, how we can select the I2C-Port using these VI's? (there are 3 I2C-Ports on the MCB2300 board). 

Kevin, I hope that you can help us to fix this problem.

 

many thanks

0 Kudos
Message 8 of 27
(7,165 Views)
one more question, how can I set the start and stop condition using these VIs?
0 Kudos
Message 9 of 27
(7,159 Views)

Hello,

 

I don't know if this will help, I have used the USB I2C (not the ARM I2C) before and this is how you assign a slave address to transmit to:

 

i2c.PNGThis uses the I2C Configuration property node

 

I would imagine the ARM I2C VI's will operate in a similar way. The I2C write VI handles the Start and Stop for you.

Message Edited by macaba on 07-30-2009 04:35 AM
0 Kudos
Message 10 of 27
(7,154 Views)