Hobbyist Toolkit

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C (c232HM) to communicate with mma8451

Hello, i am using this tool kit to communicate with MMA8451,when i used open serial VI, it throws an error code 5003. no other open connections . i see there are no open connections. can anyone please help me?

0 Kudos
Message 1 of 9
(1,879 Views)

i think you have to use visa to comunicate with c232hm 

0 Kudos
Message 2 of 9
(1,853 Views)

@swasa wrote:

Hello, i am using this tool kit to communicate with MMA8451,when i used open serial VI, it throws an error code 5003. no other open connections . i see there are no open connections. can anyone please help me?


- Where does your code run? From the error it seems you try to run your code on your (Windows?) host. Is that true?

- And your MMA8451 is connected to a Raspberry Pi or am Arduino through I2C?

- Have you tested that you can execute a small test Python, Java or whatever test program on your Raspi or Arduino to communicate to your MMA8451?

- And your Raspi or Arduino is connected with that C232HM USB to RS-232 interface to your PC?

 

If these things are all true you need to actually do a few things before you can communicate to your MMA8451 from LabVIEW.

 

First there needs to be a Linx installation on your remote device.

Then you can open a connection to that Linx server from your PC by opening a link with the Linx VIs to open the serial port.

After that you need to open an I2C channel on that Linx connection to start talking with your chip.

And then start implementing the I2C protocol for your specific chip in LabVIEW using the according Linx I2C VIs.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 9
(1,843 Views)

Hi, all i am doing is connect MMA8451 to C232HM-EDHSL-0, ither end of C232HM-EDHSL-0is connected to laptop. is there any sample example ? 

0 Kudos
Message 4 of 9
(1,807 Views)

Well that cable seems to be a FTDI MPSSE capable interface. So you will need to use an MPSSE enabled driver. On LAVAG is a driver for the MPSSE driver from FTDI but it has several problems and FTDI doesn't seem to have released a fixed version.

 

https://lavag.org/topic/19453-cr-mpssedll-labview-driver/

 

Read the entire thread to see what you would have to fix in that downloadable driver. And if you need to run this on a recent Windows installation you may also have to use the DLL from this thread instead of the original one that you can download from the FTDI site.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 9
(1,801 Views)

Thanks for your reply but looks like this link does not work i cant download from this link ( https://lavag.org/topic/19453-cr-mpssedll-labview-driver/ ) is there any other link?  

0 Kudos
Message 6 of 9
(1,793 Views)

Definitely works for me. Did you create an account on LavaG? I'm not sure if you can download things anonymously.

rolfk_0-1650438942480.png

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 9
(1,760 Views)

Thanks, i am able to download now, but this code does not tell anything about the mma8451

0 Kudos
Message 8 of 9
(1,742 Views)

@swasa wrote:

Thanks, i am able to download now, but this code does not tell anything about the mma8451


Of course not! That simply accesses the MPSSE functions in the FTDI chip to do I2C communication. What is connected to that I2C bus if anything, it has no knowledge of. That is your task to develop on top of the I2C functions. Each I2C chip has its own I2C address (sometimes changeable through some pins in a limited way) and its own set of registers that you can read and/or write. And these registers can have short or long addresses. That is all described in the datasheet of your chip and you have to study that information and start to write code to first configure the standard information such as the clock speed, address mode, etc, and then to talk to the correct registers of your specific chip.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 9
(1,731 Views)