AnsweredAssumed Answered

Timer Duration Count With Interrupt

Question asked by clark.david.001 on Sep 10, 2012
Latest reply on Sep 11, 2012 by malund.erik
A fairly basic thing to do which I am struggling to find any precise examples for.

I want to be able to setup a Comms timeout - specifically on an SPI connection whereby if  I don't get a response to a command I send within 5 seconds, I throw an error.

I am trying to do as much of my development as possible using interrupts, so my ideal way of implementing this would be to have a timer that I start, and which then generates an interrupt after 5 seconds if I don't get a response - and if I do get a response I just stop the timer.

Would this be the best way to implement this sort of functionality, and does anyone know of any examples/or can give me one to help me get this up and running?

Many thanks in advance for any responses,

Dave

Outcomes