Part Number: MSP430FR2676
Hello,
I am trying to set up the MSP430FR2676 as an I2C slave to communicate with a host MPU. I have been able to get the I2C slave to work successfully for both reading and writing basic data. I also have an I2C master set up on the MSP430 that communicates with a few external sensors and drivers that has been working well. I am now trying to do an I2C slave read that is a little more complicated because it requires a delay as part of the read. Below is a step-by-step description of what I need to do:
- MPU sends I2C slave read command to MSP430 in order to read value from a sensor
- MSP430 enters I2C slave interrupt to process the call from MPU
- MSP430 sends an I2C write command to the sensor in order to initiate a measurement
- MSP430 I2C slave process must wait for 1 second in order for sensor measurement to complete (This is where I am struggling)
- MSP430 sends an I2C read command to the sensor to retrieve measurement results
- MSP430 sends measurement data back to MPU
What I am struggling with is how to run a delay in the I2C slave process while allowing the other processes in the MSP430 to run. I know of the __delay_cycles command, but I know that causes the MSP430 to stop running all other processes. Is there a way to do the delay while still allowing other processes to run?
Thanks!