Other Parts Discussed in Thread: CC2650, CC2640, CC1350, CC1310, MSP-EXP430F5529LP
I have been working on a slave i2c implementation in sensor controller for most of the day yesterday and today.
I am having difficulty understanding a few things and would like some assistance.
First, I would like to disable the pull-ups on the SDA and SCL, it is not apparent (for me) which bits controls the pull-ups.
I am attempting to have it loop forever to wait for the I2C start condition, something does not appear to like this since the task will time out. So far I am running in the debugger only, I have not attempted to import this into CCS.
The data that is supposed to appear in R7 always comes out 0xff, I am not sure if the SDA line is being read correctly, but I believe I implemented the necessary logic to wait for SCL return high, read the SDA line, then wait for SCL to return low before returning to the beginning of the loop to wait for the next bit.
At present, I am only attempting to receive a single byte, which will in the end turn out to be the address.
This would then be followed by an arbitrary number of bytes, up to 128, and stored in a buffer until transmission is completed, then notify the main MCU of the transmission completion.
I used the i2c master implementation as a starting point and have adapted the logic from there, therefore it is still under the i2c master module name at present.
I will upload the complete project here, I am using a MSP430 as a i2c master, which is verified to be functioning correctly. I am not sure of the transmission speed, but since it is software implemented it could not be that fast.
It would be appreciated if someone can provide any feedback on this and what direction I should take.
I am uploading the CCS project, written for a CC1312R LaunchPadXL along with the proc_defs folder that contains the assembly that was written.
i2cslave_CC1312R1_LAUNCHXL_tirtos_ccs.zip
tirtos_builds_CC1312R1_LAUNCHXL_release_ccs.zip
Edit: I have corrected one issue with not using fwSwitchOutputBuffer(); to allow the main MCU access to the buffered data. After fixing this all the data received is coming back 0x0000.