13
2632D–ATARM–15-Sep-05
AT91FR40162
Programming) is exited by powering down the device or by pulsing the NRSTF pin low for a
defined duration
(1)
and then bringing it back to VDDIO.
The following hardware features protect against inadvertent programming of the Flash
memory:
VDDIO Sense – if VDDIO is below a certain level
(1)
, the program function is inhibited.
VDDIO Power-on Delay – once VDDIO has reached the VDDIO sense level, the device will
automatically time out a certain duration
(1)
before programming.
Program Inhibit – holding any one of OE low, CE high or WE high inhibits program cycles.
Noise Filter – pulses of less than a certain duration
(1)
on the WE or CE inputs will not
initiate a program cycle.
See the AT49BV1604A/1614A(T) 2-Mbyte (1M x 16/2M x 8) 3-volt Only Flash Memory
Datasheet for further details on Flash operation and electrical characteristics.
Note: 1. Defined in the AT49BV1614A Flash Memory Datasheet, Atmel lit° 1411.
7.7 AT91 Flash Uploader Software
All Flash-based AT91 devices are delivered with a pre-programmed software called the AT91
Flash Uploader, which resides in the first sector of the embedded Flash. The Flash Uploader
allows programming to the embedded flash through a serial port. Either of the on-chip
USARTs can be used by the Flash Uploader.
Figure 7-1. Flash Uploader
7.7.1 Flash Uploader Operations
The Flash Uploader requires the encapsulated Flash to be used as the AT91FR40162 boot
memory and a valid clock to be applied to MCKI. After reset, the Flash Uploader immediately
recopies itself into the internal SRAM and jumps to it. The following operation requires this
AT91R40008
USART0
USART1
AT49BV1604A/1614A
Flash Memory
AT91FR40162
Target System
NCSF
NCS0
Programming System
Serial
Port
RS232
Driver
RXD0
RXD1
14
2632D–ATARM–15-Sep-05
AT91FR40162
memory resource only. External accesses are performed only to program the encapsulated
Flash.
When starting, PIO input change interrupts are initialized on the RXD lines of both USARTs.
When an interrupt occurs, a Timer Counter channel is started. When the next input change is
detected on the RXD line, the Timer Counter channel is stopped. This is how the first charac-
ter length is measured and the USART can be initiated by taking into account the ratio
between the device master clock speed and the actual communication baud rate speed.
The Programming System, then, can send commands and data following a proprietary proto-
col for the Flash device to be programmed. It is up to the Programming System to erase and
program the first sector of the Flash as the last step of the operation, in order to reduce, to a
minimum, the risk that the Flash Uploader is erased and the power supply shuts down.
Note that in the event that the Flash Uploader is erased from the first sector while the new final
application is not yet programmed, and while the target system power supply is switched off, it
leads to a non-recoverable error and the AT91FR40162 cannot be re-programmed by using
the Flash Uploader.
7.7.2 Programming System
Atmel provides a free Host Loader that runs on an IBM
®
compatible PC under Windows
®
95 or
Windows
®
98 operating system. It can be downloaded from the Atmel Web site and requires
only a serial cable to connect the Host to the Target.
Communications can be selected on either COM1 or COM2 and the serial link speed is limited
to 115200 bauds. Because the serial link is the bottleneck in this configuration, the Flash pro-
gramming lasts 110 seconds per Mbyte.
Reduced programming time can be achieved by using a faster programming system. An AT91
Evaluation Board is capable of running a serial link at up to 500 Kbits/sec and can match the
fastest programming allowed by the Flash, for example, about 40 seconds per Mbyte when the
word programming becomes the bottleneck.
7.8 Peripherals
The AT91FR40162 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 a word access.
Each peripheral has a 16-Kbyte address space allocated (the AIC only has a 4-Kbyte address
space).
7.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.
15
2632D–ATARM–15-Sep-05
AT91FR40162
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 must be written at 0 for upward compatibility. These bits
read 0.
7.8.2 Peripheral Interrupt Control
The Interrupt Control of each peripheral is controlled from the status register using the inter-
rupt 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 sin-
gle instruction. This eliminates the need for interrupt masking at the AIC or Core level in real-
time and multi-tasking systems.
7.8.3 Peripheral Data Controller
The AT91FR40162 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
contains a 32-bit Address Pointer Register (RPR or TPR) and a 16-bit Transfer Counter Reg-
ister (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.
7.9 System Peripherals
7.9.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 needs.
7.9.2 AIC: Advanced Interrupt Controller
The Advanced Interrupt Controller has an 8-level priority, individually maskable, vectored
interrupt 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 extensively programmable offering maximum flexibility, and its vectoring features
reduce the real-time overhead in handling interrupts.
The AIC also features a spurious vector detection feature, which reduces spurious interrupt
handling to a minimum, and a protect mode that facilitates the debug capabilities.

AT91FR40162-CI

Mfr. #:
Manufacturer:
Description:
IC MCU 16/32BIT 2MB FLASH 121BGA AT91
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet