Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Delay function disable "Timer0" interrupt.
19-11-2012, 11:59 PM,
#1
Delay function disable "Timer0" interrupt.
Hi, I have detected this behavior in pinguino (I don't tell pinguino works wrong, I ask for a solution).

1. I configure a timer interrupt:

OnTimer0(doubleBuffer, INT_MILLISEC, 1);

2. Then, If I use delay(1000) in other function (for example in loop function), I don't receive any interruption from timer0 in ONE second (exactly the time of the delay).

I want to know if I could configure timers that work during delays.

Thanks in advance.
Reply
20-11-2012, 04:11 PM,
#2
RE: Delay function disable "Timer0" interrupt.
On the PIC32 there's already a timer interrupt so usually there's no reason to change it / add another.

I've explained about interrupts in my other reply to you.

John
Reply
20-11-2012, 05:36 PM,
#3
RE: Delay function disable "Timer0" interrupt.
Does it mean SDCC delay functions (such as delay10ktcy() on which Pinguino delay() is based on) are not interruptible ???
You could compile a simple test and disassemble it (with < gpdasm -p 18f2550 test.hex >) to check.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
23-11-2012, 07:13 PM,
#4
RE: Delay function disable "Timer0" interrupt.
Sorry, but I've been away. I've done some test and, finally I suppose that there is no timer interrupts during a delay. So I have done a "for" loop and I've solved this problem.
Reply
23-11-2012, 07:51 PM,
#5
RE: Delay function disable "Timer0" interrupt.
There are on my board. Seems something wrong with yours or your tests.

John
Reply
23-11-2012, 08:09 PM,
#6
RE: Delay function disable "Timer0" interrupt.
(23-11-2012, 07:51 PM)pingotg Wrote: There are on my board. Seems something wrong with yours or your tests.

John

Is it possible to see your test? Thanks John.
Reply
23-11-2012, 09:59 PM,
#7
RE: Delay function disable "Timer0" interrupt.
Any fairly long lasting loop. Check millis before and after. Not the same. It's changed by the timer interrupt (see the code).

John
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)