The msp430 online emulator provides a complete software model of the msp430 16bit instruction set. The user generates a stop condition by setting the stop enable bit, pen sspcon2. I wanted to use the lesser of the two mcus that comes in the package to do something cool. According to page 17 of the user manual, the msp430g2553 has a universal serial communications interface. I have lots of examples on using the i2c bus on the website, but many of these are using high level controllers and do not show the. I know more than i want to about the i2c interface. In this post, i will show a couple of examples of using the msp430 launchpad as an i2c master to communicate with slave devices. This library allows you to communicate with i2c twi devices. Typical values for pullup resistors on an i2c bus range from 4. Energia library software i2c master for msp430g2553. I2c bus uses only two bidirectional opendrain lines. Contribute to sglee0223msp430 development by creating an account on github. Hi fred, hello paul, i just have a rapid look on the softbaugh web site and it seems that you were right, but if i understand correctly the board use was the d4, with an msp430f4.
The example code is demo how to setup uscib0 i2c master mode and communcation between two msp430g2955 device, if you want to read other i2c device like nt3h1101nt3h1201, the code should refer to the i2c protocol on datasheet as below. Several functions of arduinos wire library are used to accomplish this. Arduino 1, the master, is programmed to send 6 bytes of data every half second to a uniquely addressed slave. I am trying to build communication between a sensor and msp430f5438a over i2c. Im trying to setup an i2c device and send a byte sequence, but i am having trouble.
System utilities downloads msp430 gang programmer by texas instruments incorporated and many more programs are available for instant and free download. Shares the clock signal generated by the master with. Msp430f5329 i need simple code to read and write to i2c devices. In both examples, the mcu is configured as i2c master. I2c communication with pic microcontroller, eeprom. The i2c code i am using is adapted from the i2c explorer project on 43oh forum. Aug 08, 2015 software compile it the library presumably is written for iar or other commercial system. On your raspberry pi run the previously compiled program. I2c is a serial two wire bus used in microcontrollers systems to communication with devices such as eeprom memories, digital potentiometers, lcd controllers, rtcs and other. Altough there is already an application report implementing a usi i2c library, this guide is intended to give a deeper explanation on how the usi module works, together with tips and tricks working with the usi module. You can learn more about getting started with msp430 using energia ide here. The usi universal serial interface module which can be found in several msp430 devices can be used either as spi or i2c interface. After quite a bit of testing, i think that i have some improvements for the version of software i2c in this thread. Save yourself time and frustration by removing the jumper connecting p1.
Master issues start condition, sends slave address for write0b 1010 1110 master sends register address e. Unfortunately the pin map picture for this launchpad have not been updated so far. It seems that the critical item would be timing, since the master is supplying the clock. Interintegrated circuit i2c is a synchronous communication bus. Judging from my emails, it is quite clear that the i2c bus can be very confusing for the newcomer. The msp430 driver library is a high level, easytouse, abstracted programming interface, which provides simple function calls to enable, configure, and use various msp430 peripherals.
Remote control module consists of an msp430 mcu as the master chip which is connected with dm355 through the i2c interface. Lately ive been taking advantage of that last advantage. Simplified interrupt usage master and slave modes up to 400kbps i2c. For some reason software serial does not pass all the nmea messages on to tinygps. The software is available as a component of code composer studio ide desktop and cloud versions, or as a standalone package.
Once the last byte, that is requested, is received by the master, the master will generate a nack and then the master sends the stop signal. I2c communication with msp430 launchpad circuitdigest. Energia ide is one of the easiest software to program our msp430. Software compile it the library presumably is written for iar or other commercial system. Detect your i2c devices slave address using an lcd and a barebones msp430 m430g2553. It is an interactive debugger for advanced development and in depth firmwarehardware analysis. I find it amazing that you have so many variants of your peripherals that i can not find code that just works without a lot of messaging. Sw state machine needed master and slave modes i2c. The i2c protocol involves using two lines to send and receive data. The two gpios are used to emulate sda and scl signals. In your case youre requesting more bytes then the slave is willing to send so the sda line is just sitting high which is why youre reading in 0xff bytes until the buffer fills up and the nack signal is sent. The msp430 is one master and the others are silicon devices.
Each of these devices is assigned a unique id which distinguishes it from the other devices. This should meet most of the i2c master needs for a straight 8 bit protocol. The first byte transmitted out on the i2c bus is a composition of the slave address and the readwrite bit. Open source projects msp430 texas instruments wiki. Also how would one first start out trying to bitbang. The library code can be downloaded towards the end.
I even went so far as using a sparkfuns nxps pca9306 logic voltage converter and it had no effect on the problem. Energia library software i2c master for msp430g2553 43oh. The msp430 driver library is completely open source and is delivered to customers within the msp430ware software and documentation suite. I bought myself couple of msp430 launchpads when they first came out. Software bitmap converter for lcd modbus master simulator. The library inherits from the stream functions, making it consistent with other readwrite libraries. Note that the master and slave dont have to be from the same family of devices necessarily. Introduction i2c or interintegrated circuit is a pretty neat communications protocol. After checking the example code on the arduino i checked the data flow on buses. All projects can be executed in the supported devices listed in table 1.
It makes it possible to program i2c devices in scripting languages like python or tcl and can be used for rapid software prototyping, troubleshooting and debugging embedded systems. Interrupt is generated once the stop condition is complete. I knew there was a software example of driving an i2c device. I2c communication with msp430 launchpad circuit digest. I2c module generates interrupt on the 9th clock cycle.
Sorry for getting off topic, but what you guys were talking. So either connect to the pins 9 and 10 or switch to the alternate i2c bus with wire. Now to read partid from the sensor im following the steps below. Some of these chips, though, dont have native spi or i2c.
It is structured such that it can be used to receive. Hello kc, i have looked at the datasheet ass you said but i have some issue to understand the rw bit, so in the msp430 master receiver i have to clear the uctr for reading, set the uctr for writing and in the ntag nfc it says the opposite rw 0write, rw1read. Pins 5 and 6 are the i2c lines these will be connected to the msp430 s scl and sda pins which we will configure in software. Dec 04, 2012 msp430 i2c slave lcd driven by msp430g2231.
Is it possible to use the msp430 with no i2c hw to function as a slave i2c device. However, as we learned previously, they require pullup resistors. This video shows how to configure uart and i2c with a master. Pins 5 and 6 are the i2c lines these will be connected to the msp430s scl and sda pins which we will configure in software. Connect master and slave devices as described in section 3.
C single writeread example electrical engineering stack. Tis msp430 chips are rather interesting theyre low power, very capable, and available for under a dollar in most cases. Once that message is received, it can then be viewed in the slave boards serial monitor window opened on the usb connected computer running the arduino software ide. This software solution supports transactions on i2c bus with an scl clock frequency of up to 100 khz for master. Oct 07, 2014 with energia17 the default pins for the i2c have been changed to pin 9 and 10 so that it is consistent for all launchpads. Using this software, they code in c and upload the code to the microcontroller. So, to use i2c in energia ide we have to just include wire. Library of peripheral drivers, component drivers, utilities, and more.
I2c is a two wire interface using the sda serial data line and scl serial clock line pins to communicate over the serial bus. Write the device address, then the page address, then the value. Feb 02, 2014 tis msp430 chips are rather interesting theyre low power, very capable, and available for under a dollar in most cases. I have only used simple slave devices that do not sink the scl line so my older code drove this line without a pullup resistor. In this circuit, the master device uses a clock and a data line to communicate with each of the devices connected to the network. Captivate design center capacitive touch mcus tools, documentation and software examples to simplify and accelerate capacitive touch designs using msp430 captivate mcus. Also i added support clock stretching during i2c reads. Launchpad acting as a master i2c driver writes hello, world and a counter to the g2231 usi i2c slave.
This video shows how an msp430 can communicate with an arduino using the i2c protocol. Jan 03, 2011 i bought myself couple of msp430 launchpads when they first came out. After this initial sequence, when you spi data hello world\n to the msp430 it will turn on the led1 light. The msp430 board led1 will blink 3 times upon recognition of the spi clock. In this video i use the energia programming environment. In this example, two boards are programmed to communicate with one another in a master writerslave receiver configuration via the i2c synchronous serial protocol. Energia library software i2c master for msp430g2553 page. A collection of c libraries for the ti msp430 family of microcontrollers. This is a small library that implements an i2c iic, i. I2c communication with usi module texas instruments wiki. How to use i2c communication between msp430 and arduino.
Since the readwrite bit occupies the least significant bit position in this first byte, the address appears to be incorrect but its okay. After this initial sequence, when you spi data hello world to the msp430 it will turn on the led1 light. Energia library software i2c master for msp430g2553 msp. Jul 08, 2012 in this post, i will show a couple of examples of using the msp430 launchpad as an i2c master to communicate with slave devices. Aug, 2012 the msp430 board led1 will blink 3 times upon recognition of the spi clock. The launchpad act as a master and itg300 act as a slave. In order to compile it with mspgcc few modifications are necessary. C, or i squared c master on msp430 devices that only have the usi module for example. Controlling ad5171 digital potentiometer energia ide is one of the easiest software to program our msp430.
755 269 291 108 752 409 454 487 1397 955 1215 31 802 1472 1295 274 393 145 908 1394 750 418 1322 515 70 619 1125 1471 1429 578 169 244 1477 1456 648 346 973 141 1281 1303 477 839