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.
Jim Noxon
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi everybody,
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!
Greetings
SeldomLight
SeldomLight,
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.
Regards,
Jim
Hi
If I2C is not implemented for the CC2540 why the HAL Driver API.pdf from the CC2540 devkit mention those functions:
HalI2CInit ()
HalI2CReceive ()
HalI2CSend ()
(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?
regards,
B.
Csenteri,
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.
Regards,
Jim
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
C:\Texas Instruments\RemoTI-CC253xDK-1.2\Components\hal\target\CC2530EB_NPI
if installed in the default location.
Jim Noxon
Dear Jim,
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?
Best regards,
Jack
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.
Jim Noxon
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.
Jim Noxon
Hi Jim:
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?
Regards,
Amit