SAM7S32 Atmel Corporation, SAM7S32 Datasheet

no-image

SAM7S32

Manufacturer Part Number
SAM7S32
Description
Manufacturer
Atmel Corporation
Datasheets

Specifications of SAM7S32

Flash (kbytes)
32 Kbytes
Pin Count
48
Max. Operating Frequency
55 MHz
Cpu
ARM7TDMI
Hardware Qtouch Acquisition
No
Max I/o Pins
21
Ext Interrupts
21
Usb Speed
No
Usb Interface
No
Spi
1
Twi (i2c)
1
Uart
2
Ssc
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
384
Resistive Touch Screen
No
Temp. Sensor
No
Crypto Engine
No
Sram (kbytes)
8
Self Program Memory
NO
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 85
I/o Supply Class
1.8/3.3
Operating Voltage (vcc)
3.0 to 3.6
Fpu
No
Mpu / Mmu
no / no
Timers
3
Output Compare Channels
3
Input Capture Channels
3
Pwm Channels
4
32khz Rtc
Yes
Calibrated Rc Oscillator
No
Features
Incorporates the ARM7TDMI
Internal High-speed Flash
Internal High-speed SRAM, Single-cycle Access at Maximum Speed
Memory Controller (MC)
Reset Controller (RSTC)
Clock Generator (CKGR)
Power Management Controller (PMC)
Advanced Interrupt Controller (AIC)
Debug Unit (DBGU)
Periodic Interval Timer (PIT)
Windowed Watchdog (WDT)
– High-performance 32-bit RISC Architecture
– High-density 16-bit Instruction Set
– Leader in MIPS/Watt
– EmbeddedICE
– 512 Kbytes (SAM7S512) Organized in Two Contiguous Banks of 1024 Pages of 256
– 256 Kbytes (SAM7S256) Organized in 1024 Pages of 256 Bytes (Single Plane)
– 128 Kbytes (SAM7S128) Organized in 512 Pages of 256 Bytes (Single Plane)
– 64 Kbytes (SAM7S64) Organized in 512 Pages of 128 Bytes (Single Plane)
– 32 Kbytes (SAM7S321/32) Organized in 256 Pages of 128 Bytes (Single Plane)
– 16 Kbytes (SAM7S161/16) Organized in 256 Pages of 64 Bytes (Single Plane)
– Single Cycle Access at Up to 30 MHz in Worst Case Conditions
– Prefetch Buffer Optimizing Thumb Instruction Execution at Maximum Speed
– Page Programming Time: 6 ms, Including Page Auto-erase, Full Erase Time: 15 ms
– 10,000 Write Cycles, 10-year Data Retention Capability, Sector Lock Capabilities,
– Fast Flash Programming Interface for High Volume Production
– 64 Kbytes (SAM7S512/256)
– 32 Kbytes (SAM7S128)
– 16 Kbytes (SAM7S64)
– 8 Kbytes (SAM7S321/32)
– 4 Kbytes (SAM7S161/16)
– Embedded Flash Controller, Abort Status and Misalignment Detection
– Based on Power-on Reset and Low-power Factory-calibrated Brown-out Detector
– Provides External Reset Signal Shaping and Reset Source Status
– Low-power RC Oscillator, 3 to 20 MHz On-chip Oscillator and one PLL
– Software Power Optimization Capabilities, Including Slow Clock Mode (Down to
– Three Programmable External Clock Signals
– Individually Maskable, Eight-level Priority, Vectored Interrupt Sources
– Two (SAM7S512/256/128/64/321/161) or One (SAM7S32/16) External Interrupt
– 2-wire UART and Support for Debug Communication Channel interrupt,
– Mode for General Purpose 2-wire UART Serial Communication
– 20-bit Programmable Counter plus 12-bit Interval Counter
– 12-bit key-protected Programmable Counter
– Provides Reset or Interrupt Signals to the System
– Counter May Be Stopped While the Processor is in Debug State or in Idle Mode
Bytes (Dual Plane)
Flash Security Bit
500 Hz) and Idle Mode
Source(s) and One Fast Interrupt Source, Spurious Interrupt Protected
Programmable ICE Access Prevention
In-circuit Emulation, Debug Communication Channel Support
®
ARM
®
Thumb
®
Processor
AT91SAM
ARM-based
Flash MCU
SAM7S512
SAM7S256
SAM7S128
SAM7S64
SAM7S321
SAM7S32
SAM7S161
SAM7S16
6175L–ATARM–28-Jul-11

Related parts for SAM7S32

SAM7S32 Summary of contents

Page 1

... Kbytes (SAM7S128) Organized in 512 Pages of 256 Bytes (Single Plane) – 64 Kbytes (SAM7S64) Organized in 512 Pages of 128 Bytes (Single Plane) – 32 Kbytes (SAM7S321/32) Organized in 256 Pages of 128 Bytes (Single Plane) – 16 Kbytes (SAM7S161/16) Organized in 256 Pages of 64 Bytes (Single Plane) – ...

Page 2

... One Three-channel 16-bit Timer/Counter (TC) – Three External Clock Input and Two Multi-purpose I/O Pins per Channel (SAM7S512/256/128/64/321/161) – One External Clock Input and Two Multi-purpose I/O Pins for the first Two Channels Only (SAM7S32/16) – Double PWM Generation, Capture/Waveform Mode, Up/Down Capability • ...

Page 3

... Atmel’s SAM7S is a series of low pincount Flash microcontrollers based on the 32-bit ARM RISC processor. It features a high-speed Flash and an SRAM, a large set of peripherals, including a USB 2.0 device (except for the SAM7S32 and SAM7S16), and a complete set of system func- tions minimizing the number of external components. The device is an ideal migration path for 8- bit microcontroller users looking for additional performance and extended memory ...

Page 4

Block Diagram Figure 2-1. SAM7S512/256/128/64/321/161 Block Diagram TDI TDO JTAG TMS SCAN TCK JTAGSEL System Controller TST FIQ IRQ0-IRQ1 PCK0-PCK2 PLLRC PLL XIN OSC XOUT RCOSC VDDCORE BOD POR VDDCORE NRST DRXD DTXD RXD0 TXD0 SCK0 RTS0 CTS0 RXD1 ...

Page 5

... Figure 2-2. SAM7S32/16 Block Diagram TDI TDO TMS TCK JTAGSEL System Controller TST FIQ IRQ0 PCK0-PCK2 PLLRC PLL XIN OSC XOUT VDDCORE BOD POR VDDCORE NRST DRXD DTXD RXD0 TXD0 SCK0 RTS0 CTS0 NPCS0 NPCS1 NPCS2 NPCS3 MISO MOSI SPCK ADTRG AD0 ...

Page 6

... Comments 3.0 to 3.6V 1.85V nominal 3.0V to 3.6V 3.0V to 3.6V or 1.65V to 1.95V 1.65V to 1.95V 1.65V to 1.95V No pull-up resistor No pull-up resistor No pull-up resistor (1) Pull-down resistor (1) Pull-down resistor Open-drain with pull-Up resistor (1) Pull-down resistor IRQ1 not present on SAM7S32/16 Pulled-up input at reset PA0 - PA20 only on SAM7S32/16 6175L–ATARM–28-Jul-11 ...

Page 7

... Comments not present on SAM7S32/16 not present on SAM7S32/16 SCK1 not present on SAM7S32/16 TXD1 not present on SAM7S32/16 RXD1 not present on SAM7S32/16 RTS1 not present on SAM7S32/16 CTS1 not present on SAM7S32/16 not present on SAM7S32/16 not present on SAM7S32/16 not present on SAM7S32/16 not present on SAM7S32/16 TCLK1 and TCLK2 not present on ...

Page 8

