FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [February 2010 Threads] High frequency ISRs in FreeRTOSPosted by peb on February 2, 2010 Hello all,
I am a new to RTOS and starting to be familiarized with FreeRTOS. My intention is to investigate how to integrate motor control into FreeRTOS. Usually motor control system (without RTOS) runs Motor_control_ISR at 100[usec] periodic rate and code is executed within this Motor_control_ISR which takes about 40[usec]. It is hard real time system where motor control must complete within a given time limit otherwise results in failure of the system.
Are there any handling techniques of such high frequency ISR to comply with FreeRTOS? Do you have any suggestions how to handle high frequency ISRs within FreeRTOS? Should it be such a ISR executed outside of FreeRTOS? Thank you very much.
regards, pepe
RE: High frequency ISRs in FreeRTOSPosted by Dave on February 2, 2010 Look at configKERNEL_INTERRUPT_PRIORITY and configMAX_SYSCALL_INTERRUPT_PRIORITY at the bottom of this page. These parameters are only on new ports though. The Cortex M3 demo apps run a 20KHz timer test that shows an interrupt entry jitter of about 100ns which is apparently equal to the effect of tail chaining in the core itself.
RE: High frequency ISRs in FreeRTOSPosted by peb on February 2, 2010 Is your suggestion to execute such ISRs outside FreRTOS? (Interrupts running at these priorities will never be delayed from executing because of anything FreeRTOS.org is doing. ) If so, how to interact with FreeRTOS it means between high frequency ISR and FreeRTOS?
RE: High frequency ISRs in FreeRTOSPosted by Dave on February 2, 2010 Yes, if you want the interrupt to have a priority higher than any used by the kernel (including critical sections) then the handler cannot use any FreeRTOS functions.
RE: High frequency ISRs in FreeRTOSPosted by peb on February 2, 2010 Any idea how to interact between ISR (priority higher than any used by the kernel) and FreeRTOS kernel?
RE: High frequency ISRs in FreeRTOSPosted by Peter on February 2, 2010 You can use anything you like. If you need a buffer just use it and make it globally available. Make sure you have a lock mechanism.
UINT8 bufferLock = 0x00; UINT8 buffer[8];
_ISR_(...) { if (!bufferLock) { ... check buffer data ...update data } ... }
void pvTask(...) // Has a lower priority than the ISR, so pvTask can not interrupt the ISR { // Try to access buffer, Method 1 ...disable interrupts if (bufferLock) { // Buffer is in use... } else { // Update buffer here } ...enable interrupts
#Method 2 ..disable interrupts if (!bufferLock) bufferLock = 0x01; ..enable interrupts if (bufferLock) { // Update your buffer... ... // Unlock buffer bufferLock = 0x00; } }
This is quick and dirty, but it works...
RE: High frequency ISRs in FreeRTOSPosted by peb on February 2, 2010 Guys, Thank you a lot!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|