Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Project Request

Return
Giuradei Francesco
grandegiove

posted on 2011/08/23 05:12:42 AM CEST

Internal MCU modules

How obtain Nested Interrupt with PIC32?

Good morning,

I'm using a PIC32MX795F512L with MikroC for PIC32 with license.

I'm using the "UART1 Receive interrupt" and an "External interrupt (INT0)". I wrote the head of the ISR using the Interrupt Assistant.

void encoderInt() iv IVT_EXTERNAL_0 ilevel 7 ics ICS_SOFT

void Ricezione() iv IVT_UART_1 ilevel 1 ics ICS_SOFT

In the main I set:


Code: Select all
UART1_Init(57600); // Initialize UART module at 57600 bps
Delay_ms(100); // Wait for UART module to stabilize

U1IP0_bit=1; // priority=1
U1IP1_bit=0;
U1IP2_bit=0;

U1RXIF_bit=0; // flag=0
U1RXIE_bit=1; // enable Interrupt Uart

URXISEL0_bit=0; // setting interrupt
URXISEL1_bit=0;

EnableInterrupts(); // Enable all interrupts

INT0EP_bit=1; //rising
INT0IF_bit=0; //pulizia flag

INT0IE_bit=1; //enable

INT0IP0_bit=1; //priority 7
INT0IP1_bit=1;
INT0IP2_bit=1;

EnableInterrupts(); // Enable all interrupts


In the Edit Project I set

Interrupt Control :
- Multi Vector
- Vector Spacing 32
- SRS: 7

I can't obtain the desired behaviour: if the high priority interrupt occours during the ISR of the low priority interrupt, the h.p.interrupt must be immediately serviced.

Currently the high priority interrupt (INT0) is seviced only at the end of the ISR of the low priority interrupt (UART1) (if the h.p.interrupt happens during the ISR of the low priority interrupt)

I would obtain nested interrupts. What I wrong?

Thanks a lot!

Franek


USER Comments

Giuradei Francesco
grandegiove

posted on 2011/08/24 04:43:33 AM CEST

I'm sorry!

I've tried on the forum without receive answer for few days so I try here but is not the correct place..

Sorry for the incovenience.

Have a nice day.

Franek

  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 21 in "How obtain Nested Interrupt with PIC32?" request.

Steven Goh
stevenindon

posted on 2011/08/23 11:37:06 AM CEST

Giuradei,

Sorry this is not a place to ask question. Please proceed to :

http://www.mikroe.com/app/webroot/forum/viewforum.php?f=168

  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 20 in "How obtain Nested Interrupt with PIC32?" request.