10
1348FS–ATARM–13-Apr-06
AT91M40800
8. Peripherals
The AT91M40800 microcontroller peripherals are connected to the 32-bit wide Advanced
Peripheral Bus. Peripheral registers are only word accessible – byte and half-word accesses are
not supported. If a byte or a half-word access is attempted, the memory controller automatically
masks the lowest address bits and generates an word access.
Each peripheral has a 16-Kbyte address space allocated (the AIC only has a 4-Kbyte address
space).
8.1 Peripheral Registers
The following registers are common to all peripherals:
Control Register – write only register that triggers a command when a one is written to the
corresponding position at the appropriate address. Writing a zero has no effect.
Mode Register – read/write register that defines the configuration of the peripheral. Usually
has a value of 0x0 after a reset.
Data Registers – read and/or write register that enables the exchange of data between the
processor and the peripheral.
Status Register – read only register that returns the status of the peripheral.
Enable/Disable/Status Registers are shadow command registers. Writing a one in the Enable
Register sets the corresponding bit in the Status Register. Writing a one in the Disable
Register resets the corresponding bit and the result can be read in the Status Register.
Writing a bit to zero has no effect. This register access method maximizes the efficiency of bit
manipulation, and enables modification of a register with a single non-interruptible
instruction, replacing the costly read-modify-write operation.
Unused bits in the peripheral registers are shown as “–” and must be written at 0 for upward
compatibility. These bits read 0.
8.2 Peripheral Interrupt Control
The Interrupt Control of each peripheral is controlled from the status register using the interrupt
mask. The status register bits are ANDed to their corresponding interrupt mask bits and the
result is then ORed to generate the Interrupt Source signal to the Advanced Interrupt Controller.
The interrupt mask is read in the Interrupt Mask Register and is modified with the Interrupt
Enable Register and the Interrupt Disable Register. The enable/disable/status (or mask) makes
it possible to enable or disable peripheral interrupt sources with a non-interruptible single
instruction. This eliminates the need for interrupt masking at the AIC or Core level in real-time
and multi-tasking systems.
8.3 Peripheral Data Controller
The AT91M40800 microcontroller has a 4-channel PDC dedicated to the two on-chip USARTs.
One PDC channel is dedicated to the receiver and one to the transmitter of each USART.
The user interface of a PDC channel is integrated in the memory space of each USART. It con-
tains a 32-bit Address Pointer Register (RPR or TPR) and a 16-bit Transfer Counter Register
(RCR or TCR). When the programmed number of transfers are performed, a status bit indicating
the end of transfer is set in the USART Status Register and an interrupt can be generated.
11
1348FS–ATARM–13-Apr-06
AT91M40800
8.4 System Peripherals
8.4.1 PS: Power-saving
The Power-saving feature optimizes power consumption, enabling the software to stop the
ARM7TDMI clock (idle mode), restarting it when the module receives an interrupt (or reset). It
also enables on-chip peripheral clocks to be enabled and disabled individually, matching power
consumption and application need.
8.4.2 AIC: Advanced Interrupt Controller
The Advanced Interrupt Controller has an 8-level priority, individually maskable, vectored inter-
rupt controller, and drives the NIRQ and NFIQ pins of the ARM7TDMI from:
The external fast interrupt line (FIQ)
The three external interrupt request lines (IRQ0 - IRQ2)
The interrupt signals from the on-chip peripherals.
The AIC is largely programmable offering maximum flexibility, and its vectoring features reduce
the real-time overhead in handling interrupts.
The AIC also features a spurious vector, which reduces spurious interrupt handling to a mini-
mum, and a protect mode that facilitates the debug capabilities.
8.4.3 PIO: Parallel I/O Controller
The AT91M40800 microcontroller has 32 programmable I/O lines. Six pins are dedicated as
general-purpose I/O pins. Other I/O lines are multiplexed with an external signal of a peripheral
to optimize the use of available package pins. The PIO controller enables generation of an inter-
rupt on input change and insertion of a simple input glitch filter on any of the PIO pins.
8.4.4 WD: Watchdog
The Watchdog is built around a 16-bit counter and is used to prevent system lock-up if the soft-
ware becomes trapped in a deadlock. It can generate an internal reset or interrupt, or assert an
active level on the dedicated pin NWDOVF. All programming registers are password-protected
to prevent unintentional programming.
8.4.5 SF: Special Function
The AT91M40800 microcontroller provides registers that implement the following special
functions.
Chip identification
RESET status
Protect mode
12
1348FS–ATARM–13-Apr-06
AT91M40800
8.5 User Peripherals
8.5.1 USART: Universal Synchronous/Asynchronous Receiver Transmitter
The AT91M40800 microcontroller provides two identical, full-duplex, universal synchro-
nous/asynchronous receiver/transmitters.
Each USART has its own baud rate generator, and two dedicated Peripheral Data Controller
channels. The data format includes a start bit, up to 8 data bits, an optional programmable parity
bit and up to 2 stop bits.
The USART also features a Receiver Timeout register, facilitating variable length frame support
when it is working with the PDC, and a Time Guard register, used when interfacing with slow
remote equipment.
8.5.2 TC: Timer Counter
The AT91M40800 microcontroller features a Timer Counter block that includes three identical
16-bit timer counter channels. Each channel can be independently programmed to perform a
wide range of functions including frequency measurement, event counting, interval measure-
ment, pulse generation, delay timing and pulse width modulation.
The Timer Counter can be used in Capture or Waveform mode, and all three counter channels
can be started simultaneously and chained together.

AT91M40800-33AU-999

Mfr. #:
Manufacturer:
Microchip Technology / Atmel
Description:
ARM Microcontrollers - MCU Ind. Temp Green
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union