... Active Type Level Two-Wire Interface I/O I/O Analog-to-Digital Converter Analog Analog Input Analog Fast Flash Programming Interface Input Input I/O Output High Output Low Input Low Input Input Low 14. Comments Digital pulled-up inputs at reset Analog Inputs PGMD0-PGMD7 only on SAM7S32/16 6175L–ATARM–28-Jul-11 ...

Page 9

... Package and Pinout The SAM7S512/256/128/64/321 are available in a 64-lead LQFP or 64-pad QFN package. The SAM7S161 is available in a 64-Lead LQFP package. The SAM7S32/16 are available in a 48-lead LQFP or 48-pad QFN package. 4.1 64-lead LQFP and 64-pad QFN Package Outlines Figure 4-1 age. A detailed mechanical description is given in the section Mechanical Characteristics of the full datasheet ...

Page 10

LQFP and 64-pad QFN Pinout Table 4-1. SAM7S512/256/128/64/321/161 Pinout 1 ADVREF 17 2 GND 18 3 AD4 19 4 AD5 20 5 AD6 21 6 AD7 22 7 VDDIN 23 8 VDDOUT 24 9 PA17/PGMD5/AD0 25 10 PA18/PGMD6/AD1 ...

Page 11

... LQFP and 48-pad QFN Package Outlines Figure 4-3 age. A detailed mechanical description is given in the section Mechanical Characteristics of the full datasheet. Figure 4-3. Figure 4-4. 4.4 48-lead LQFP and 48-pad QFN Pinout Table 4-2. SAM7S32/16 Pinout 1 ADVREF 13 2 GND 14 3 AD4 15 4 AD5 16 5 AD6 17 6 AD7 ...

Page 12

Power Considerations 5.1 Power Supplies The SAM7S Series has six types of power supply pins and integrates a voltage regulator, allow- ing the device to be supplied with only one voltage. The six power supply pin types are: • ...

Page 13

Adequate input supply decoupling is mandatory for VDDIN in order to improve startup stability and reduce source voltage drop. The input decoupling capacitor should be placed close to the chip. For example, two capacitors can be used in parallel: 100 ...

Page 14

... PIO Controller A Lines • All the I/O lines PA0 to PA31on SAM7S512/256/128/64/321 (PA0 to PA20 on SAM7S32) are 5V-tolerant and all integrate a programmable pull-up resistor. • All the I/O lines PA0 to PA31 on SAM7S161 (PA0 to PA20 on SAM7S16) are not 5V-tolerant and all integrate a programmable pull-up resistor. ...

Page 15

... The PIO lines PA0 to PA3 are high-drive current capable. Each of these I/O lines can drive permanently. The remaining I/O lines can draw only 8 mA. However, the total current drawn by all the I/O lines cannot exceed 150 mA (100 mA for SAM7S32/16). 6175L–ATARM–28-Jul-11 SAM7S Series 15 ...

Page 16

Processor and Architecture 7.1 ARM7TDMI Processor • RISC processor based on ARMv4T Von Neumann architecture – Runs MHz, providing 0.9 MIPS/MHz • Two instruction sets – ARM – Thumb • Three-stage pipeline architecture – Instruction ...

Page 17

... Peripheral DMA Controller • Handles data transfer between peripherals and memories • Eleven channels: SAM7S512/256/128/64/321/161 • Nine channels: SAM7S32/16 – Two for each USART – Two for the Debug Unit – Two for the Serial Synchronous Controller – Two for the Serial Peripheral Interface – ...

Page 18

Memories 8.1 SAM7S512 • 512 Kbytes of Flash Memory, dual plane – 2 contiguous banks of 1024 pages of 256 bytes – Fast access time, 30 MHz single-cycle access in Worst Case conditions – Page programming time: 6 ms, ...

Page 19

... Protection Mode to secure contents of the Flash • 16 Kbytes of Fast SRAM – Single-cycle access at full speed 8.5 SAM7S321/32 • 32 Kbytes of Flash Memory, single plane – 256 pages of 128 bytes – Fast access time, 30 MHz single-cycle access in Worst Case conditions – Page programming time: 6 ms, including page auto-erase – ...

Page 20

... BFFF 0xFFFB C000 Reserved 0xFFFB FFFF 0xFFFC 0000 USART0 16 Kbytes 0xFFFC 3FFF 16 Kbytes 0xFFFC 4000 USART1 (Reserved on 0xFFFC 7FFF SAM7S32/16) 0xFFFC 8000 Reserved 0xFFFC BFFF 0xFFFC C000 PWMC 16 Kbytes 0xFFFC FFFF 0xFFFD 0000 Reserved 0xFFFD 3FFF 0xFFFD 4000 SSC 16 Kbytes ...

Page 21

