From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use the I2C VIs for ARM Embedded system?

Hello everybody,

 

I have got a development kit including Embedded LabVIEW for ARM with Keil MBC2300 evaluation board with LPC2378 uController.

and I am trying since more than one week but no improvment. so I hope if any body has been used these VIs and get them in work to give me some tips how to start using the I2C VIs for ARM.

 

Thanks in advance

 

0 Kudos
Message 1 of 21
(12,970 Views)

Hello Amd1480,

 

do you think that this discussion can give you a helping hand with your request?

 

How to implement an I2C Bus with Lanbview embedded?

http://forums.ni.com/ni/board/message?board.id=170&message.id=370126&requireLogin=False

 

Please let me know if this was helpful.

 

Regards, Jan

Jan Kniewasser | Applications Engineer | Tel.: +49 89 7413130 | Fax: +49 89 7146035

»
0 Kudos
Message 2 of 21
(12,932 Views)

Hello Mr. Jingles,

 

after I open this thread, I found that thread (How to implement an I2C Bus with Labview embedded?) and I asked there if they have already solved that problem. But it seems there is no body knows how these VIs actually works!!

 

greetings

 

 

0 Kudos
Message 3 of 21
(12,925 Views)

.... additionally:

Where Can I Get More Information on the LabVIEW ARM Module's I2C VIs?

http://digital.ni.com/public.nsf/allkb/0359AF81CE5345D48625751B0071C92C?OpenDocument

 

Regards, Jan

 

Jan Kniewasser | Applications Engineer | Tel.: +49 89 7413130 | Fax: +49 89 7146035

»
0 Kudos
Message 4 of 21
(12,922 Views)

I have got a look at this file but, unfortunately, it does not answer/help to solve my problem.

But now after I modified the LPC2378.c file as Gmg said, I got now a CLK signal on I2C-Port0 (http://forums.ni.com/ni/board/message?board.id=420&message.id=1185#M1185

but I still cannot communicate to my slave device.

 

Okey, I will try to describe what I am doing and which hardware I am using. As hardware I am using the MCB2300 with LPC2378 uController, which I want to use it in my test application as Master. A temperature sensor DS1613 as a I2C slave device (Data sheet can be seen here: http://www.datasheetcatalog.org/datasheet/maxim/DS1631-DS1731.pdf). I set the Slave address as 0, and I would like to get a 12-bit resolution measurements. The Master should read every 1 second from the slave. Software I use is LV 8.6 with LV for ARM embedded. So I have done the software as you can see in the figure.

So my question now, what shall I change in this program to be able to read temperature from the DS1613 using MCB2300?

(Note: I tested this sensor using ATMega128 with C++ code and it works as it has to be)

Regards

 

 

0 Kudos
Message 5 of 21
(12,912 Views)

"The 7-bit bus address is 1 0 0 1 A2 A1 A0, where A2, A1, and A0 are user-selectable through the corresponding input pins."(DS1631 datasheet)

 

Of course, LabVIEW supports only the I2C0 peripheral but "write address" means your device address on your I2C bus.

 

P.S. I do think C is more appropriate for AVR than C++.

0 Kudos
Message 6 of 21
(12,903 Views)

Hello NicB,

 

thank you for replaying.

I gave the DS1631 address 0. so in this case I have set the "write address" input of the Init I2C VI to 0, or shall I set it to 1001000 (binary).

 


NicB wrote:

P.S. I do think C is more appropriate for AVR than C++.

 


you are right it was only a typing mistake

 

Greetings

 

 

0 Kudos
Message 7 of 21
(12,894 Views)

Of course, it shoud be 1001000

 

You could show the radix for those constant numbers and then choose accordingly with their significance:

  - octal for address (so 110 means A2 A1 A0 combination = 0, 111 for 1, etc.)

  - hex for commands (so Access Config will be AC, as in datasheet)

  - unfortunately you cannot mix radix in the same array, so the configuration register will be C for 12 bit and 8 for 11 bit

 

Well, what temperature is there? Is it hot?

Message Edited by NicB on 07-30-2009 03:59 PM
0 Kudos
Message 8 of 21
(12,892 Views)

all these constants are in decimal. The last command (170 = 0xAA --> Read command) which I send to the DS1631 in the while loop using the read/write VI should return two bytes. but I become only one byte with 170!!

 

0 Kudos
Message 9 of 21
(12,886 Views)
the reading temperature should be between 25 and 27°C
0 Kudos
Message 10 of 21
(12,885 Views)