Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

AT91SAM7S and RTT interrupt

Posted by Denis H on December 10, 2009

Hi,

I want to use the Real time Unit as 1s time interrupt and I have some problems with that.
I know that RTT and PIT (for tick generating) are sharing the same interrupt vector in AIC(System Controler), FreeRTOS uses the PIT interrupt. I modified port.c file, where is the ISR function of System Controler is:

static __arm __irq void vPortNonPreemptiveTick( void );
static __arm __irq void vPortNonPreemptiveTick( void )
{
unsigned portLONG ulDummy;
unsigned int isr_pit;
unsigned int isr_rtt;

isr_pit=AT91C_BASE_PITC->PITC_PISR;


if (isr_pit & AT91C_PITC_PITS)
{

/* Increment the tick count - which may wake some tasks but as the
preemptive scheduler is not being used any woken task is not given
processor time no matter what its priority. */
vTaskIncrementTick();

/* Clear the PIT interrupt. */
ulDummy = AT91C_BASE_PITC->PITC_PIVR;

AT91C_BASE_AIC->AIC_EOICR = ulDummy;
}
else
{

isr_rtt=AT91C_BASE_RTTC->RTTC_RTSR;
if (isr_rtt & AT91C_RTTC_RTTINC)
{

ulDummy=AT91C_BASE_RTTC->RTTC_RTVR;

//vRTTCISREntry();

rttc_isr();

}
}

/* End the interrupt in the AIC. */
//AT91C_BASE_AIC->AIC_EOICR = ulDummy;
}

Whit this code rttc_isr() must executing on every 1s. (RTTC_MR=0x8000), but not, As soom as i start running the code undefined instrunction execption hapens, and R14(LR) shows that undefined instruction executed from rttc_isr(), I also try whit context save and restore before, and after that function

-Here are my questions:

1. Is the any conseptions to use system controler interupts like DBGU,WDT, .... from FreeRTOS.
2. Where i do wrong whit this code.

thx guys.

Best regards.

RE: AT91SAM7S and RTT interrupt

Posted by Denis H on December 11, 2009
anyone :(

RE: AT91SAM7S and RTT interrupt

Posted by incrediball on December 22, 2009
I don't have an answer for your question but why do you want to use the RTT anyway? I have never understood the sense of this peripheral: it generates an inaccurate 1 second tick, so how is that useful?

Why not just use the tick hook routine and a counter, i.e. if you use a 1ms tick then count to 1000, then execute your code and reset the counter.


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists