52
CY8C28xxx PSoC Programmable System-on-Chip TRM, Document No. 001-52594 Rev. *G
Supervisory ROM (SROM)
3.1.2.4
WriteBlock Function
The WriteBlock function stores data in the Flash. Data
moves 64 bytes at a time from SRAM to Flash using this
function. Before doing a write, you must successfully com-
plete an EraseAll or an EraseBlock.
The first thing the WriteBlock function does is check the pro-
tection bits and determine if the desired BLOCKID is write-
able. If write protection is turned on, the WriteBlock function
will exit, setting the accumulator and KEY2 back to 00h.
KEY1 will have a value of 01h, indicating a write failure.
Write protection is set when the PSoC device is pro-
grammed externally and cannot be changed through the
SSC function.
The BLOCKID of the
, where the data is stored,
must be determined and stored at SRAM address FAh. Valid
block IDs are 0x00 to 0xFF.
An MVI A, [expr] instruction is used to move data from
SRAM into Flash. Therefore, the MVI read pointer (MVR_PP
register) can be used to specify which SRAM page data is
pulled from. Using the MVI read pointer and the parameter
blocks POINTER value allows the SROM WriteBlock func-
tion to move data from any SRAM page into any Flash block.
The SRAM address, of the first of the 64 bytes to be stored
in Flash, must be indicated using the POINTER variable in
the parameter block (SRAM address FBh).
Finally, the CLOCK and DELAY value must be set correctly.
The CLOCK value determines the length of the write
that will be used to store the data in the Flash. The CLOCK
and DELAY values are dependent on the CPU speed and
must be set correctly. Refer to
for additional information.
The CPU must be less than or equal to 12 MHz for the oper-
ation to work correctly.
3.1.2.5
EraseBlock Function
The EraseBlock function is used to erase a block of 64 con-
tiguous bytes in Flash.
The first thing the EraseBlock function does is check the
protection bits and determine if the desired BLOCKID is
writeable. If write protection is turned on, the EraseBlock
function exits, setting the accumulator and KEY2 back to
00h. KEY1 has a value of 01h, indicating a write failure.
To set up the parameter block for the EraseBlock function,
store the correct key values in KEY1 and KEY2. The block
number to erased must be stored in the BLOCKID variable,
and the CLOCK and DELAY values must be set based on
the current CPU speed. For more information on setting the
CLOCK and DELAY values,
The CPU must be less than or equal to 12 MHz for the oper-
ation to work correctly.
3.1.2.6
ProtectBlock Function
The PSoC devices offer Flash protection on a block-by-
block basis.
lists the protection modes available.
In the table, ER and EW are used to indicate the ability to
perform external reads and writes (that is, by an external
programmer). For internal writes, IW is used. Internal read-
ing is always permitted by way of the ROMX instruction. The
ability to read by way of the SROM ReadBlock function is
indicated by SR.
In this table, note that all protection is removed by EraseAll.
3.1.2.7
TableRead Function
The TableRead function gives the user access to part-spe-
cific data stored in the Flash during manufacturing. The
Flash for these tables is separate from the program Flash
and is not directly accessible.
Table 3-8. WriteBlock Parameters (02h)
Name
Address
Type
Description
MVR_PP
0,D4h
Register
MVI read page pointer register.
KEY1
0,F8h
RAM
3Ah
KEY2
0,F9h
RAM
Stack Pointer value+3, when SSC is
executed.
BLOCKID
0,FAh
RAM
Flash block number
POINTER
0,FBh
RAM
First of 64 addresses in SRAM, where
the data to be stored in Flash is located
prior to calling WriteBlock.
CLOCK
0,FCh
RAM
Clock divider used to set the write pulse
width.
DELAY
0,FEh
RAM
For a CPU speed of 12 MHz set to 56h.
Table 3-9. EraseBlock Parameters (03h)
Name
Address
Type
Description
KEY1
0,F8h
RAM
3Ah
KEY2
0,F9h
RAM
Stack Pointer value+3, when SSC is
executed.
BLOCKID
0,FAh
RAM
Flash block number
CLOCK
0,FCh
RAM
Clock divider used to set the erase
pulse width.
DELAY
0,FEh
RAM
For a CPU speed of 12 MHz set to
56h.
Table 3-10. Protect Block Modes
Mode
Settings
Description
In PSoC Designer
00b
SR ER EW IW
Unprotected
U = Unprotected
01b
SR ER EW IW
Read protect
F = Factory upgrade
10b
SR ER EW IW
Disable external write
R = Field upgrade
11b
SR ER EW IW
Disable internal write
W = Full protection
Содержание CY8C28 series
Страница 65: ...64 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G RAM Paging ...
Страница 85: ...84 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Internal Main Oscillator IMO ...
Страница 93: ...92 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G External Crystal Oscillator ECO ...
Страница 97: ...96 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Phase Locked Loop PLL ...
Страница 125: ...124 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 311: ...310 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G IDAC_CR0 1 FDh ...
Страница 317: ...316 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 393: ...392 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...
Страница 425: ...424 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Analog Reference ...
Страница 461: ...460 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Two Column Limited Analog System ...
Страница 477: ...476 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Digital Clocks ...
Страница 483: ...482 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Multiply Accumulate MAC ...
Страница 513: ...512 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Internal Voltage Reference ...
Страница 523: ...522 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Switch Mode Pump SMP ...
Страница 533: ...532 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G I O Analog Multiplexer ...
Страница 537: ...536 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G Real Time Clock RTC ...
Страница 561: ...560 CY8C28xxx PSoC Programmable System on Chip TRM Document No 001 52594 Rev G ...