Page 1 of 1

TIMER produces the interrupt with no counting

Posted: Sat Jun 16, 2012 1:40 pm
by r_romeo
Hi, I am working in a code were inside a custom interuption (produced by a
external source) I have a timer interrupt that works fine the first time.
the problem is that from the second time the timer is activated, the timer
interrupt is activated but the interruption is activated inmediatly, without
counting.
Anyone knows why this can be happening ? , I am checking with a logic analyzer
and also with custom code to check the interruption is beeing generated.
In the graph I can see the interrupt is being generated rigth after the timer
is activated and before the time programed.
Somehow after the first activation the timer lost the parameters.
It does not matter wich timer I use
I also changed the delay , just in case the interrupt was been generated
outside boundaries , but that is not the problem.

Ialso get the warning:

------------------------------------------------------------------
D_01_03.c: In function '_T2Interrupt':
ID_01_03.c:3615: warning: PSV model not specified for '_T2Interrupt';
assuming 'auto_psv' this may affect latency
ID_01_03.c: In function '_T1Interrupt':
ID_01_03.c:3623: warning: PSV model not specified for '_T1Interrupt';
assuming 'auto_psv' this may affect latency
------------------------------------------------------------------


but the warning is in both timers, and one actually works fine, I dont know it's meaning
this is in a code were I can use use other timer interrupt that is working
fine, but the alternative is working as described.
Any ideas?

Re: TIMER produces the interrupt with no counting

Posted: Sat Jun 16, 2012 8:56 pm
by Stanga
I use the timer to count as well, but store the count result in a memory location. So I can recall the count value when the timer restarts.

Re: TIMER produces the interrupt with no counting

Posted: Sun Jun 17, 2012 10:52 pm
by dazz
hi
can you post your flowchart,as someone may be able to help further

Re: TIMER produces the interrupt with no counting

Posted: Mon Nov 19, 2012 12:55 pm
by r_romeo
Hi , Here are my flowcharts, one for transmission and other for reception and generation of signal (CAN) after certain time that shold be managed by TIMER 2
Actually, this topic would be moved to V5 but I can't post there (???)
can-test-1-RX.fcf_pic16
(15.5 KiB) Downloaded 379 times
can-test-1-tx.fcf_pic16
(9.5 KiB) Downloaded 368 times

Also I have a screenshot that show what is happening
(RX and tx are swapt in the image)
Signal.jpg
(184.53 KiB) Downloaded 1190 times
As you can see the delay works the first time and then there is no count

Re: TIMER produces the interrupt with no counting

Posted: Mon Nov 19, 2012 3:12 pm
by dazz
Hi
follow this link to upgrade your forum account to post in v5 forums http://www.matrixmultimedia.com/mmforum ... =46&t=9958

Regards
Dazz

Re: TIMER produces the interrupt with no counting

Posted: Mon Nov 19, 2012 4:12 pm
by r_romeo