cancel
Showing results for 
Search instead for 
Did you mean: 

USART interrupt problem

pietro2
Associate II
Posted on May 13, 2013 at 11:10

Hi guys, i've a problem with USART communication using interrupts.

Using only USART device, the communication works correctly.

When i try to using the usart device with some other timers interrupt routines with timers about 100 msec seems that these routines blocks the USART.

How can i handle the interrupt priority vector?

Now i use a global NVIC structure and set all the priority value to 0 but the USART priority is set to 4. But don't works.

Thanks.

#usart-interrupt-priority #no-nvic-priority-group
3 REPLIES 3
Posted on May 13, 2013 at 13:51

You should look at what you're doing with the Priority Grouping, and and Preemption Priority.

Consider if you're other interrupts are hogging too much time, or spinning in wait loops.

Are you using an RTOS?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
pietro2
Associate II
Posted on May 14, 2013 at 11:15

Hi Clive, i'm using a cortex m0 microcontroller and in Core_cm0.h file there are no priority group definitions, differently from others microcontrollers like cortex m3.

My only option is to set a priority value from 0 to 3.

Well, i've set up the usart priority to 3 and other priorities to 0, but nothing seems to change.

About the OS, i use windows 7 with IAR ide. It isn't real time.

 

Posted on May 14, 2013 at 11:35

Sorry the M0 thing wasn't clear from your initial post, and I'm not tracking your part usage. That would be easier if the forum permitted a view of your profile to actually show your posts rather than simple a count of them.

Having a timer interrupt running at 10 Hz (100 ms) honestly doesn't seem like a high loading, unless you have the processor running very slowly, or it's dwelling in there for a long time. You should probably evaluate what you're doing in that timer interrupt, and perhaps profile it via a GPIO pin so you can see how long it runs for.

The USART doesn't have a HW FIFO, so figure you need to service it within a 10-18 baud clock window.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..