LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use the I2C VIs for ARM Embedded system?

Highlighted

For linking purposes, see this thread as well.

 

Kevin S.

Applications Engineer

National Instruments

0 Kudos
Message 11 of 21
(6,178 Views)
Highlighted

Hello,

 

I'm not detecting a clk or data using i2c port0 (pins 35 SDA0 and 34 SCL0) on a MCB2300. I'm using LV ARM 2009. I checked the file LCP2300.s and it includes the line SCS_Val         EQU     0x00000021

 

I had an external i2c device (w/ pullup resistors) connected, but now it is disconnected and I'm just trying to detect clock and data during addressing using a scope.

 

Other suggestions?

 

Thanks,

 

Richard

0 Kudos
Message 12 of 21
(6,067 Views)
Highlighted

Hello RichardJennings

 


Hello,
I'm not detecting a clk or data using i2c port0 (pins 35 SDA0 and 34 SCL0) on a MCB2300. I'm using LV ARM 2009. I checked the file LCP2300.s and it includes the line SCS_Val EQU 0x00000021 I had an external i2c device (w/ pullup resistors) connected, but now it is disconnected and I'm just trying to detect clock and data during addressing using a scope. Other suggestions?
Thanks, Richard

 

First of all, you do not need to change any thing within the C-Code to be able to programm I2C-Port0 on the MCB-2300 board. If you do not connect any device to on the I2C-bus as a slave, so if the Master (MCB2300) tries to initiate a communication on the bus. The Master will not get a ACK-Signal (Bit), and in this case the master will stops the communication or return an error, or tries to initiate the communication again (depending on your program).

 

so its better to try with a functional I2C-Slave device connected on the I2C-Bus. otherwise you may need to use the clock line (SCL) as an Input trigger for your scope-instrument (or make the channel to react on the falling/rising input edge of Channel A, and connect this channel to SCL and Channel B to SDA) these settings depending on what scope you use.

 

what Slave device are you using? did you give the correct address to your I2C device? could you post the block diagram, so may I can help you more further.

 

Good luck

0 Kudos
Message 13 of 21
(6,063 Views)

Hi,

 

My i2c device is an ADS1110. I disconnected the device and configured my scope to trigger on rising edge on SCL, but it never triggers. I'm assuming I should see the master put the address on the bus even without a device.

Richard

0 Kudos
Message 14 of 21
(6,053 Views)
Highlighted

Hello Richard,

 

as I can see from the screen shot you posted, (1) you send to the ADS1110 three bytes with zeros, in this case the ADS1110 will not response to your request, where you send an undefined message to the slave. Instead of these 3 bytes you shoud send the correct byte (Only one byte) to configure your slave or connect an empty array (Not array of bytes of zeros) to this input. (2) bytes to read input variable of the read/write VI should be 2 where the ADS1110 sends 16 bits (2 bytes) of data and the 3 byte is the configuration register. so only if you need to read the configuration register too, write 3 to this input. (3) write address must be like this: 1001aaa1 (binary).

 

ADS1110-Test.jpg

 

 let me know if you need more support.

 

Good luck

 

0 Kudos
Message 15 of 21
(6,045 Views)
Highlighted

I've modified the VI per your instructions. I'm trying to read from address 6 (1001110). Attached is the block diagram. It still fails to read over i2c. My board looks like Fig 4 in the ads1110 data sheet. I have my scope set to trigger on the falling edge of SCL and I'm monitoring SCL (pin 34) and SDA (pin 35) on the MCB2300. ON the block digram I have two breakpoints. At the first and second breakpoint both SCL and SDA are high, but as soon as the i2c write/read VI executes both lines drop to zero simultaneously and stay there.The i2c write/read VIwill also hang indefinitely.

 

Pushing the pause button and looking at the code in uVision shows that it is at:

static void i2cWaitForComplete(I2C_INFO *pI2cDev) {
  while (!(*pI2cDev->i2conset & I2C_SI));
}

 

Your thoughts?

 

0 Kudos
Message 16 of 21
(6,033 Views)
Highlighted

Please try again by setting the first element in the write array, at Read/Write VI, to be equal to 10001100 and run the program without breaking points.

now about the H/W: 1- is the VDD = 5V (or in range of 5.2 and 4.8 Volt), 2- do you have a common ground? 3- is the Pull-up resistor in range of 1 to 10 kOhm?

if the VDD goes lower than 4.8 Volt when the I2C-SDA or SCL line is low, then try to use a pull-up resistors with a higher values.

About the message from uVision it is OK, I mean it is not a bug or a code error. 

 

0 Kudos
Message 17 of 21
(6,025 Views)
Highlighted

Hi,

 

I use LV2010 ARM (eval. softw.) and have a MCB2300 board.

I want to use an external I2C Real Time Clock  ( ISL12025 ) .

 

my the slave adres is "1101111x" ( "x" = read or write to RTC) , when i use the Config Reference VI, i'm not able to select 8 bit address size. 

I suppose that it is not possible to add an item to the "ring constante" whitout changing the "c-call".

 

On the oscilloscope i see the clock signal and a part of the slave address ... 

 

I want to see the slave address on an oscilloscope => and the ack => to see if my "slave" is working well.

 

My code in attachment 

0 Kudos
Message 18 of 21
(5,203 Views)
Highlighted

The Lone Rider,

 

Were you ever able to get your RTC chip working?  I have access to a dev board, but I don't have that chip by any means in order to work through the I2C protocol itself.  Anyone from the community have experience with this chip or something similar?

 

Kevin S.

Applications Engineer

National Instruments

0 Kudos
Message 19 of 21
(5,144 Views)
Highlighted

Hey Kevin_S

 

I found what i was doing wrong...

 

I had to set one bit more in a register ... 

 

Thanks 

0 Kudos
Message 20 of 21
(5,069 Views)