8 years, 9 months ago.

why signaling thread in ISR creates delay?

Hi, I'm working on an RTOS based code for my project. I'm using two M0+ boards and trying to establish I2C communication between them. I have used an ISR to signal a thread (say, I2C thread) that starts I2C communication. I have noticed that if the ISR is called when some other thread is running, then there is delay in signaling the I2C thread(I measured it using the timer() function. I have given the highest priority to I2C thread. But still there is no change. Because of this delay the sync between both the boards is lost and the I2C communication failed. I want to know the reason for this delay. Is there a way to solve this?

Any sort of help in this regard is appreciated.. Thanks in advance...

t

posted by Siva ram 28 Oct 2015

1 Answer

8 years, 9 months ago.

Hi Sakthi Priya,

More information would be appreciated Like the delay you observed, The code(of both the boards) if possible...

normally it takes time when shifting the control from one thread to another thread typically it is in the order of few hundred micro second up to 1ms... I don't think we can do anything about this though..

I assume that the ISR only signals the thread and the program leaves the ISR.. In the above case try doing the functions in that thread in the ISR itself (just try )...