Part Number: MSP430FR5969
Other Parts Discussed in Thread: MSP430WARE,
I have been developing code on my Lanuchpad board, and so far, everything has been PWM and time-based events, so I have been able to use the peripherals and Interrupt Service Routines (ISRs) to do the work. My main{} is pretty much setting everything up, and then going into a Low Power Mode.
Now I need to start writing an I2C handler, and I am using the USCI_B peripheral. I thought I would probably be able to build my I2C handler in the same way I have been, but I think the code would be too complex for handling via ISRs and other peripherals (does DMA work with I2C transfers? Would that be a reasonable approach?).
To clarify what I am trying to do, here is a standard I2C message format in my system. My MSP430 will be the slave.
START Addr WRITE, Command (1 Byte), Data (2 Bytes), START_REPEAT Addr READ, Data (2 Bytes), STOP
So I am trying to receive 3 bytes of information, change direction, and reply with 2 bytes. Do I need to create a state machine to handle this? Can you point me to the preferred way to exit an ISR and run a specific piece of code to handle this, and then return back to a LPM? I am using the MSP430Ware Driverlib.
Sorry if these questions are too basic. Thanks in advance for the help!
Paul


