i just started working with the DevKit cc2540. My project is to connect a device for EKG-mesurements. Now I have some questions relating to interfaces and devices:
1. I read the User Guide cc25xx SoC, and saw that I2C interfaces are not supported. Is there a way to get this feature?
2. Is there a reliable device that you can suggest for EKG-mesurements?
Many thanks in advance for your efforts!
There is no way to get an I2C interface as a hardware peripheral on the CC2540 but you can implement an I2C interface in software. There are numerous examples available, simply google "8051 I2C source code" and you will find plenty to choose from. Note that implementing the master side of the interface is much simpler than implementing the slave side. This is because the master is in control of the timing (for the most part) and thus you don't have to worry as much about latencies due to interrupts etc. If you are implementing the slave side, you may need to be able to disable all interrupts for the duration of the communication transaction on the I2C bus in order to keep up with the master.
A similar part, the CC2533, does have a hardware I2C peripheral block in it but it doesn't have the ADC or USB in it.
As far as the EKG monitor, take a look at this demonstration platform http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slaa280a, and you can see it in action here http://e2e.ti.com/videos/m/microcontroller/97492.aspx.
If this post has answered your question, even if not the way you wanted, please indicate so by clicking the Verify Answer button on this post.Please start a new thread if your question is not closely aligned with the original post in this thread as it makes searches more effective.If responding to a post please click the Reply button on the post you are responding to rather than merely defaulting to the bottom post.
thank you for your fast reply! That helped me a lot!
I wish you a nice time.
If I2C is not implemented for the CC2540 why the HAL Driver API.pdf from the CC2540 devkit mention those functions:
(chapter 11. I2C Service, page 26)
The hal_drivers.c indeed has all the other functions mentioned in the pdf except the I2C functions.
Is there any future plan to have that functionality or the documentation is wrong?
I am not aware of any plans to provide a hardware I2C peripheral on the CC2540. Your question as to why the header file contains API's for it is answered by recognizing the library is defined seperately from the parts on which it is utilized.
In this case, the library defines an API or interface specification. Regardless of whether or not the interface is actually implemented is independent of the definition. In this case, this library contains the definition of how to call an I2C interface with defined expectation of what will happen should that interface be implemented. In an extreme form, one could implement an I2C interface entirely by bit banging some I/O lines and be able to maintian the defined interface expected from the library. This is what gives a library it usefulness, the common definition for multiple platforms. The underlying implementation may vary vastly but it still can work as long as the interface is implemented.
Unfortunately, sometimes libraries are defined to encompass many capabilities but only expecting the capabilities the underlying hardware can support with the other capabilities being left unimplemented. The CC2540 is part of a new family of parts witch include the CC253x parts as well. This can be seen when one recognizes the same users guide is reference for all 4 parts. Onlyl the CC2533 implements the hardware I2C interface so the library used for this family of parts also included a specification which supported the hardware implementation of the CC2533 I2C peripheral. Actually the library you are refering to handles more than just these 4 parts.
Thus, the library cannot be interpreted as a part specification nor can it be used as a roadmap for up and coming architectures. The only guarantee of the library is the interface, and for parts that do not support a portion of the library, those portions many times go unimplemented.
I'm using CC2533, but I dont get the API function on I2C.
could you give me the cc2533 soure and header files of I2C to me?
my email: email@example.com
The I2C code for the CC2533 can be found in the RemoTI library stack located here http://focus.ti.com/docs/toolsw/folders/print/remoti.html
After installing it you can find the code in the following directory
if installed in the default location.
Thank you very much for you information.
I have found the source code in the directory.
It's GPIO simulate to IIC interface. but CC2533 has hardware IIC.
is there sample code for CC2533 hardware IIC?
I was unaware this code was a bit banging code. Kind of makes sense since the CC2530 target directory doesn't have an I2C hardware peripheral block. My apologies, I don't know of any other code to offer you.
Thank you all the same, it help me a lot too!!
May be I would program CC2533 hardware IIC by myself.
I think hardware IIC would be fast then simulate one.
I agree, a hardware peripheral would be better than software alone. Software only solutions will eat up unnecessary CPU bandwidth but if that's all you can do... well, you know what I mean.
What kind of sensors can be attached to the CC2540 Key Fob (part of the CC2540 mini dev kit)? I believe the sensors need to be attached to the TEST pin 6 & 7.
From above the sensors can't have I2C interface. So what kind of interface I should look for when searching for sensors?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.