News:

Let's find out together what makes a PIC Tick!

Main Menu

Interrupt

Started by Ivano, Dec 19, 2025, 10:14 PM

Previous topic - Next topic

Ivano

Good evening, I'm working with a PIC 18F46k42. By enabling the various registers that enable the interrupt with timer 0, when I also enable timer 0, the program resets after 2-3 seconds.
If I enable timer 0 without enabling its interrupt (PIR3.7), it counts and doesn't reset, but obviously the ISR doesn't work. The reset occurs when both the timer and interrupt enable are enabled. The same thing happens when using timer 1. Has this happened to anyone?

charliecoutas

It sounds like the Watch Dog Timer is causing this. In the config section check this:


   WDTEN = off                                   ;Watch dog timer disabled
   WDTPS = 2048                                  ;

Charlie

Ivano

Good morning, I solved it.
I disabled the WDT because I thought it was due to this. In Word configuration, I set MVECEN = off.
I disabled multi-vector and now it works.
Thanks anyway.
Ivano

Ivano

Good morning, out of curiosity, is it possible to use multi vector in positron with pic that have this feature?

charliecoutas

Glad you sorted the watch dog timer problem.

I've never heard of multi-vector. Do you mean that the processor has a means of going to predefined address depending on the type of interrupt?

Charlie

trastikata

He probably meant the Interrupt Vector Table on newer 8-bit PIC devices. But it is not as efficient as on 16b devices therefore it has not been implemented.