Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 217056

Forum Post: CCS/MSP430F5529: I2C clock stretching

$
0
0
Part Number: MSP430F5529 Tool/software: Code Composer Studio Hi guys, So I'm using a MSP430F5529 to implement an I2C communication. My msp is in slave mode. I can properly receive data with it, but I now need to add clock stretching to my code. From my understanding, clock stretching is used when the slave wants to slow down the communication. It then holds the clock low so the master can not send any new data. Once the slave is ready it releases the clock. I've noticed that my MSP goes in the RXIFG interrupt every time it receives an ACK.This is where I get confused. If my master sends for example AA BB, and there's an if condition in my RXIFG that calls a function 1secondDelay() when I receive AA , my MCU is going to wait until the delay of 1 second is done to receive the BB in the RXIFG interrupt. So what is the point of clock stretching if you receive your interrupt only when your MCU has completed all its task ? In which situation does a slave wants to slow down the communication ? Furthermore how should I implement a manual clock stretching in my code ? Thank you very much guys !

Viewing all articles
Browse latest Browse all 217056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>