Timer counts after a SCI interrupt

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timer counts after a SCI interrupt

381 Views
shirensun
Contributor II

Hi,

I'm now working on a LIN project with S12P64 and I want to set a timeout after the last SCI receiving interrupt to check if it's the end of the frame or not.

My idea is to set a timer counter after a SCI interrupt. If the timer counter achieve the expected value, so the timeout is reached and we can say that the frame is end. Else if a SCI interrupt occures before timeout, we reset the timer counter to ZERO in the SCI interrupt so that it will never reach the timeout if there is data arriving.

The problem is that I'm not familiar with the timer over flow, input capture and output compare. I think the input capture maybe not useful in my case so I decided to use output compare to calculate a single period after SCI interrupt. I succeded in setting an output compare to run a period task continuously but I don't know how to toggle the timer counter in the SCI interrupt, instead of toggling it automatically by itself. Maybe reset the counter in the SCI interrupt is a good idea, but I don't know which regist I can reset the counter to 0. 

Can anyone help me about this?

0 Kudos
2 Replies

284 Views
shirensun
Contributor II

Well the solution is found in another question: 

s12p64 number of data received by LIN  G240-TIM_50us_interval-CW51

Thank you again Radek for your response.

0 Kudos

284 Views
RadekS
NXP Employee
NXP Employee

Hi Shiren,

You are welcome.

I am glad that it helped.

Best regards

Radek

0 Kudos