Memory Controller Interface Peripheral

MC (AT91S_MC) 0xFFFFFF00 (AT91C_BASE_MC)
Periph ID AIC Symbol Description
1 (AT91C_ID_SYS) System Peripheral

Function Description
AT91F_MC_CfgPMCEnable Peripheral clock in PMC for MC


MC Software API (AT91S_MC)

Offset Field Description
0x0MC_RCRMC Remap Control Register
0x4MC_ASRMC Abort Status Register
0x8MC_AASRMC Abort Address Status Register
0x60MC_FMRMC Flash Mode Register
0x64MC_FCRMC Flash Command Register
0x68MC_FSRMC Flash Status Register

Function Description
AT91F_MC_EFC_IsInterruptMaskedTest if EFC MC Interrupt is Masked
AT91F_MC_EFC_CfgModeRegConfigure the EFC Mode Register of the MC controller
AT91F_MC_EFC_IsInterruptSetTest if EFC MC Interrupt is Set
AT91F_MC_EFC_ComputeFMCNReturn MC EFC Mode Regsiter
AT91F_MC_EFC_GetStatusReturn MC EFC Status
AT91F_MC_RemapMake Remap
AT91F_MC_EFC_GetModeRegReturn MC EFC Mode Regsiter
AT91F_MC_EFC_PerformCmdPerform EFC Command

MC Register Description

MC: AT91_REG MC_RCR - MC Remap Control Register

Offset Name Description
0MC_RCB
AT91C_MC_RCB
Remap Command Bit
0: No effect.
1: This Command Bit acts on a toggle basis: writing a 1 alternatively cancels and restores the remapping of the page zero memory devices.

MC: AT91_REG MC_ASR - MC Abort Status Register

Offset Name Description
0MC_UNDADD
AT91C_MC_UNDADD
Undefined Addess Abort Status
0: The last abort is not due to the access of an undefined address in the address space.
1: The last abort is due to the access of an undefined address in the address space.
1MC_MISADD
AT91C_MC_MISADD
Misaligned Addess Abort Status
0: During the last aborted access, the address was not unaligned.
1: During the last aborted access, the address was unaligned.
9..8MC_ABTSZ
AT91C_MC_ABTSZ
Abort Size Status
This field gives the size of the aborted access of the current master.
ValueLabelDescription
0MC_ABTSZ_BYTE
AT91C_MC_ABTSZ_BYTE

Byte
1MC_ABTSZ_HWORD
AT91C_MC_ABTSZ_HWORD

Half-word
2MC_ABTSZ_WORD
AT91C_MC_ABTSZ_WORD

Word
11..10MC_ABTTYP
AT91C_MC_ABTTYP
Abort Type Status
This field gives the type of the aborted access of the current master.
ValueLabelDescription
0MC_ABTTYP_DATAR
AT91C_MC_ABTTYP_DATAR

Data Read
1MC_ABTTYP_DATAW
AT91C_MC_ABTTYP_DATAW

Data Write
2MC_ABTTYP_FETCH
AT91C_MC_ABTTYP_FETCH

Code Fetch
16MC_MST0
AT91C_MC_MST0
Master 0 Abort Source
0: The last abort was not due to the Master 0.
1: The last abort was due to the Master 0.
17MC_MST1
AT91C_MC_MST1
Master 1 Abort Source
0: The last abort was not due to the Master 1.
1: The last abort was due to the Master 1.
24MC_SVMST0
AT91C_MC_SVMST0
Saved Master 0 Abort Source
0: No abort due to the Master 0 occurred since the last read of MC_ASR or it is notified in the bit MST0.
1: At least one abort due to the Master 0 occurred since the last read of MC_ASR.
25MC_SVMST1
AT91C_MC_SVMST1
Saved Master 1 Abort Source
0: No abort due to the Master 1 occurred since the last read of MC_ASR or it is notified in the bit MST1.
1: At least one abort due to the Master 1 occurred since the last read of MC_ASR.

MC: AT91_REG MC_AASR - MC Abort Address Status Register


This register contains the address of the last aborted access

MC: AT91_REG MC_FMR - MC Flash Mode Register


For MC_FRDY, MC_LOCKE and MC_PROGE, 0: Interrupt enabled, 1: Interrupt disabled
Offset Name Description
0MC_FRDY
AT91C_MC_FRDY
Flash Ready
0 = FRDY high in MC_FSR does not generate an interrupt
1= FRDY high in MC_FSR generates an interrupt
2MC_LOCKE
AT91C_MC_LOCKE
Lock Error
0 = LOCKE high in MC_FSR does not generate an interrupt
1 = LOCKE high in MC_FSR generates an interrupt
3MC_PROGE
AT91C_MC_PROGE
Programming Error
0 = PROGE high in MC_FSR does not generate an interrupt
1 = PROGE high in MC_FSR generates an interrupt
7MC_NEBP
AT91C_MC_NEBP
No Erase Before Programming
0: A page erase is performed before programming.
1: No erase is performed before programming.
9..8MC_FWS
AT91C_MC_FWS
Flash Wait State
This field defines the number of wait states for read and write operations.
ValueLabelDescription
0MC_FWS_0FWS
AT91C_MC_FWS_0FWS

1 cycle for Read, 2 for Write operations
1MC_FWS_1FWS
AT91C_MC_FWS_1FWS

