Hello again everyone,
After solving my previous issue with input capture/timing, I'm back with a question about I2C.
I'm attempting to talk to a TMP112 (temperature sensor) connected via I2C on my custom CC2640 based board. I've exhaustively searched these forums for help or answers, and haven't come up with one.
My project is based on the SimpleBLEPeripheral code base, using TI-RTOS for SimpleLink Wireless MCU's 2.13.06. For reasons beyond my control, I can't switch versions to a newer build of the toolchain, so that option isn't possible. I've successfully built/programmed the SensorTag project included with this version of code, and its I2C devices work fine, and I can see them talking happily on my oscilloscope.
Again, I've carefully read these forums, and dissected the SensorTag code, and have modelled mine after it. I correctly have my Pins identified, I'm calling PIN_Init() before I do anything else, and am initializing the I2C stuff in the same way the SensorTag does (just in SimpleBLEperipheral_init().) I can successfully call bspI2cInit() and return, however, my code hangs at the call to Semaphore_pend() in I2CCC26XX_transfer() in the I2CCC26XX.c file around line 862. This is a line that many other people have had their code hang at.
The problem is that no clock pulses are ever generated on the I2C bus, and so the hardware interrupt that is supposed to return after Semaphore_pend() never happens.
Here are things I've tried unsuccessfully:
- adding .intPriority = ~0; to my I2CCC26XX_HWAttrs - this doesn't work because it relies on TI-RTOS 2.14 or greater.
- followed the TI-RTOS 2.13 user guide, and added TIRTOS.useI2C = 1 to my appBLE.cfg - this fails compilation, and seems incorrect because the SensorTag project doesn't use it
- tried toggling the SCL pins "manually" by using them as GPIO and toggling them - this works and there is no problem with the hardware, as I had suspected.
Does anyone have ANY pointers as to what steps I should try next? This I2C stuff seems extremely complicated for something that I've had to do many times in the past. I understand TI has to meet a wide variety of needs over a wide number of targets, but I'm really struggling.
Please let me know if anyone needs any clarifications or has suggestions or questions.
Thanks,
-Ben