AT91SAM7S Family Port

This port facilitates the deployment of Sirius RTOS and other products on Atmel ARM7 microprocessors within the AT91SAM7S family. The following processors are supported:

  • AT91SAM7S512
  • AT91SAM7S256
  • AT91SAM7S128
  • AT91SAM7S64
  • AT91SAM7S321
  • AT91SAM7S32
  • AT91SAM7S161
  • AT91SAM7S16

Source files

The following table lists all port files associated with this architecture:

File nameExtensionDescription
AR_APIHPort API File
AR_TypesHType declarations file
AR_AT91CPort source file
AR_AT91aSPort assembly file
AR_AT91SAM7S*HAtmel definitions for specific processor

General description

The Periodic Interval Timer (PIT) generates the interrupt for the operating system scheduler. It is configured to provide an interval of 0.1 milliseconds.

The Real-Time Timer (RTT), configured for a one-millisecond interval, is utilized by the arGetTickCount function to maintain system time.

The arLock and arRestore functions manage preemption disabling and re-enabling by modifying the standard interrupt (IRQ) enable state.

The arYield function performs a context switch without utilizing an additional software interrupt.

All tasks execute in Supervisor Mode. When the operating system calls the port-specific arSetPreemptiveHandler function, it does not allocate a new stack or task context for the operating system scheduler. This is because the scheduler executes in IRQ Mode, which possesses its own distinct stack and register set.

AT91SAM7S processors support switching to an idle mode. The arSavePower function disables the Processor Clock by writing to the System Clock Disable Register (PMC_SCDR). When the Processor Clock is disabled, the clock stops after the current instruction completes. This action does not affect data transfers initiated by other system bus masters.

Additional configuration

The AR_AT91SAM7S_PITC_PIV constant defines the interval of the Periodic Interval Timer (PIT) used to generate interrupts for the operating system scheduler. The default value is 300, corresponding to a 0.1-millisecond interval. For further details, please refer to the Atmel documentation regarding the PIT on AT91SAM7S processors.

The AR_AT91SAM7S_RTTC_RTPRES constant configures the Real-Time Timer prescaler, adjusting the resolution of values returned by the arGetTickCount function. The default value is 32, providing a one-millisecond interval. For further details, please refer to the Atmel documentation regarding the RTT on AT91SAM7S processors.

Task context

The task context contains all information required to resume the execution of a preempted task. The table below details the 64-byte task context structure for AT91SAM7S processors:

OffsetSizeDescription
00004R15 (PC) register - Task startup procedure
00044R14 register, original Link Register value
00084R12 register
000C4R11 register
00104R10 register
00144R9 register
00184R8 register
001C4R7 register
00204R6 register
00244R5 register
00284R4 register
002C4R3 register
00304R2 register
00344R1 register
00384R0 register
003C4CPSR (Flags) register

SpaceShadow documentation