# pic32mx440 timer interrupt issue

**URL:** <https://forums.freertos.org/t/pic32mx440-timer-interrupt-issue/246>\
**Category:** Kernel\
**Created:** [March 27, 2012, 4:27pm UTC](https://forums.freertos.org/t/pic32mx440-timer-interrupt-issue/246 "2012-03-27T16:27:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 27, 2012, 4:27pm UTC](https://forums.freertos.org/t/pic32mx440-timer-interrupt-issue/246/1 "2012-03-27T16:27:15Z")

</div>

**[liliot](https://sourceforge.net/u/liliot/)** wrote on [Tuesday, March 27, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/040621c0/#e5a9):

Hi All,  
&nbsp; I’m working with a simple self made board with a pic32mx440f512h.  
I started with a simple project defining 2 tasks (working with gpios).

Calling the vTaskStartScheduler, the second defined task runs just once, then the system hangs.  
I’ve observed that, on the timer interrupt, the code jumps to vector 0 instead of vector 4.

Currently I’ve modified the xPortStartScheduler function (port.c) adding the following line at the very beginnig:

&nbsp; INTCONSET = \_INTCON\_MVEC\_MASK; // Set MVEC

to enable the multivector mode.

Is that “fix” OK?

Regards.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 28, 2012, 3:03am UTC](https://forums.freertos.org/t/pic32mx440-timer-interrupt-issue/246/2 "2012-03-28T03:03:54Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Wednesday, March 28, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/040621c0/#0571):

I’m not sure, without digging the manual out, but the official demo does it by making a call to the Microchip library as follows:

INTEnableSystemMultiVectoredInt();

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 28, 2012, 11:38am UTC](https://forums.freertos.org/t/pic32mx440-timer-interrupt-issue/246/3 "2012-03-28T11:38:30Z")

</div>

**[liliot](https://sourceforge.net/u/liliot/)** wrote on [Wednesday, March 28, 2012](https://sourceforge.net/p/freertos/discussion/382005/thread/040621c0/#8b9e):

You’re right, official demo uses the INTEnableSystemMultiVectoredInt().

And it also works for me.

Anyway I don’t understand (I’m just a beginner) why this interrupt controller configuration is left to the user whereas the OS functions define all the other stuffs (like timer vector).

Many thanks.

Regards