2 cycles for Read, 3 for Write operations
2MC_FWS_2FWS
AT91C_MC_FWS_2FWS

3 cycles for Read, 4 for Write operations
3MC_FWS_3FWS
AT91C_MC_FWS_3FWS

4 cycles for Read, 4 for Write operations
23..16MC_FMCN
AT91C_MC_FMCN
Flash Microsecond Cycle Number
This field defines the number of Master Clock cycles in one microsecond.
The value 0 corresponds to the timings for a 33.3 kHz clock.

MC: AT91_REG MC_FCR - MC Flash Command Register

Offset Name Description
3..0MC_FCMD
AT91C_MC_FCMD
Flash Command
This field defines the different flash commands.
ValueLabelDescription
1MC_FCMD_START_PROG
AT91C_MC_FCMD_START_PROG

Starts the programming of th epage specified by PAGEN.
2MC_FCMD_LOCK
AT91C_MC_FCMD_LOCK

Starts a lock sequence of the sector defined by the bits 4 to 7 of the field PAGEN.
3MC_FCMD_PROG_AND_LOCK
AT91C_MC_FCMD_PROG_AND_LOCK

The lock sequence automatically happens after the programming sequence is completed.
4MC_FCMD_UNLOCK
AT91C_MC_FCMD_UNLOCK

Starts an unlock sequence of the sector defined by the bits 4 to 7 of the field PAGEN.
8MC_FCMD_ERASE_ALL
AT91C_MC_FCMD_ERASE_ALL

Starts the erase of the entire flash.If at least a page is locked, the command is cancelled.
11MC_FCMD_SET_GP_NVM
AT91C_MC_FCMD_SET_GP_NVM

Set General Purpose NVM bits.
13MC_FCMD_CLR_GP_NVM
AT91C_MC_FCMD_CLR_GP_NVM

Clear General Purpose NVM bits.
15MC_FCMD_SET_SECURITY
AT91C_MC_FCMD_SET_SECURITY

Set Security Bit.
17..8MC_PAGEN
AT91C_MC_PAGEN
Page Number
This field defines the page/sector currently in use, whatever it is for programming, locking or unlocking.
31..24MC_KEY
AT91C_MC_KEY
Writing Protect Key
This field should be written with the value 0x5A to enable the command defined by the bits of the register.
If the field is written with a different value, the write is actually not performed and no action is started.

MC: AT91_REG MC_FSR - MC Flash Status Register

Offset Name Description
0MC_FRDY
AT91C_MC_FRDY
Flash Ready
0 = FRDY high in MC_FSR does not generate an interrupt
1= FRDY high in MC_FSR generates an interrupt
2MC_LOCKE
AT91C_MC_LOCKE
Lock Error
0 = LOCKE high in MC_FSR does not generate an interrupt
1 = LOCKE high in MC_FSR generates an interrupt
3MC_PROGE
AT91C_MC_PROGE
Programming Error
0 = PROGE high in MC_FSR does not generate an interrupt
1 = PROGE high in MC_FSR generates an interrupt
4MC_SECURITY
AT91C_MC_SECURITY
Security Bit Status
0: Security Bit is not set.
1:Security Bit is set.
8MC_GPNVM0
AT91C_MC_GPNVM0
Sector 0 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
9MC_GPNVM1
AT91C_MC_GPNVM1
Sector 1 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
10MC_GPNVM2
AT91C_MC_GPNVM2
Sector 2 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
11MC_GPNVM3
AT91C_MC_GPNVM3
Sector 3 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
12MC_GPNVM4
AT91C_MC_GPNVM4
Sector 4 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
13MC_GPNVM5
AT91C_MC_GPNVM5
Sector 5 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
14MC_GPNVM6
AT91C_MC_GPNVM6
Sector 6 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
15MC_GPNVM7
AT91C_MC_GPNVM7
Sector 7 Lock Status
0: General purpose NVM bit is not set.
1:General purpose NVM bit is set.
16MC_LOCKS0
AT91C_MC_LOCKS0
Sector 0 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
17MC_LOCKS1
AT91C_MC_LOCKS1
Sector 1 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
18MC_LOCKS2
AT91C_MC_LOCKS2
Sector 2 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
19MC_LOCKS3
AT91C_MC_LOCKS3
Sector 3 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
20MC_LOCKS4
AT91C_MC_LOCKS4
Sector 4 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
21MC_LOCKS5
AT91C_MC_LOCKS5
Sector 5 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
22MC_LOCKS6
AT91C_MC_LOCKS6
Sector 6 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
23MC_LOCKS7
AT91C_MC_LOCKS7
Sector 7 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
24MC_LOCKS8
AT91C_MC_LOCKS8
Sector 8 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
25MC_LOCKS9
AT91C_MC_LOCKS9
Sector 9 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
26MC_LOCKS10
AT91C_MC_LOCKS10
Sector 10 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
27MC_LOCKS11
AT91C_MC_LOCKS11
Sector 11 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
28MC_LOCKS12
AT91C_MC_LOCKS12
Sector 12 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
29MC_LOCKS13
AT91C_MC_LOCKS13
Sector 13 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
30MC_LOCKS14
AT91C_MC_LOCKS14
Sector 14 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.
31MC_LOCKS15
AT91C_MC_LOCKS15
Sector 15 Lock Status
0: The corresponding sector is not locked.
1:The corresponding sector is locked.