
Supervisory ROM (SROM)
CY8C24xxx Preliminary Data Sheet
48
Document No. 38-12011 Rev. *E
December 22, 2003
4.1.1
Additional SROM Feature
The SROM has the following additional SROM feature.
Return Codes:
These aid in the determination of success
or failure of a particular function. The return code is stored in
KEY1’s position in the parameter block. The CheckSum and
TableRead functions do not have return codes because
KEY1’s position in the parameter block is used to return
other data.
Note
Read, write, and erase operations may fail if the target
block is read or write protected. Block protection levels are
set during device programming.
4.1.2
SROM Function Descriptions
4.1.2.1
SWBootReset Function
The SROM function SWBootReset is the function that is
responsible for transitioning the device from a reset state to
running user code. See the Types of Resets chapter for
more information on what events will cause the SWBootRe-
set function to execute.
The SWBootReset function is executed whenever the
SROM is entered with an M8C accumulator value of 00h:
the SRAM parameter block is not used as an input to the
function. This will happen, by design, after a hardware reset,
because the M8C's accumulator is reset to 00h or when
user code executes the SSC instruction with an accumulator
value of 00h.
The SWBootReset's calibration function, Calibrate1, trans-
fers the calibration data one byte at a time from Flash to
SRAM. As the bytes are transferred, the sum of the bytes,
plus a hard coded offset value of EBh, is calculated in a 2-
byte SRAM variable (CHECKSUM). If at the end of the
transfer the value of CHECKSUM (plus the offset value of
EBh) is zero, the SWBootReset function uses the values
stored in SRAM to calibrate the registers in the PSoC
device. If CHECKSUM has a non-zero value, the IRES bit in
CPU_SCR1 is set, which causes a hardware reset similar to
a POR event. For more information on this condition,
see
“System Resets” on page 297
.
If the checksum of the calibration data is zero, the
SWBootReset function ends by setting the M8C registers
(CPU_SP, CPU_PC, CPU_X, CPU_F, CPU_A) to 00h, after
writing 00h to most SRAM addresses, and then begins to
execute user code at address 0000h.
Table 4-5
documents the value of all the SRAM addresses in
page zero, after a successful SWBootReset. A cell in the
table with “xx” in it, indicates that the SRAM address is not
modified by the SWBootReset function. A hex value in a cell
indicates that the address should always have the indicated
value after a successful SWBootReset.
A cell with a “” in it indicates that the value, after a
SWBootReset, is determined by the value of IRAMDIS in
CPU_SCR1. If IRAMDIS is not set, these addresses will be
initialized to 00h. If IRAMDIS is set, these addresses will not
be modified by a SWBootReset. The IRAMDIS bit allows
variables to be preserved even if a watchdog reset occurs.
The IRAMDIS bit is reset by all system resets except Watch-
dog reset. Therefore, this bit is only useful for Watchdog
resets and not general resets.
Address F8h is the return code byte for all SROM functions,
for this function, the only acceptable values are 00h and
02h. Address FCh is the fail count variable. After POR,
WDR, or XRES, the variable is initialized to 00h by the
SROM. Each time the checksum fails, the fail count is incre-
mented. Therefore, if it takes two passes through
Table 4-4. SROM Return Code Meanings
Return Code Value
Description
Success
Function not allowed due to level of protection on
block
Software reset without hardware reset
Fatal error, SROM halted
00h
01h
02h
03h
Table 4-5. SRAM Map Post SWBootReset
Address
0
8
1
9
2
A
3
B
0x00
0x00
0x00
0x00
4
C
0x00
0x00
0x00
0x00
5
D
0x00
0x00
0x00
0x00
6
E
0x00
0x00
0x00
7
F
0x00
0x00
0x00
0x0_
0x00
0x00
0x00
0x00
0x00
0x00
0x02
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x00
0x1_
0x2_
0x3_
0x4_
0x5_
0x6_
0x7_
0x8_
0x9_
0xA_
0xB_
0xC_
0xD_
0xE_
0xF_
xx
0x00
0x00
0xn
xx
0x00
0x00