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] [October 2008 Threads] Interupts priorities on PIC18Posted by Marcelo Adrian Lorenzati Sanz on October 19, 2008 Hi all, I´m using FreeRTOS with PIC18 and I´ve modified the port to work with priorities (High priority for the prvTickISR) and low priority for the others (like USART and I2C). Is there any consideration to have in mind? because I´m having a strange behaviour with the task that manages the I2C that waits for the I2C semaphore to be signaled.
here the ISR code:
#pragma code high_vector=0x08 static void prvHighInterrupt( void ) { /* Was the interrupt the tick? */ if( PIR1bits.CCP1IF ) { _asm goto prvTickISR _endasm } } #pragma code
#pragma code low_vector=0x18 static void prvLowInterrupt( void ) { /*i2c interrupt*/ if( PIR1bits.SSPIF ) { _asm goto vI2cISR _endasm }
/* Was the interrupt a byte being received? */ if( PIR1bits.RCIF ) { _asm goto vSerialRxISR _endasm }
/* Was the interrupt the Tx register becoming empty? */ if( PIE1bits.TXIE && PIR1bits.TXIF ) { _asm goto vSerialTxISR _endasm } } #pragma code
Here the timer int hook and i2c int hook:
#pragma interrupt prvTickISR static void prvTickISR( void ) { /* Interrupts must have been enabled for the ISR to fire, so we have to save the context with interrupts enabled. */ portSAVE_CONTEXT( portGLOBAL_INTERRUPT_FLAG ); PIR1bits.CCP1IF = 0;
/* Maintain the tick count. */ vTaskIncrementTick();
#if configUSE_PREEMPTION == 1 { /* Switch to the highest priority task that is ready to run. */ vTaskSwitchContext(); } #endif
portRESTORE_CONTEXT(); }
#pragma interruptlow vI2cISR save=PRODH, PRODL, TABLAT, section(".tmpdata") void vI2cISR( void ) { .....
Do I have to manage the global interrupt? (GIEH , GIEL )
RE: Interupts priorities on PIC18Posted by Dave on October 21, 2008 Looking at this (I try to avoid looking at anything with PIC18 in it) it seems the FreeRTOS code only uses the one priority so using both would require some effort to change the port.
RE: Interupts priorities on PIC18Posted by Marcelo Adrian Lorenzati Sanz on October 21, 2008 Thanks, its true. I´ve been diggin around and the port its not optimized to use priorities.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|