... The SAM7S128 features one bank (single plane) of 128 Kbytes of Flash. • The SAM7S64 features one bank (single plane Kbytes of Flash. • The SAM7S321/32 features one bank (single plane Kbytes of Flash. • The SAM7S161/16 features one bank (single plane Kbytes of Flash. ...

Page 22

... The Flash of the SAM7S64 is organized in 512 pages (single plane) of 128 bytes. The 65,536 bytes are organized in 32-bit words. • The Flash of the SAM7S321/32 is organized in 256 pages (single plane) of 128 bytes. The 32,768 bytes are organized in 32-bit words. • The Flash of the SAM7S161/16 is organized in 256 pages (single plane bytes. The 16,384 bytes are organized in 32-bit words. • ...

Page 23

Lock Regions 8.8.3.1 SAM7S512 Two Embedded Flash Controllers each manage 16 lock bits to protect 16 regions of the flash against inadvertent flash erasing or programming commands. The SAM7S512 contains 32 lock regions and each lock region contains 64 ...

Page 24

... SAM7S321/32 The Embedded Flash Controller manages 8 lock bits to protect 8 regions of the flash against inadvertent flash erasing or programming commands. The SAM7S321/32 contains 8 lock regions and each lock region contains 32 pages of 128 bytes. Each lock region has a size of 4 Kbytes locked-region’s erase or program command occurs, the command is aborted and the LOCKE bit in the MC_FSR register rises and the interrupt line rises if the LOCKE bit has been written the MC_FMR register ...

Page 25

... Flash memory. The SAM-BA Boot Assistant supports serial communication through the DBGU or through the USB Device Port. (The SAM7S32/16 have no USB Device Port.) • Communication through the DBGU supports a wide range of crystals from MHz via software auto-detection. ...

Page 26

Communication through the USB Device Port is limited to an 18.432 MHz crystal. ( The SAM-BA Boot provides an interface with SAM-BA Graphic User Interface (GUI). 9. System Controller The System Controller manages all vital blocks of the microcontroller: ...

Page 27

Figure 9-1. System Controller Block Diagram (SAM7S512/256/128/64/321/161) irq0-irq1 periph_irq[2..14] pit_irq rtt_irq wdt_irq dbgu_irq pmc_irq rstc_irq MCK periph_nreset dbgu_rxd MCK debug power_on_reset SLCK power_on_reset SLCK debug proc_nreset cal gpnvm[0] en BOD POR NRST SLCK SLCK RCOSC XIN MAINCK OSC XOUT PLL ...

Page 28

... Figure 9-2. System Controller Block Diagram (SAM7S32/16) irq0 fiq periph_irq[2..14] pit_irq rtt_irq wdt_irq dbgu_irq pmc_irq rstc_irq MCK periph_nreset dbgu_rxd MCK debug periph_nreset SLCK power_on_reset SLCK debug idle proc_nreset cal gpnvm[0] en BOD POR NRST SLCK SLCK RCOSC XIN MAINCK OSC XOUT PLL PLLRC ...

Page 29

Reset Controller The Reset Controller is based on a power-on reset cell and one brownout detector. It gives the status of the last reset, indicating whether power-up reset, a software reset, a user reset, a watchdog ...

Page 30

... The Power Management Controller uses the Clock Generator outputs to provide: • the Processor Clock PCK • the Master Clock MCK • the USB Clock UDPCK (not present on SAM7S32/16) • all the peripheral clocks, independently controllable • three programmable clock outputs The Master Clock (MCK) is programmable from a few hundred Hz to the maximum operating fre- quency of the device ...

Page 31

Figure 9-4. 9.4 Advanced Interrupt Controller • Controls the interrupt lines (nIRQ and nFIQ ARM Processor • Individually maskable and vectored interrupt sources – Source 0 is reserved for the Fast Interrupt Input (FIQ) – Source 1 is ...

Page 32

... Chip ID is 0x27090544 for AT91SAM7S64 Rev C – Chip ID is 0x27080342 for AT91SAM7S321 Rev A – Chip ID is 0x27080340 for AT91SAM7S32 Rev A – Chip ID is 0x27080341 for AT91SAM7S32 Rev B – Chip ID is 0x27050241 for AT9SAM7S161 Rev A – Chip ID is 0x27050240 for AT91SAM7S16 Rev A Note: 9 ...

Page 33

... Programmable 16-bit prescaler for SLCK accuracy compensation 9.9 PIO Controller • One PIO Controller, controlling 32 I/O lines (21 for SAM7S32/16) • Fully programmable through set/clear registers • Multiplexing of two peripheral functions per I/O line • For each I/O line (whether assigned to a peripheral or used as general-purpose I/O) – ...

Page 34

... Peripheral Identifiers The SAM7S Series embeds a wide range of peripherals. tifiers of the SAM7S512/256/128/64/321/161. SAM7S32/16. A peripheral identifier is required for the control of the peripheral interrupt with the Advanced Interrupt Controller and for the control of the peripheral clock with the Power Manage- ment Controller. ...

Page 35

... The SAM7S Series features one PIO controller, PIOA, that multiplexes the I/O lines of the peripheral set. PIO Controller A controls 32 lines (21 lines for SAM7S32/16). Each line can be assigned to one of two peripheral functions Some of them can also be multiplexed with the analog inputs of the ADC Controller. ...

Page 36

PIO Controller A Multiplexing Table 10-3. Multiplexing on PIO Controller A (SAM7S512/256/128/64/321/161) PIO Controller A I/O Line Peripheral A PA0 PWM0 PA1 PWM1 PA2 PWM2 PA3 TWD PA4 TWCK PA5 RXD0 PA6 TXD0 PA7 RTS0 PA8 CTS0 PA9 DRXD ...

Page 37

... Table 10-4. Multiplexing on PIO Controller A (SAM7S32/16) PIO Controller A I/O Line Peripheral A PA0 PWM0 PA1 PWM1 PA2 PWM2 PA3 TWD PA4 TWCK PA5 RXD0 PA6 TXD0 PA7 RTS0 PA8 CTS0 PA9 DRXD PA10 DTXD PA11 NPCS0 PA12 MISO PA13 MOSI PA14 SPCK PA15 TF PA16 ...

Page 38

... Multi-drop Mode with address generation and detection • RS485 with driver control signal SAM7S Series 38 peripherals Sensors and data per chip select 2 compatible devices (refer to the TWI sections of the datasheet SAM7S32/16) ® and 3-wire EEPROMs 6175L–ATARM–28-Jul-11 ...

Page 39

... Receiver and transmitter include a data signal, a clock signal and a frame synchronization signal 10.9 Timer Counter • Three 16-bit Timer Counter Channels – Two output compare or one input capture per channel (except for SAM7S32/16 • Wide range of functions including: – Frequency measurement – Event counting – Interval measurement – ...

Page 40

... Independent period and duty cycle, with double buffering – Programmable selection of the output waveform polarity – Programmable center or left aligned output waveform 10.11 USB Device Port (Does not pertain to SAM7S32/16) • USB V2.0 full-speed compliant, 12 Mbits per second. • Embedded USB V2.0 full-speed transceiver • ...

Page 41

ARM7TDMI Processor Overview 11.1 Overview The ARM7TDMI core executes both the 32-bit ARM ing the user to trade off between high performance and high code density.The ARM7TDMI processor implements Von Neuman architecture, using a three-stage pipeline consisting of Fetch, ...

Page 42

ARM7TDMI Processor For further details on ARM7TDMI, refer to the following ARM documents: ARM Architecture Reference Manual (DDI 0100E) ARM7TDMI Technical Reference Manual (DDI 0210B) 11.2.1 Instruction Type Instructions are either 32 bits long (in ARM state ...

Page 43

Table 11-1. User and System Mode R10 R11 R12 R13 R14 PC CPSR Registers are unbanked registers. This means that each of them refers to the same ...

Page 44

A seventh processing mode, System Mode, does not have any banked registers. It uses the User Mode registers. System Mode runs tasks that require a privileged processor mode and allows them to invoke all classes of exceptions. 11.2.4.2 Status Registers ...

Page 45

Table 11-2. Mnemonic MOV ADD SUB RSB CMP TST AND EOR MUL SMULL SMLAL MSR B BX LDR LDRSH LDRSB LDRH LDRB LDRBT LDRT LDM SWP MCR LDC 11.2.6 Thumb Instruction Set Overview The Thumb instruction set is a re-encoded ...

Page 46

Stack Pointer (ARM Register 13). Further instructions allow limited access to the ARM registers 8 to 15. Table 11-3 Table 11-3. Mnemonic MOV ADD SUB CMP TST AND EOR LSL ASR MUL B BX LDR LDRH LDRB LDRSH LDMIA PUSH ...

Page 47

Debug and Test Features 12.1 Description The SAM7S Series Microcontrollers feature a number of complementary debug and test capabil- ities. A common JTAG/ICE (EmbeddedICE) port is used for standard debugging functions, such as downloading code and single-stepping through programs. ...

Page 48

Application Examples 12.3.1 Debug Environment Figure 12-2 on page 48 face is used for standard debugging functions, such as downloading code and single-stepping through the program. Figure 12-2. Application Debug Environment Example SAM7S Series 48 shows a complete debug ...

Page 49

Test Environment Figure 12-3 on page 49 preted by the tester. In this example, the “board in test” is designed using a number of JTAG- compliant devices. These devices can be connected to form a single scan chain. Figure ...

Page 50

Debug and Test Pin Description Table 12-1. Pin Name NRST TST TCK TDI TDO TMS JTAGSEL DRXD DTXD SAM7S Series 50 Debug and Test Pin List Function Reset/Test Microcontroller Reset Test Mode Select ICE and JTAG Test Clock Test ...

Page 51

... A specific register, the Debug Unit Chip ID Register, gives information about the product version and its internal configuration. Table 12-2. Chip Name AT91SAM7S16 Rev A AT91SAM7S161 Rev A AT91SAM7S32 Rev A AT91SAM7S32 Rev B AT91SAM7S321 Rev A AT91SAM7S64 Rev A AT91SAM7S64 Rev B 6175L–ATARM–28-Jul-11 SAM7S Series Debug Unit Chip ID SAM7S Series Chip ID 0x27050240 ...

Page 52

Table 12-2. AT91SAM7S64 Rev C AT91SAM7S128 Rev A AT91SAM7S128 Rev B AT91SAM7S128 Rev C AT91SAM7S256 Rev A AT91SAM7S256 Rev B AT91SAM7S256 Rev C AT91SAM7S512 Rev A AT91SAM7S512 Rev B For further details on the Debug Unit, see the Debug Unit ...

Page 53

Table 12-3. Bit Number 6175L–ATARM–28-Jul-11 SAM7Sxx JTAG Boundary Scan Register (Continued) Pin Name 90 89 PA21/PGMD9 PA19/PGMD7/AD2 PA20/PGMD8/AD3 PA16/PGMD4 PA15/PGM3 PA14/PGMD2 PA13/PGMD1 ...

Page 54

Table 12-3. Bit Number SAM7S Series 54 SAM7Sxx JTAG Boundary Scan Register (Continued) Pin Name 57 56 PA11/PGMM3 PA10/PGMM2 PA9/PGMM1 PA8/PGMM0 PA7/PGMNVALID PA6/PGMNOE 40 39 ...

Page 55

... PA2 PA1/PGMEN1 PA0/PGMEN0 PA29 PA30 PA31 1 0 ERASE 1. Does not pertain to SAM7S32. SAM7S Series Associated BSR Pin Type Cells (1) INPUT (1) IN/OUT OUTPUT (1) CONTROL INPUT IN/OUT OUTPUT CONTROL INPUT IN/OUT OUTPUT CONTROL INPUT IN/OUT OUTPUT CONTROL INPUT ...

Page 56

... Chip Name AT91SAM7S16 AT91SAM7S161 AT91SAM7S32 AT91SAM7S321 AT91SAM7S64 AT91SAM7S128 AT91SAM7S256 AT91SAM7S512 • MANUFACTURER IDENTITY[11:1] Set to 0x01F. • Bit[0] Required by IEEE Std. 1149.1. Set to 0x1. Chip Name AT91SAM7S16 AT91SAM7S161 AT91SAM7S32 AT91SAM7S321 AT91SAM7S64 AT91SAM7S128 AT91SAM7S256 AT91SAM7S512 SAM7S Series PART NUMBER ...

Page 57

Reset Controller (RSTC) 13.1 Overview The Reset Controller (RSTC), based on power-on reset cells, handles all the resets of the sys- tem without any external components. It reports which reset occurred last. The Reset Controller also drives independently or ...

Page 58

Functional Description 13.3.1 Reset Controller Overview The Reset Controller is made NRST Manager, a Brownout Manager, a Startup Counter and a Reset State Manager. It runs at Slow Clock and generates the following reset signals: • ...

Page 59

NRST External Reset Control The Reset State Manager asserts the signal ext_nreset to assert the NRST pin. When this occurs, the “nrst_out” signal is driven low by the NRST Manager for a time programmed by the field ERSTL in ...

Page 60

Reset States The Reset State Manager handles the different reset sources and generates the internal reset signals. It reports the reset status in the field RSTTYP of the Status Register (RSTC_SR). The update of the field RSTTYP is performed ...

Page 61

User Reset The User Reset is entered when a low level is detected on the NRST pin and the bit URSTEN in RSTC_MR The NRST input signal is resynchronized with SLCK to insure proper behav- ior ...

Page 62

Brownout Reset When the brown_out/bod_reset signal is asserted, the Reset State Manager immediately enters the Brownout Reset. In this state, the processor, the peripheral and the external reset lines are asserted. The Brownout Reset is left Y Slow Clock ...

Page 63

Software Reset The Reset Controller offers several commands used to assert the different reset signals. These commands are performed by writing the Control Register (RSTC_CR) with the following bits at 1: • PROCRST: Writing PROCRST at 1 resets the ...

Page 64

Figure 13-7. Software Reset 13.3.4.5 Watchdog Reset The Watchdog Reset is entered when a watchdog fault occurs. This state lasts Y Slow Clock cycles. When in Watchdog Reset, assertion of the reset signals depends on the WDRPROC bit in WDT_MR: ...

Page 65

Figure 13-8. Watchdog Reset Only if WDRPROC = 0 6175L–ATARM–28-Jul-11 SLCK Any MCK Freq. wd_fault proc_nreset RSTTYP Any periph_nreset NRST (nrst_out) SAM7S Series Processor Startup = 3 cycles XXX 0x2 = Watchdog Reset EXTERNAL RESET LENGTH 8 cycles (ERSTL=2) 65 ...

Page 66

Reset State Priorities The Reset State Manager manages the following priorities between the different reset sources, given in descending order: • Power-up Reset • Brownout Reset • Watchdog Reset • Software Reset • User Reset Particular cases are listed ...

Page 67

Figure 13-9. Reset Controller Status and Interrupt MCK Peripheral Access 2 cycle resynchronization NRST NRSTL URSTS rstc_irq if (URSTEN = 0) and (URSTIEN = 1) 6175L–ATARM–28-Jul-11 SAM7S Series read RSTC_SR 2 cycle resynchronization 67 ...

Page 68

Reset Controller (RSTC) User Interface Table 13-1. Register Mapping Offset Register 0x00 Control Register 0x04 Status Register 0x08 Mode Register SAM7S Series 68 Name Access RSTC_CR Write-only RSTC_SR Read-only RSTC_MR Read-write Reset - 0x0000_0000 0x0000_0000 6175L–ATARM–28-Jul-11 ...

Page 69

Reset Controller Control Register Register Name: RSTC_CR Access Type: Write-only – – – – – – • PROCRST: Processor Reset effect KEY is correct, resets ...

Page 70

Reset Controller Status Register Register Name: RSTC_SR Access Type: Read-only 31 30 – – – – – – – – • URSTS: User Reset Status high-to-low edge on NRST happened ...

Page 71

Reset Controller Mode Register Register Name: RSTC_MR Access Type: Read/Write – – – – – – • URSTEN: User Reset Enable 0 = The detection of a low level on the ...

Page 72

SAM7S Series 72 6175L–ATARM–28-Jul-11 ...

Page 73

Real-time Timer (RTT) 14.1 Overview The Real-time Timer is built around a 32-bit counter and used to count elapsed seconds. It gen- erates a periodic interrupt or/and triggers an alarm on a programmed value. 14.2 Block Diagram Figure 14-1. ...

Page 74

The Real-time Timer value (CRTV) can be read at any time in the register RTT_VR (Real-time Value Register). As this value can be updated asynchronously from the Master Clock advis- able to read this register twice at the ...

Page 75

Real-time Timer (RTT) User Interface Table 14-1. Register Mapping Offset Register 0x00 Mode Register 0x04 Alarm Register 0x08 Value Register 0x0C Status Register 6175L–ATARM–28-Jul-11 SAM7S Series Name Access RTT_MR Read-write RTT_AR Read-write RTT_VR Read-only RTT_SR Read-only Reset 0x0000_8000 0xFFFF_FFFF ...

Page 76

Real-time Timer Mode Register Register Name: RTT_MR Access Type: Read-write 31 30 – – – – • RTPRES: Real-time Timer Prescaler Value Defines the number of SLCK periods required to increment the real-time ...

Page 77

Real-time Timer Alarm Register Register Name: RTT_AR Access Type: Read-write • ALMV: Alarm Value Defines the alarm value (ALMV+1) compared with the Real-time Timer. 6175L–ATARM–28-Jul- ALMV 21 20 ...

Page 78

Real-time Timer Value Register Register Name: RTT_VR Access Type: Read-only • CRTV: Current Real-time Value Returns the current value of the Real-time Timer. SAM7S Series CRTV 21 ...

Page 79

Real-time Timer Status Register Register Name: RTT_SR Access Type: Read-only 31 30 – – – – – – – – • ALMS: Real-time Alarm Status 0 = The Real-time Alarm has not occurred ...

Page 80

SAM7S Series 80 6175L–ATARM–28-Jul-11 ...

Page 81

Periodic Interval Timer (PIT) 15.1 Overview The Periodic Interval Timer (PIT) provides the operating system’s scheduler interrupt designed to offer maximum accuracy and efficient management, even for systems with long response time. 15.2 Block Diagram Figure 15-1. ...

Page 82

Functional Description The Periodic Interval Timer aims at providing periodic interrupts for use by operating systems. The PIT provides a programmable overflow counter and a reset-on-read feature built around two counters: a 20-bit CPIV counter and a ...

Page 83

Figure 15-2. Enabling/Disabling PIT with PITEN 15 MCK Prescaler 0 PITEN CPIV 0 PICNT PITS (PIT_SR) APB Interface 6175L–ATARM–28-Jul-11 MCK 1 PIV - 1 PIV 1 0 read PIT_PIVR SAM7S Series APB cycle APB cycle restarts MCK Prescaler 0 0 ...

Page 84

Periodic Interval Timer (PIT) User Interface Table 15-1. Register Mapping Offset Register 0x00 Mode Register 0x04 Status Register 0x08 Periodic Interval Value Register 0x0C Periodic Interval Image Register SAM7S Series 84 Name Access PIT_MR Read-write PIT_SR Read-only PIT_PIVR Read-only ...

Page 85

Periodic Interval Timer Mode Register Register Name: PIT_MR Access Type: Read-write 31 30 – – – – • PIV: Periodic Interval Value Defines the value compared with the primary 20-bit counter of the ...

Page 86

Periodic Interval Timer Status Register Register Name: PIT_SR Access Type: Read-only 31 30 – – – – – – – – • PITS: Periodic Interval Timer Status 0 = The Periodic Interval timer ...

Page 87

Periodic Interval Timer Value Register Register Name: PIT_PIVR Access Type: Read-only PICNT Reading this register clears PITS in PIT_SR. • CPIV: Current Periodic Interval Value Returns the current value of the ...

Page 88

Periodic Interval Timer Image Register Register Name: PIT_PIIR Access Type: Read-only PICNT • CPIV: Current Periodic Interval Value Returns the current value of the periodic interval timer. • PICNT: Periodic Interval ...

Page 89

Watchdog Timer (WDT) 16.1 Overview The Watchdog Timer can be used to prevent system lock-up if the software becomes trapped in a deadlock. It features a 12-bit down counter that allows a watchdog period seconds ...

Page 90

Functional Description The Watchdog Timer can be used to prevent system lock-up if the software becomes trapped in a deadlock supplied with VDDCORE. It restarts with initial values on processor reset. The Watchdog is built around a ...

Page 91

Figure 16-2. Watchdog Behavior FFF Normal behavior WDV Forbidden Window WDD Permitted Window 0 Watchdog Fault 6175L–ATARM–28-Jul-11 Watchdog Error WDT_CR = WDRSTT SAM7S Series Watchdog Underflow if WDRSTEN WDRSTEN ...

Page 92

Watchdog Timer (WDT) User Interface Table 16-1. Register Mapping Offset Register 0x00 Control Register 0x04 Mode Register 0x08 Status Register 16.4.1 Watchdog Timer Control Register Register Name: WDT_CR Access Type: Write-only – – ...

Page 93

Watchdog Timer Mode Register Register Name: WDT_MR Access Type: Read-write Once 31 30 – – WDIDLEHLT WDDIS WDRPROC WDRSTEN 7 6 • WDV: Watchdog Counter Value Defines the value loaded in the 12-bit Watchdog Counter. ...

Page 94

WDDIS: Watchdog Disable 0: Enables the Watchdog Timer. 1: Disables the Watchdog Timer. 16.4.3 Watchdog Timer Status Register Register Name: WDT_SR Access Type: Read-only 31 30 – – – – – – – ...

Page 95

Voltage Regulator Mode Controller (VREG) 17.1 Overview The Voltage Regulator Mode Controller contains one Read/Write register, the Voltage Regulator Mode Register. Its offset is 0x60 with respect to the System Controller offset. This register controls the Voltage Regulator Mode. ...

Page 96

Voltage Regulator Power Controller (VREG) User Interface Table 17-1. Register Mapping Offset Register 0x60 Voltage Regulator Mode Register 17.2.1 Voltage Regulator Mode Register Register Name: VREG_MR Access Type: Read-write 31 30 – – – – ...

Page 97

Memory Controller (MC) 18.1 Overview The Memory Controller (MC) manages the ASB bus and controls accesses requested by the masters, typically the ARM7TDMI processor and the Peripheral DMA Controller. It features a simple bus arbiter, an address decoder, an ...

Page 98

Functional Description The Memory Controller handles the internal ASB bus and arbitrates the accesses of both masters made up of: • A bus arbiter • An address decoder • An abort status • A misalignment detector • ...

Page 99

Internal Memory Mapping Within the Internal Memory address space, the Address Decoder of the Memory Controller decodes eight more address bits to allocate 1-Mbyte address spaces for the embedded memories. The allocated memories are accessed all along the 1-Mbyte ...

Page 100

Abort Status There are three reasons for an abort to occur: • access to an undefined address • an access to a misaligned address. When an abort occurs, a signal is sent back to all the masters, regardless of ...

Page 101

As the requested address is saved in the Abort Status Register and the address of the instruc- tion generating the misalignment is saved in the Abort Link Register of the processor, detection and fix of this kind of software bug ...

Page 102

MC Remap Control Register Register Name: MC_RCR Access Type: Write-only Offset: 0x00 31 30 – – – – – – – – • RCB: Remap Command Bit 0: No effect. 1: This Command ...

Page 103

MC Abort Status Register Register Name: MC_ASR Access Type: Read-only Reset Value: 0x0 Offset: 0x04 31 30 – – – – – – – – • UNDADD: Undefined Address Abort Status 0: The ...

Page 104

MST1: ARM7TDMI Abort Source 0: The last aborted access was not due to the ARM7TDMI. 1: The last aborted access was due to the ARM7TDMI. • SVMST0: Saved PDC Abort Source 0: No abort due to the PDC occurred. ...

Page 105

... Table 19-1. Product Specific Lock and General-purpose NVM Bits SAM7S512 SAM7S256 SAM7S128 6175L–ATARM–28-Jul-11 SAM7S64 SAM7S321 SAM7S32 SAM7S Series “Read Operations” on page “Write Operations” on page 109). SAM7S161 SAM7S16 Denomination 2 ...

Page 106

Figure 19-1. Embedded Flash Memory Mapping SAM7S Series 106 Flash Memory Start Address Lock Region 0 Lock Region 1 Lock Region (n-1) 32-bit wide Page 0 Lock Bit 0 Page (m-1) Lock Bit 1 Page ( (n-1)*m ) Lock Bit ...

Page 107

Read Operations An optimized controller manages embedded Flash reads. A system 32-bit buffers is added in order to start access at following address during the second read, thus increasing perfor- mance when the processor is running ...

Page 108

Note: When FWS is equal case of sequential reads, all the accesses are performed in a single-cycle access (except for the first one). Figure 19-4. Code Read Optimization in Thumb Mode for FWS = 3 3 Wait ...

Page 109

Write Operations The internal memory area reserved for the embedded Flash can also be written through a write- only latch buffer. Write operations take into account only the 8 lowest address bits and thus wrap around within the internal ...

Page 110

Figure 19-5. Command State Chart In order to guarantee valid operations on the Flash memory, the field Flash Microsecond Cycle Number (FMCN) in the Flash Mode Register MC_FMR must be correctly programmed (see Flash Mode Register” on page 19.2.4.1 Flash ...

Page 111

Figure 19-6. Example of Partial Page Programming 32 bits wide ... 16 words ... 16 words ...

Page 112

Erase All operation is allowed only if there are no lock bits set. Thus least one lock region is locked, the bit LOCKE in MC_FSR rises and the command is cancelled. If the bit LOCKE has been written ...

Page 113

General-purpose NVM Bits General-purpose NVM bits do not interfere with the embedded Flash memory plane. (Does not apply to EFC1 on the SAM7S512.) These general-purpose bits are dedicated to protect other parts of the product. They can be set ...

Page 114

When the locking completes, the bit FRDY in the Flash Programming Status Register (MC_FSR) rises interrupt has been enabled by setting the bit FRDY in MC_FMR, the interrupt line of the Memory Controller is activated. When the ...

Page 115

Embedded Flash Controller (EFC) User Interface The User Interface of the EFC is integrated within the Memory Controller with Base Address: 0xFFFF FF00. The SAM7S512 is equipped with two EFCs, EFC0 and EFC1, as described in the Register Mapping ...

Page 116

MC Flash Mode Register Register Name: MC_FMR Access Type: Read-write Offset: (EFC0) 0x60 Offset: (EFC1) 0x70 31 30 – – – – NEBP – • FRDY: Flash Ready Interrupt Enable 0: Flash Ready ...

Page 117

FMCN: Flash Microsecond Cycle Number Before writing Non Volatile Memory bits (Lock bits, General Purpose NVM bit and Security bits), this field must be set to the number of Master Clock cycles in one microsecond. When writing the rest ...

Page 118

MC Flash Command Register Register Name: MC_FCR Access Type: Write-only Offset: (EFC0) 0x64 Offset: (EFC1) 0x74 – – – – • FCMD: Flash Command This field defines the Flash commands: FCMD ...

Page 119

PAGEN: Page Number Command Write Page Command Write Page and Lock Command Erase All Command Set/Clear Lock Bit Command Set/Clear General Purpose NVM Bit Command Set Security Bit Command Note: Depending on the command, all the possible unused bits ...

Page 120

MC Flash Status Register Register Name: MC_FSR Access Type: Read-only Offset: (EFC0) 0x68 Offset: (EFC1) 0x78 31 30 LOCKS15 LOCKS14 LOCKS13 23 22 LOCKS7 LOCKS6 15 14 – – – – • FRDY: Flash Ready Status 0: ...

Page 121

... LOCKS9 – – LOCKS10 – – LOCKS11 – – LOCKS12 – – LOCKS13 – – LOCKS14 – – LOCKS15 – SAM7S Series SAM7S32 SAM7S161 SAM7S16 LOCKS0 LOCKS0 LOCKS0 LOCKS1 LOCKS1 LOCKS1 LOCKS2 LOCKS2 LOCKS2 LOCKS3 LOCKS3 LOCKS3 LOCKS4 LOCKS4 LOCKS4 ...

Page 122

SAM7S Series 122 6175L–ATARM–28-Jul-11 ...

Page 123

Fast Flash Programming Interface (FFPI) 20.1 Overview The Fast Flash Programming Interface provides two solutions - parallel or serial - for high-vol- ume programming using a standard gang programmer. The parallel interface is fully handshaked and the device is ...

Page 124

... Parallel Fast Flash Programming 20.2.1 Device Configuration In Fast Flash Programming Mode, the device specific test mode. Only a certain set of pins is significant. Other pins must be left unconnected. Figure 20-1. SAM7S512/256/128/64/321/161 Parallel Programming Interface Figure 20-2. SAM7S32/16 Parallel Programming Interface SAM7S Series 124 TST VDDIO VDDIO ...

Page 125

... Output Enable (active high) 0: DATA[15:0] or DATA[7:0] PGMNVALID 1: DATA[15:0] or DATA[7:0] PGMM[3:0] Specifies DATA type (See (2) PGMD[15:0] or [7:0] Bi-directional data bus Notes: 1. DATA[7:0] pertains to the SAM7S32/16. 2. PGMD[7:0] pertains to the SAM7S32/16. 6175L–ATARM–28-Jul-11 Type Power Power Power Power Power Ground Clocks Input Test ...

Page 126

... SLB CLB GLB SGPB CGPB GGPB SSE GSE WRAM SEFC GVE 1. DATA[7:0] pertains to the SAM7S32/16. 2. Applies to SAM7S512. Data Command Register Address Register LSBs Address Register MSBs Data Register No register Command Executed Read Flash Write Page Flash Write Page and Lock Flash ...

Page 127

Entering Programming Mode The following algorithm puts the device in Parallel Programming Mode: • Apply GND, VDDIO, VDDCORE, VDDFLASH and VDDPLL. • Apply XIN clock within T • Wait for T • Start a read or write handshaking. Note: ...

Page 128

... Figure 20-4. SAM7S32/16 Parallel Programming Timing, Write Sequence NCMD RDY NOE NVALID DATA[7:0] MODE[3:0] Table 20-4. Write Handshake Step Programmer Action 1 Sets MODE and DATA signals 2 Clears NCMD signal 3 Waits for RDY low 4 Releases MODE and DATA signals 5 Sets NCMD signal 6 Waits for RDY high 20 ...

Page 129

... Figure 20-6. SAM7S32/16 Parallel Programming Timing, Read Sequence NCMD RDY NOE NVALID DATA[7:0] MODE[3:0] Table 20-5. Read Handshake Step Programmer Action 1 Sets MODE and DATA signals 2 Clears NCMD signal 3 Waits for RDY low 4 Sets DATA signal in tristate 5 Clears NOE signal 6 Waits for NVALID low ...

Page 130

... Flash. In the following tables, 21-6 through 21-18 • DATA[15:0] pertains to SAM7S512/256/128/64/321/161 • DATA[7:0] pertains to SAM7S32/16 20.2.5.1 Flash Read Command This command is used to read the contents of the Flash memory. The read command can start at any valid address in the memory plane and is optimized for consecutive reads. Read hand- shaking can be chained ...

Page 131

Table 20-7. Step n+1 n+2 n+3 n+4 n+5 ... 20.2.5.2 Flash Write Command This command is used to write the Flash contents. The Flash memory plane is organized into several pages. Data to be written are stored in a load ...

Page 132

Table 20-9. Step ... n n+1 n+2 n+3 n+4 n+5 ... The Flash command Write Page and Lock (WPL) is equivalent to the Flash Write Command. However, the lock bit is automatically set at the end of ...

Page 133

In the same way, the Clear Lock command (CLB) is used to clear lock bits. All the lock bits are also cleared by the EA command. Table 20-11. Set and Clear Lock Bit Command Step 1 2 Lock bits can ...

Page 134

The SAM7S512 security bit is controlled by the EFC0. To use the Set Security Bit command, the EFC0 must be selected using the Select EFC command Table 20-15. Set Security Bit Command Step 1 2 Once the security bit is ...

Page 135

Table 20-17. Write Command (Continued) Step n+2 n+3 ... Table 20-18. Write Command Step ... n n+1 n+2 n+3 n+4 n+5 ... 20.2.5.9 Get Version Command The Get Version (GVE) command retrieves the ...

Page 136

Serial Fast Flash Programming The Serial Fast Flash programming interface is based on IEEE Std. 1149.1 “Standard Test Access Port and Boundary-Scan Architecture”. Refer to this standard for an explanation of terms used in this chapter and for a ...

Page 137

Table 20-20. Signal Description List (Continued) Signal Name Function TST Test Mode Select PGMEN0 Test Mode Select PGMEN1 Test Mode Select PGMEN2 Test Mode Select TCK JTAG TCK TDI JTAG Test Data In TDO JTAG Test Data Out TMS JTAG ...

Page 138

Read/Write Handshake The read/write handshake is done by carrying out read/write operations on two registers of the device that are accessible through the JTAG: • Debug Comms Control Register: DCCR • Debug Comms Data Register: DCDR Access to these ...

Page 139

Flash Read Command This command is used to read the Flash contents. The memory map is accessible through this command. Memory is seen as an array of words (32-bit wide). The read command can start at any valid address ...

Page 140

Flash Full Erase Command This command is used to erase the Flash memory planes. All lock bits must be deactivated before using the Full Erase command. This can be done by using the CLB command. Table 20-24. Full Erase ...

Page 141

GP NVM bits can be read using Get GPNVM Bit command (GGPB). When a bit set in the Bit Mask is returned, then the corresponding GPNVM bit is set. Table 20-28. Get General-purpose NVM Bit Command Read/Write Write Read 20.3.4.6 ...

Page 142

Memory Write Command This command is used to perform a write access to any memory location. The Memory Write command (WRAM) is optimized for consecutive writes. An internal address buffer is automatically increased. Table 20-31. Write Command Read/Write Write ...

Page 143

SAM7 Boot Program 21.1 Description The Boot Program integrates different programs permitting download and/or upload into the different memories of the product. First, it initializes the Debug Unit serial port (DBGU) and the USB Device Port. SAM-BA DBGU serial ...

Page 144

Device Initialization with USB Initialization follows the steps described below: 1. FIQ initialization 1. Stack setup for ARM supervisor mode 2. Setup the Embedded Flash Controller 3. External Clock detection 4. Main oscillator frequency detection if no external clock ...

Page 145

SAM-BA Boot The SAM-BA boot principle is to: Figure 21-3. Auto Baudrate Flow Diagram 6175L–ATARM–28-Jul-11 – Check if USB Device enumeration has occurred – Check if the Auto Baudrate sequence has succeeded (see Device Setup Character '0x80' received ? ...

Page 146

Once the communication interface is identified, the application runs in an infinite Table 21-1. Command • Write commands: Write a byte (O), a halfword ( word (W) ...

Page 147

DBGU Serial Port Communication is performed through the DBGU serial port initialized to 115200 Baud The Send and Receive File commands use the Xmodem protocol to communicate. Any termi- nal performing this protocol can be used ...

Page 148

USB Device Port A 48 MHz USB clock is necessary to use the USB Device port. It has been programmed ear- lier in the device initialization procedure with PLLB configuration. The device uses the USB communication device class (CDC) ...

Page 149

Communication Endpoints There are two communication endpoints and endpoint 0 is used for the enumeration process. Endpoint 64-byte Bulk OUT endpoint and endpoint 64-byte Bulk IN endpoint. SAM-BA Boot commands are sent by ...

Page 150

... The remaining available sizes for the user codes are as follows: 57344 bytes for SAM7S512, 57344 bytes for SAM7S256, 24576 bytes for SAM7S128, 8192 bytes for SAM7S64, 2048 bytes for SAM7S321 and SAM7S32, 3840 bytes for SAM7S161 and SAM7S16. • USB requirements: (Does not pertain to SAM7S32/16) Table 21-4 ...

Page 151

Peripheral DMA Controller (PDC) 22.1 Overview The Peripheral DMA Controller (PDC) transfers data between on-chip serial peripherals such as the UART, USART, SSC, SPI, MCI and the on- and off-chip memories. Using the Peripheral DMA Controller avoids processor intervention ...

Page 152

Functional Description 22.3.1 Configuration The PDC channels user interface enables the user to configure and control the data transfers for each channel. The user interface of a PDC channel is integrated into the user interface of the peripheral (offset ...

Page 153

Programming the Next Counter/Pointer registers chains the buffers. The counters are decre- mented after each data transfer as stated above, but when the transfer counter reaches zero, the values of the Next Counter/Pointer are loaded into the Counter/Pointer registers in ...

Page 154

Peripheral DMA Controller (PDC) User Interface Table 22-1. Register Mapping Offset Register 0x100 Receive Pointer Register 0x104 Receive Counter Register 0x108 Transmit Pointer Register 0x10C Transmit Counter Register 0x110 Receive Next Pointer Register 0x114 Receive Next Counter Register 0x118 ...

Page 155

PDC Receive Pointer Register Register Name: PERIPH_RPR Access Type: Read-write • RXPTR: Receive Pointer Address Address of the next receive transfer. 22.4.2 PDC Receive Counter Register Register Name: PERIPH_RCR Access Type: ...

Page 156

PDC Transmit Pointer Register Register Name: PERIPH_TPR Access Type: Read-write • TXPTR: Transmit Pointer Address Address of the transmit buffer. 22.4.4 PDC Transmit Counter Register Register Name: PERIPH_TCR Access Type: Read-write ...

Page 157

PDC Receive Next Pointer Register Register Name: PERIPH_RNPR Access Type: Read-write • RXNPTR: Receive Next Pointer Address RXNPTR is the address of the next buffer to fill with received data when ...

Page 158

PDC Transmit Next Pointer Register Register Name: PERIPH_TNPR Access Type: Read-write • TXNPTR: Transmit Next Pointer Address TXNPTR is the address of the next buffer to transmit when the current buffer ...

Page 159

PDC Transfer Control Register Register Name: PERIPH_PTCR - Access Type: Write only 31 30 – – – – – – – – • RXTEN: Receiver Transfer Enable effect ...

Page 160

PDC Transfer Status Register Register Name: PERIPH_PTSR Access Type: Read-only 31 30 – – – – – – – – • RXTEN: Receiver Transfer Enable 0 = Receiver PDC transfer requests are disabled. ...

Page 161

Advanced Interrupt Controller (AIC) 23.1 Overview The Advanced Interrupt Controller (AIC 8-level priority, individually maskable, vectored interrupt controller, providing handling thirty-two interrupt sources designed to sub- stantially reduce the software and real-time ...

Page 162

Application Block Diagram Figure 23-2. Description of the Application Block 23.4 AIC Detailed Block Diagram Figure 23-3. AIC Detailed Block Diagram 23.5 I/O Line Description Table 23-1. I/O Line Description Pin Name FIQ IRQ0 - IRQn SAM7S Series 162 ...

Page 163

Product Dependencies 23.6.1 I/O Lines The interrupt signals FIQ and IRQ0 to IRQn are normally multiplexed through the PIO control- lers. Depending on the features of the PIO controller used in the product, the pins must be programmed in ...

Page 164

Functional Description 23.7.1 Interrupt Source Control 23.7.1.1 Interrupt Source Mode The Advanced Interrupt Controller independently programs each interrupt source. The SRC- TYPE field of the corresponding AIC_SMR (Source Mode Register) selects the interrupt condition of each source. The internal ...

Page 165

Internal Interrupt Source Input Stage Figure 23-4. 23.7.1.6 External Interrupt Source Input Stage Figure 23-5. External Interrupt Source Input Stage Source i AIC_ISCR AIC_ICCR 6175L–ATARM–28-Jul-11 Internal Interrupt Source Input Stage AIC_SMRI (SRCTYPE) Level/ Source i Edge Edge Detector Set ...

Page 166

Interrupt Latencies Global interrupt latencies depend on several parameters, including: • The time the software masks the interrupts. • Occurrence, either at the processor level or at the AIC level. • The execution time of the instruction in progress ...

Page 167

External Interrupt Level Sensitive Source Figure 23-7. 23.7.2.3 Internal Interrupt Edge Triggered Source Figure 23-8. 23.7.2.4 Internal Interrupt Level Sensitive Source Figure 23-9. 6175L–ATARM–28-Jul-11 External Interrupt Level Sensitive Source MCK IRQ or FIQ (High Level) IRQ or FIQ (Low ...

Page 168

Normal Interrupt 23.7.3.1 Priority Controller An 8-level priority controller drives the nIRQ line of the processor, depending on the interrupt conditions occurring on the interrupt sources (except for those programmed in Fast Forcing). Each interrupt source ...

Page 169

When the processor executes this instruction, it loads the read value in AIC_IVR in its program counter, thus branching the execution on the correct interrupt handler. This feature is often not used when the application is based on an operating ...

Page 170

Further interrupts can then be unmasked by clearing the “I” bit in CPSR, allowing re- assertion of the nIRQ to be taken into account by the core. This can happen if an inter- rupt with a higher priority than ...

Page 171

Fast Interrupt 23.7.4.1 Fast Interrupt Source The interrupt source 0 is the only source which can raise a fast interrupt request to the processor except if fast forcing is used. The interrupt source 0 is generally connected to a ...

Page 172

In this case only, it de-asserts the nFIQ line on the processor. 4. The previous step enables branching to the corresponding interrupt service routine ...

Page 173

All enabled and pending interrupt sources that have the fast forcing feature enabled and that are programmed in edge-triggered mode must be cleared by writing to the Interrupt Clear Command Register. In doing so, they are cleared independently and thus ...

Page 174

Protect Mode The Protect Mode permits reading the Interrupt Vector Register without performing the associ- ated automatic operations. This is necessary when working with a debug system. When a debugger, working either with a Debug Monitor or the ARM ...

Page 175

An internal interrupt source is programmed in level sensitive and the output signal of the corresponding embedded peripheral is activated for a short time. (As in the case for the Watchdog.) • An interrupt occurs just a few cycles ...

Page 176

Advanced Interrupt Controller (AIC) User Interface 23.8.1 Base Address The AIC is mapped at the address 0xFFFF F000. It has a total 4-Kbyte addressing space. This permits the vectoring fea- ture, as the PC-relative load/store instructions of the ARM ...

Page 177

AIC Source Mode Register Register Name: AIC_SMR0..AIC_SMR31 Access Type: Read/Write Reset Value: 0x0 31 30 – – – – – – – SRCTYPE • PRIOR: Priority Level Programs the priority level for all ...

Page 178

AIC Source Vector Register Register Name: AIC_SVR0..AIC_SVR31 Access Type: Read/Write Reset Value: 0x0 • VECTOR: Source Vector The user may store in these registers the addresses of the corresponding handler for ...

Page 179

AIC FIQ Vector Registe Register Name: AIC_FVR Access Type: Read-only Reset Value • FIQV: FIQ Vector Register The FIQ Vector Register contains the vector programmed by the user in ...

Page 180

AIC Interrupt Pending Register Register Name: AIC_IPR Access Type: Read-only Reset Value: 0x0 31 30 PID31 PID30 23 22 PID23 PID22 15 14 PID15 PID14 7 6 PID7 PID6 • FIQ, SYS, PID2-PID31: Interrupt Pending 0 = Corresponding interrupt ...

Page 181

AIC Core Interrupt Status Register Register Name: AIC_CISR Access Type: Read-only Reset Value: 0x0 31 30 – – – – – – – – • NFIQ: NFIQ Status 0 = nFIQ line is ...

Page 182

AIC Interrupt Disable Command Register Register Name: AIC_IDCR Access Type: Write-only 31 30 PID31 PID30 23 22 PID23 PID22 15 14 PID15 PID14 7 6 PID7 PID6 • FIQ, SYS, PID2-PID31: Interrupt Disable effect ...

Page 183

AIC Interrupt Set Command Register Register Name: AIC_ISCR Access Type: Write-only 31 30 PID31 PID30 23 22 PID23 PID22 15 14 PID15 PID14 7 6 PID7 PID6 • FIQ, SYS, PID2-PID31: Interrupt Set effect ...

Page 184

AIC Spurious Interrupt Vector Register Register Name: AIC_SPU Access Type: Read/Write Reset Value: 0x0 • SIVR: Spurious Interrupt Vector Register The user may store the address of a spurious interrupt handler ...

Page 185

AIC Fast Forcing Enable Register Register Name: AIC_FFER Access Type: Write-only 31 30 PID31 PID30 23 22 PID23 PID22 15 14 PID15 PID14 7 6 PID7 PID6 • SYS, PID2-PID31: Fast Forcing Enable effect ...

Page 186

AIC Fast Forcing Status Register Register Name: AIC_FFSR Access Type: Read-only 31 30 PID31 PID30 23 22 PID23 PID22 15 14 PID15 PID14 7 6 PID7 PID6 • SYS, PID2-PID31: Fast Forcing Status 0 = The Fast Forcing feature ...

Page 187

Clock Generator 24.1 Overview The Clock Generator is made PLL, a Main Oscillator, as well Oscillator. It provides the following clocks: • SLCK, the Slow Clock, which is the only permanent clock within ...

Page 188

Figure 24-2. Typical Crystal Connection 24.3.2 Main Oscillator Startup Time The startup time of the Main Oscillator is given in the DC Characteristics section of the product datasheet. The startup time depends on the crystal frequency and decreases when the ...

Page 189

Slow Clock, so that the frequency of the crystal connected on the Main Oscillator can be determined. 24.3.5 Main Oscillator Bypass The user can input a clock on the device instead of connecting a crystal. In this case, the user ...

Page 190

Divider and Phase Lock Loop Programming The divider can be set between 1 and 255 in steps of 1. When a divider field (DIV) is set to 0, the output of the corresponding divider and the PLL output is ...

Page 191

... Peripheral Clocks are named MCK in the product datasheet. • UDP Clock (UDPCK), required by USB Device Port operations. (Does not pertain to SAM7S32/16.) • Programmable Clock Outputs can be selected from the clocks provided by the clock generator and driven on the PCKx pins. ...

Page 192

... USB Clock Controller Note: The USB Clock Controller does not pertain to SAM7S32/16. The USB Source Clock is the PLL output. If using the USB, the user must program the PLL to generate a 48 MHz MHz or a 192 MHz signal with an accuracy of ± 0.25% depending on the USBDIV bit in CKGR_PLLR ...

Page 193

The bit number within the Peripheral Clock Control registers (PMC_PCER, PMC_PCDR, and PMC_PCSR) is the Peripheral Identifier defined at the product level. Generally, the bit number corresponds to the interrupt source number assigned to the peripheral. 25.6 Programmable Clock Output ...

Page 194

... The user is constrained to wait for LOCK bit to be set before using the PLL output clock. The USBDIV field is used to control the additional divider which generates the USB clock(s) (Does not pertain to SAM7S32/16.) Code Example: If PLL and divider are enabled, the PLL input clock is the main clock. PLL output clock is PLL input clock multiplied by 5 ...

Page 195

Program the CSS field in the PMC_MCKR register. – Wait for the MCKRDY bit to be set in the PMC_SR register. • new value for CSS field corresponds to Main Clock or Slow Clock, – Program the ...

Page 196

... Once all of the previous steps have been completed, the peripheral clocks can be enabled and/or disabled via registers PMC_PCER and PMC_PCDR. Depending on the system used, SAM7S512/256/128/64/321, 12 and for SAM7S32/16, 10 peripheral clocks can be enabled or disabled. The PMC_PCSR provides a clear view as to which peripheral clock is enabled. ...

Page 197

Clock Switching Details 25.8.1 Master Clock Switching Timings Table 25-1 selected clock to another one. This is in the event that the prescaler is de-activated. When the prescaler is activated, an additional time of 64 clock cycles of the ...

Page 198

Figure 25-4. Switch Master Clock from Main Clock to Slow Clock Write PMC_MCKR Figure 25-5. Change PLL Programming Write CKGR_PLLR SAM7S Series 198 Slow Clock Main Clock MCKRDY Master Clock Main Clock PLL Clock LOCK MCKRDY Master Clock Main Clock ...

Page 199

Figure 25-6. Programmable Clock Output Programming Write PMC_PCKx Write PMC_SCER Write PMC_SCDR 6175L–ATARM–28-Jul-11 PLL Clock PCKRDY PCKx Output PLL Clock is selected SAM7S Series PCKx is enabled PCKx is disabled 199 ...

Page 200

... Interrupt Enable Register 0x0064 Interrupt Disable Register 0x0068 Status Register 0x006C Interrupt Mask Register 0x0070 - 0x007C Reserved Notes: 1. UDP bit of this register doe not pertain to SAM7S32/16. 2. USBDIV bit of this register does not pertain to SAM7S32/16 SAM7S Series 200 Name Access (1) PMC_SCER Write-only (1) PMC_SCDR Write-only ...

Related keywords