![Freescale Semiconductor HCS08 Series Скачать руководство пользователя страница 54](http://html1.mh-extra.com/html/freescale-semiconductor/hcs08-series/hcs08-series_reference-manual_2330628054.webp)
Chapter 4 Memory
MC9S08JS16 MCU Series Reference Manual, Rev. 4
54
Freescale Semiconductor
4.6.5
Access Errors
An access error occurs whenever the command execution protocol is violated.
Any of the following specific actions will cause the access error flag (FACCERR) in FSTAT to be set.
FACCERR must be cleared by writing a 1 to FACCERR in FSTAT before any command can be processed.
•
Writing to a flash address before the internal flash clock frequency has been set by writing to the
FCDIV register
•
Writing to a flash address while FCBEF is not set (A new command cannot be started until the
command buffer is empty.)
•
Writing a second time to a flash address before launching the previous command (There is only
one write to flash for every command.)
•
Writing a second time to FCMD before launching the previous command (There is only one write
to FCMD for every command.)
•
Writing to any flash control register other than FCMD after writing to a flash address
•
Writing any command code other than the five allowed codes (0x05, 0x20, 0x25, 0x40, and 0x41)
to FCMD
•
Accessing (read or write) any flash control register other than the write to FSTAT (to clear FCBEF
and launch the command) after writing the command to FCMD
•
The MCU enters stop mode while a program or erase command is in progress (The command is
aborted.)
•
Writing the byte program, burst program, or page erase command code (0x20, 0x25, or 0x40) with
a background debug command while the MCU is secured (The background debug controller can
only do blank check and mass erase commands when the MCU is secure.)
•
Writing 0 to FCBEF to cancel a partial command
4.6.6
Flash Block Protection
The block protection feature prevents the protected region of flash from program or erase changes. Block
protection is controlled through the flash protection register (FPROT). When enabled, block protection
begins at any 512 byte boundary below the last address of flash, 0xFFFF. (See
Protection Register (FPROT and NVPROT)
After exit from reset, FPROT is loaded with the contents of the NVPROT location that is in the nonvolatile
register block of the flash memory. FPROT cannot be changed directly from application software so a
runaway program cannot alter the block protection settings. Because NVPROT is within the last 512 bytes
of flash memory, if any amount of memory is protected, NVPROT is itself protected and cannot be altered
(intentionally or unintentionally) by the application software. FPROT can be written through background
debug commands which allows a way to erase and reprogram a protected flash memory.
The block protection mechanism is illustrated below. The FPS bits are used as the upper bits of the last
address of unprotected memory. This address is formed by concatenating FPS7:FPS1 with logic 1 bit as
shown. For example, to protect the last 1536 bytes of memory (addresses 0xFA00 through 0xFFFF), the
FPS bits must be set to 1111 100, which results in the value 0xF9FF as the last address of unprotected
memory. In addition to programming the FPS bits to the appropriate value, FPDIS (bit 0 of NVPROT)
Содержание HCS08 Series
Страница 2: ......
Страница 4: ......
Страница 8: ......
Страница 28: ...Chapter 2 Pins and Connections MC9S08JS16 MCU Series Reference Manual Rev 4 28 Freescale Semiconductor...
Страница 34: ...Chapter 3 Modes of Operation MC9S08JS16 MCU Series Reference Manual Rev 4 34 Freescale Semiconductor...
Страница 62: ...Chapter 4 Memory MC9S08JS16 MCU Series Reference Manual Rev 4 62 Freescale Semiconductor...
Страница 114: ...Keyboard Interrupt S08KBIV2 MC9S08JS16 MCU Series Reference Manual Rev 4 114 Freescale Semiconductor...
Страница 146: ...Multi Purpose Clock Generator S08MCGV1 MC9S08JS16 MCU Series Reference Manual Rev 4 146 Freescale Semiconductor...
Страница 166: ...Real Time Counter S08RTCV1 MC9S08JS16 MCU Series Reference Manual Rev 4 166 Freescale Semiconductor...
Страница 186: ...Serial Communications Interface S08SCIV4 MC9S08JS16 MCU Series Reference Manual Rev 4 186 Freescale Semiconductor...
Страница 214: ...16 Bit Serial Peripheral Interface S08SPI16V1 MC9S08JS16 MCU Series Reference Manual Rev 4 214 Freescale Semiconductor...
Страница 274: ...Universal Serial Bus Device Controller S08USBV1 MC9S08JS16 MCU Series Reference Manual Rev 4 274 Freescale Semiconductor...
Страница 282: ...Cyclic Redundancy Check Generator S08CRCV2 MC9S08JS16 MCU Series Reference Manual Rev 4 282 Freescale Semiconductor...
Страница 305: ......