05-25-2011 10:13 AM
Dear All,
I am developing one application which communicates with a µC (texas Instruments M430F160) usign I2C.
The communication must run using a serial port (RS 232)--> This is a requirements.
I cannot use any additional hardware. Loking in internet I have found several solution with FPGA and so on but anything that has been implemented directly in Labview.
Is there anybody that has found a solution for that?
Thanks in advance for your support.
Regards
Andrea
05-25-2011 10:38 AM
@bamarchi wrote:
Dear All,
I am developing one application which communicates with a µC (texas Instruments M430F160) usign I2C.
The communication must run using a serial port (RS 232)--> This is a requirements.
I cannot use any additional hardware. Loking in internet I have found several solution with FPGA and so on but anything that has been implemented directly in Labview.
It is hard if not impossible to do this only by using a serial port, and NO extra hardware. The only way I can think of is to use some sort of a bit-banging the serial control lines. http://en.wikipedia.org/wiki/Bit-banging But Labview are really not the most optimal tool for doing this. I have no idea if it will work or not. Are you sure your specification are correct
05-25-2011 12:24 PM
You WILL need additional hardware. The I2C spec (which you can get from Philips) has specific electrical requirements. The serial port does not meet these requirements. At a minimum you'd need voltage level shifters. You would also need the ability to put in pull-up resistors. Who is telling you that you cannot use additional hardware? Your manager? If so, your job is to educate them on the existence of the universe, rather than the fantasy land they are living in.
Of course, a FAR easier solution is to get an off-the-shelf product that is designed to be used for this sort of thing. NI sells such a device, but it's pretty expensive. An alternate is this: http://www.xdimax.com/sub20/sub20.html
05-25-2011 12:45 PM
Here is a link to an good introduction regarding I2C
http://www.nxp.com/documents/application_note/AN10216.pdf
05-25-2011 01:27 PM
One of my first LabView programs (many ages ago ) was with IIC over a parallel port. We used the bit-bang approach and it worked well, even with "high-speed" IIC. I designed a optically-isolated interface to connect the equipment to the product we were controlling; this not only protected our equipment, but also allowed for slight modifications; sometimes the signal levels with IIC are not to spec (imagine that!) and you have to change pull-up resistor values or other things.
However, I don't see how you can do it with a serial port and no additional hardware - RS232 is very different from IIC electrically as well as functionally (look up the IIC spec from Phillips). If you have to use RS-232, you'll have to have some kind of black box in between to convert RS-232 to IIC. Perhaps the "black box" could be an Arduino or other low cost microcontroller.
05-25-2011 02:42 PM
The MSP430 family has support for I2C, SPI and UART for serial communications built in. With the UART you can implement RS32 communications with a simple hardware interface and the onboard clock. The method is described in TI bulletin SLAA078. This circuit also provides the power to run the device. Then your LabVIEW application is a simple serial communications interface. This is least obtrusive way to communicate with the MSP430. Otherwise you'll need some kind of USB or RS232 to I2C or SPI converter as the others have previously said.
The MSP430 cannot operate by itself, are you using a TI development kit? Besides providing a power supply and crystal, they usually have a USB port that you also use. Too bad you are committed to that particular chip since there are MSP430s with built in USB support. Others MSP430s like the Chronos kit have wireless on the chip. Someone has put a lame horse before your cart.
JohnCS
05-26-2011 03:31 AM
Hi All,
first of all thanks a lot for your answare. Just to be more precise in my evaluation board, between PC and µC, there is a transceiver MAX3232 to get the right electrical values of the physical layer. Therefore there is a hardware
Now my idea was to create in Labview a sort of hypertermianl or Teraterm console to provide I2C command and read back the answeres form my device.
I hope that these new information could help you a bit more.
Many thanks in advance. Regards Andrea
05-26-2011 09:25 AM
What exactly are you intending to do with that MX3232? Are you providing a serial interface for the uC? Do you intend to send human-readable commands to the uC and have a command parser running on the uC? Is the uC the actual part that's going to be generating the I2C? As previously indicated, does it have an I2C module built-in, or do you have to do bit-banging?
05-26-2011 12:54 PM
The MAX3232 provides similar functionality to the circuit I mentioned earlier. Your idea of using LabVIEW as a terminal is sound.
What exactly are you planning to do with the I2C bus? Is this to be the communications link to your PC or does the I2C bus communicate with some other external target like a sensor or an EPROM? Do you have any software to run on the MSP430 yet?
JohnCS
05-27-2011 03:14 AM
Hi All,
after collecting your questions, I discussed with other colleagues and I gor additional mode info about the system and requirements.
The complete system has 2 µC's: one is the Master and the second one the Slave.
The communication between the µC's is done using I2C.
In normal operation, there is a software (loaded in an external EEPROM) that is taking care all: communication, setting, interrupts and so on.
When we are in debugging mode, we need the PC that is sending command using the RS232 to the Master.
Actually to perform that, we use TeraTerm with terminal VT100 and the code is wrote with Notepad.
In attachment, we have an example of code and one picture of the communication system between PC and Master µC.
Now, our target is to replace this terminal with a GUI developed in Labview.
Before the start the complete application, I wanted to creat some small VI's to checl the communication using the serial protocol.
In any cases, yesterday I did some additional tests (using a logic analyzer) and I have figure out that what I was sending to the Master with Labview is not the same when I used TeraTerm.
In particular the termination characters were different.
For example, I sent 2 commands:
WI F3
RI 01
These commands perform a reading of 1 byte in register at Fe address.
In attachment you could find the datalog using Labview and TeraTerm.
I think that something is missing in my VI's that consider the termination and (second problem) at the moment I do not habe any solutions to read the back from µC without using READ VI.
I have to say sorry again from my previous posts and no so precise info. Hopefully some of you have some ideas.
Thanks in advance.
BR
Andrea